summaryrefslogtreecommitdiff
path: root/fixco_custom
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom')
-rwxr-xr-xfixco_custom/models/sale.py11
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()