summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/mrp_production.py
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-08-09 14:45:48 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-08-09 14:45:48 +0700
commit979ffc90fffe2f09788016376d71a940a28f8fed (patch)
treea5408296eb204a0a5066578664ed0acb13174f27 /indoteknik_custom/models/mrp_production.py
parent33621956bdb9d807b480eda44ce7f2152f508695 (diff)
parentdf5ff0fc9bcd45c19b74288d8e5cfee018ba5bdd (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into pum-v2
Diffstat (limited to 'indoteknik_custom/models/mrp_production.py')
-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))