[FIX] purchase_requisition_custom

This commit is contained in:
Samir Ladoui 2025-04-16 07:39:20 +01:00
parent 80386ed678
commit 1a2a033d06
2 changed files with 5 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class BudgetConfirmationCustom(models.Model):
amount += line.amount
budget_lines.write({'reserve': amount})
if self.po_id.requisition_id:
if self.po_id.requisition_id and self.po_id.requisition_type_exclusive == 'exclusive':
self.po_id.requisition_id.write({'state': 'checked'})
if self.po_id:
self.po_id.write({'state': 'to approve'})

View File

@ -94,6 +94,10 @@ class PurchaseRequisitionCustom(models.Model):
type_exclusive = fields.Selection(related='type_id.exclusive')
def write(self, vals):
res = super(PurchaseRequisitionCustom, self).write(vals)
return res
def get_attachments(self):
# Check if multiple records are passed, and handle them in a loop
if len(self) > 1: