fix issue in state

This commit is contained in:
ronozoro 2024-11-06 00:04:09 -08:00
parent d4f0a724b6
commit ccb761c981
No known key found for this signature in database
GPG Key ID: 7C2BDED35C62C0F3
1 changed files with 2 additions and 1 deletions

View File

@ -537,7 +537,8 @@ class PurchaseOrderCustom(models.Model):
def button_confirm(self):
for order in self:
if order.state not in ['draft']:
return super(PurchaseOrderCustom, self).button_confirm()
order.write({'state': 'purchase'})
return True
order._add_supplier_to_product()
# Deal with double validation process
if order._approval_allowed():