summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-12-17 10:13:13 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-12-17 10:13:13 +0700
commit97d9a59c82be9052815be6039327148f07d98514 (patch)
tree447823de690c54e623e193bde82eef2b4d505f07 /indoteknik_custom/models
parent7adf192606f72f1efe2ad517df8b919902bf12a5 (diff)
add new condition on po
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 9388ae4c..0e39d12a 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -74,6 +74,7 @@ class PurchaseOrder(models.Model):
approve_by = fields.Many2one('res.users', string='Approve By')
exclude_incoming = fields.Boolean(string='Exclude Incoming', default=False,
help='Centang jika tidak mau masuk perhitungan Incoming Qty')
+ not_update_purchasepricelist = fields.Boolean(string='Not Update Purchase Pricelist?')
def _compute_total_margin_match(self):
for purchase in self:
@@ -620,7 +621,8 @@ class PurchaseOrder(models.Model):
raise UserError("Tidak ada link dengan SO, harus approval Merchandise")
send_email = False
- self.add_product_to_pricelist()
+ if not self.not_update_purchasepricelist:
+ self.add_product_to_pricelist()
for line in self.order_line:
if not line.product_id.purchase_ok:
raise UserError("Terdapat barang yang tidak bisa diproses")