summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-07-28 14:58:11 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-07-28 14:58:11 +0700
commit3df417568e6efe97b9c8e3d2752e13f584802d71 (patch)
treef81e7bfc21bb83d4feda2cc1dbc9ae1c09d6c06d
parent7a356e16bf338a5dce36d95abe74ed740562e30f (diff)
fix bug manufacturing
-rw-r--r--indoteknik_custom/models/mrp_production.py8
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))