diff options
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 2d8d97bd..13f4745d 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -80,6 +80,29 @@ class SaleOrder(models.Model): estimated_arrival_days = fields.Integer('Estimated Arrival Days', default=0) email = fields.Char(string='Email') + @api.model + def action_multi_update_state(self): + order_ids = self.env.context.get('active_ids', []) + sale_order = self.search([('id', 'in', order_ids)]) + for sale in sale_order: + sale.update({ + 'state': 'cancel', + }) + + if sale.state == 'cancel': + sale.update({ + 'approval_status': False, + }) + + @api.model + def action_multi_update_invoice_status(self): + order_ids = self.env.context.get('active_ids', []) + sale_order = self.search([('id', 'in', order_ids)]) + for sale in sale_order: + sale.update({ + 'invoice_status': 'invoiced', + }) + def _compute_purchase_total(self): for order in self: total = 0 |
