diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-01-12 15:42:16 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-01-12 15:42:16 +0700 |
| commit | 283baf2945adfbadaddd9fb0ca732df894189062 (patch) | |
| tree | 3f36a7fdee2f180bb4c11c8cbf50ce44d35da23b | |
| parent | eedd71af67b880d7c07eb1137bf3c85a48881f48 (diff) | |
fix validation iu minus on inventory
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 0c810ef7..f6a21698 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -286,10 +286,10 @@ class StockPicking(models.Model): for line in self.move_line_ids_without_package: quant = self.env['stock.quant'].search([ ('product_id', '=', line.product_id.id), - ('location_id', '=', bu_location_id) + ('location_id', '=', bu_location_id), ]) - if quant and quant.inventory_quantity < line.product_uom_qty: + if self.sale_id and quant and quant.inventory_quantity < line.product_uom_qty: raise UserError('Quantity reserved lebih besar dari quantity onhand di product') def button_validate(self): |
