summaryrefslogtreecommitdiff
path: root/fixco_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-11-26 10:10:27 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-11-26 10:10:27 +0700
commit9c3a7bba06bba9db22d84286f96739ef37e49ace (patch)
treeb24057e2464140e952647118af6f21976fa7e06b /fixco_custom/models
parent25edffb8ebf51e4b133132f4fbd49363b1426664 (diff)
parentf55504662c191b2ed89773fde521d9006c15d3ee (diff)
Merge branch 'main' of bitbucket.org:altafixco/fixco-addons
push
Diffstat (limited to 'fixco_custom/models')
-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()