summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/mrp_production.py
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-05-26 11:25:15 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-05-26 11:25:15 +0700
commit7d7a6d4421a664e2ddd9308b15ea9f9e5e54c4a9 (patch)
treefd8b1877af11acdbbb627f03ea5b7189281a009b /indoteknik_custom/models/mrp_production.py
parentbab061bc003f132e738d7ad2f9d99df903392d1a (diff)
parentc1aefea6e72798848d090abb32bb753c550ce76b (diff)
(andri) resolved conflict
Diffstat (limited to 'indoteknik_custom/models/mrp_production.py')
-rw-r--r--indoteknik_custom/models/mrp_production.py36
1 files changed, 20 insertions, 16 deletions
diff --git a/indoteknik_custom/models/mrp_production.py b/indoteknik_custom/models/mrp_production.py
index 8179fe56..14821f27 100644
--- a/indoteknik_custom/models/mrp_production.py
+++ b/indoteknik_custom/models/mrp_production.py
@@ -180,29 +180,29 @@ class MrpProduction(models.Model):
# delta_time = delta_time.strftime('%Y-%m-%d %H:%M:%S')
price = 0
- taxes = ''
+ taxes = 24
vendor_id = ''
human_last_update = purchase_price.human_last_update or datetime.min
system_last_update = purchase_price.system_last_update or datetime.min
- if purchase_price.taxes_product_id.type_tax_use == 'purchase':
- price = purchase_price.product_price
- taxes = purchase_price.taxes_product_id.id
+ #if purchase_price.taxes_product_id.type_tax_use == 'purchase':
+ price = purchase_price.product_price
+ taxes = purchase_price.taxes_product_id.id or 24
+ vendor_id = purchase_price.vendor_id.id
+ if delta_time > human_last_update:
+ price = 0
+ taxes = ''
+ vendor_id = ''
+
+ if system_last_update > human_last_update:
+ #if purchase_price.taxes_system_id.type_tax_use == 'purchase':
+ price = purchase_price.system_price
+ taxes = purchase_price.taxes_system_id.id or 24
vendor_id = purchase_price.vendor_id.id
- if delta_time > human_last_update:
+ if delta_time > system_last_update:
price = 0
- taxes = ''
+ taxes = 24
vendor_id = ''
-
- if system_last_update > human_last_update:
- if purchase_price.taxes_system_id.type_tax_use == 'purchase':
- price = purchase_price.system_price
- taxes = purchase_price.taxes_system_id.id
- vendor_id = purchase_price.vendor_id.id
- if delta_time > system_last_update:
- price = 0
- taxes = ''
- vendor_id = ''
return price, taxes, vendor_id
@@ -244,6 +244,10 @@ 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']:
+ raise UserError((
+ "SO harus diconfirm terlebih dahulu."
+ ))
if not record.production_id or not record.product_id:
continue