Merge pull request #2761 from expsa/samir-aladawi-fix-purchase-requisition

[FIX] purchase_requisition_custom
This commit is contained in:
SamirLADOUI-sa 2025-04-14 14:29:42 +01:00 committed by GitHub
commit 44eab66644
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -91,6 +91,8 @@ class PurchaseRequisitionCustom(models.Model):
change_state_line = fields.One2many('change.purchase.user.state', 'requisition_id')
date_end = fields.Datetime(string='Agreement Deadline', tracking=True)
check_request = fields.Boolean(compute='check_request_field')
type_exclusive = fields.Selection(related='type_id.exclusive')
def get_attachments(self):
# Check if multiple records are passed, and handle them in a loop

View File

@ -457,10 +457,13 @@
attrs="{'invisible':[('type','!=', 'project')], 'required':[('type','=', 'project')], 'readonly':[('state' , '!=' , 'draft')]}"/>
<field name="request_id" readonly="1"/>
<field name="type_exclusive" invisible="1"/>
</xpath>
<xpath expr="//field[@name='vendor_id']" position="attributes">
<attribute name="attrs">{'readonly':[('state','in',('cancel','checked','done','waiting'))]}
</attribute>
<attribute name="attrs">{
'readonly': [('state','in',('cancel','checked','done','waiting'))],
'required': [('type_exclusive', '=', 'multiple')]
}</attribute>
</xpath>
<xpath expr="//field[@name='ordering_date']" position="attributes">
<attribute name="required">1</attribute>