diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-20 14:00:06 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-20 14:00:06 +0700 |
| commit | fcef24bcce3d9e1d916bef3ff74429c990edf3b7 (patch) | |
| tree | d9795a09ded77909ad3ec6fab15c491245b0353a | |
| parent | 6adef807baa548aa132418d80e21b04cd5e21a68 (diff) | |
fix bug
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 22 | ||||
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 2 |
2 files changed, 13 insertions, 11 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 3d04a416..423cbb0a 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -1330,18 +1330,20 @@ class StockPicking(models.Model): current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') self.date_reserved = current_time + # Validate Qty Demand Can't higher than Qty Product - for move_line in self.move_line_ids_without_package: - purchase_line = move_line.move_id.purchase_line_id - if purchase_line: - if purchase_line.product_uom_qty < move_line.product_uom_qty: - raise UserError( - _("Quantity demand (%s) tidak bisa lebih besar dari qty product (%s) untuk produk %s") % ( - move_line.product_uom_qty, - purchase_line.product_uom_qty, - move_line.product_id.display_name + if self.location_dest_id.id == 58 and 'BU/INPUT/' in self.name: + for move in self.move_ids_without_package: + purchase_line = move.purchase_line_id + if purchase_line: + if purchase_line.product_qty < move.quantity_done: + raise UserError( + _("Quantity demand (%s) tidak bisa lebih besar dari qty product (%s) untuk produk %s") % ( + move.quantity_done, + purchase_line.product_qty, + move.product_id.display_name + ) ) - ) self.validation_minus_onhand_quantity() self.responsible = self.env.user.id diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index be31456b..0a99fe3a 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -486,7 +486,7 @@ <field name="payment_state_custom" widget="badge" decoration-danger="payment_state_custom == 'unpaid'" decoration-success="payment_state_custom == 'paid'" - decoration-warning="payment_state_custom == 'partial'"/> + decoration-warning="payment_state_custom == 'partial'" optional="hide"/> <field name="unreserved_percent" widget="percentpie" string="Unreserved"/> <field name="reserved_percent" widget="percentpie" string="Reserved"/> <field name="delivered_percent" widget="percentpie" string="Delivered"/> |
