diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-06 13:55:37 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-05-06 13:55:37 +0700 |
| commit | 08fb1ce211c3bc11e6ff0ea6ff37e0be8b7c2b31 (patch) | |
| tree | bd2c2e21a70d69a423dde1069161ddf1b1c9e2ac /indoteknik_custom/models | |
| parent | 5b78ec72f001ad0d5ccde1269d1ec86418fb7339 (diff) | |
qty hold outgoing and ask cancel purchasing
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 15 |
1 files changed, 4 insertions, 11 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: |
