diff options
| -rw-r--r-- | indoteknik_custom/models/mrp_production.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/indoteknik_custom/models/mrp_production.py b/indoteknik_custom/models/mrp_production.py index 7977bdf7..91da0597 100644 --- a/indoteknik_custom/models/mrp_production.py +++ b/indoteknik_custom/models/mrp_production.py @@ -156,7 +156,7 @@ class MrpProduction(models.Model): 'order_id': new_po.id }]) - new_po.button_confirm() + # new_po.button_confirm() self.is_po = True @@ -247,7 +247,7 @@ class CheckBomProduct(models.Model): @api.constrains('production_id', 'product_id') def _check_product_bom_validation(self): for record in self: - if record.production_id.sale_order.state not in ['sale', 'done']: + if record.production_id.sale_order and record.production_id.sale_order.state not in ['sale', 'done']: raise UserError(( "SO harus diconfirm terlebih dahulu." )) @@ -273,13 +273,13 @@ class CheckBomProduct(models.Model): if existing_lines: total_quantity = sum(existing_lines.mapped('quantity')) - if total_quantity < total_qty_in_moves: + if total_quantity > total_qty_in_moves: raise UserError(( "Quantity Product '%s' kurang dari quantity demand." ) % (record.product_id.display_name)) else: # Check if the quantity exceeds the allowed total - if record.quantity < total_qty_in_moves: + if record.quantity > total_qty_in_moves: raise UserError(( "Quantity Product '%s' kurang dari quantity demand." ) % (record.product_id.display_name)) |
