Update project_invoice.py

This commit is contained in:
zainab2097 2024-08-28 17:59:26 +03:00 committed by GitHub
parent 1f84e2e024
commit 20b5511ba2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -231,7 +231,11 @@ class ProjectInvoice(models.Model):
def action_set_to_draft(self):
self.ensure_one()
self.state = 'draft'
if self.invoice_id.state=='draft':
self.invoice_id=False or [(5, 0, 0)]
self.state = 'draft'
else:
raise UserError(_("Kindly The invoice is not in draft state, so it cannot be unlinked."))
def action_get_invoice(self):
self.ensure_one()