Merge pull request #5741 from expsa/khazraji_annual

tr5
This commit is contained in:
mohammed-alkhazrji 2025-12-15 23:47:15 +03:00 committed by GitHub
commit 34b85811e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 5 deletions

View File

@ -328,12 +328,17 @@ class AnnualPurchaseRequest(models.Model):
return self._open_reason_wizard('manager_reject') return self._open_reason_wizard('manager_reject')
def action_send_to_committee(self): def action_send_to_committee(self):
if self.rfq_count > 0: for rec in self:
self.write({'sent_to_commitee': True}) if rec.rfq_count > 0:
self.write({'state': 'committee'}) rec.write({
else: 'sent_to_commitee': True,
raise UserError("لا يمكن الإرسال إلى اللجنة لأن عدد RFQs يساوي صفر.") 'state': 'committee'
})
rec.rfq_ids.write({'state': 'committee'})
else:
raise UserError("لا يمكن الإرسال إلى اللجنة لأن عدد RFQs يساوي صفر.")
def action_send_to_ssd(self): def action_send_to_ssd(self):
self.write({'state':'ssd'}) self.write({'state':'ssd'})