From 08fb1ce211c3bc11e6ff0ea6ff37e0be8b7c2b31 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 6 May 2025 13:55:37 +0700 Subject: qty hold outgoing and ask cancel purchasing --- indoteknik_custom/models/sale_order.py | 15 ++++----------- indoteknik_custom/views/sale_order.xml | 5 +++-- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 8af34c75..aa4ece13 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -281,17 +281,10 @@ class SaleOrder(models.Model): } def hold_unhold_qty_outgoing_so(self): - pickings = self.env['stock.picking'].search([('sale_id', '=', self.id), ('state', 'not in', ['cancel','done']), ('name', 'ilike', 'BU/PICK/%')]) - products = self.order_line.mapped('product_id') - for picking in pickings: - for line in picking.move_ids_without_package: - if line.product_id in products: - if line.hold_outgoingg == True: - line.hold_outgoingg = False - self.hold_outgoing = False - else: - line.hold_outgoingg = True - self.hold_outgoing = True + if self.hold_outgoing == True: + self.hold_outgoing = False + else: + self.hold_outgoing = True def _validate_uniform_taxes(self): for order in self: diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 40a57203..30047558 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -19,10 +19,10 @@