diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-11-26 10:10:27 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-11-26 10:10:27 +0700 |
| commit | 9c3a7bba06bba9db22d84286f96739ef37e49ace (patch) | |
| tree | b24057e2464140e952647118af6f21976fa7e06b | |
| parent | 25edffb8ebf51e4b133132f4fbd49363b1426664 (diff) | |
| parent | f55504662c191b2ed89773fde521d9006c15d3ee (diff) | |
Merge branch 'main' of bitbucket.org:altafixco/fixco-addons
push
| -rwxr-xr-x | fixco_custom/models/sale.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fixco_custom/models/sale.py b/fixco_custom/models/sale.py index 9c4ed6b..11340eb 100755 --- a/fixco_custom/models/sale.py +++ b/fixco_custom/models/sale.py @@ -194,4 +194,13 @@ class SaleOrder(models.Model): for order in self: order._check_duplicate_order_id() res = super(SaleOrder, self).action_confirm() - return res
\ No newline at end of file + return res + + def _clean_sale_order(self): + orders = self.env['sale.order'].search([ + # ('invoice_status', '=', 'no'), + ('state', 'in', ['draft', 'sale']) + ], limit=2000) + for order in orders: + print("cancel sales or draft "+order.name) + order.action_cancel() |
