summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorHafidBuroiroh <hafidburoiroh09@gmail.com>2026-03-14 10:28:02 +0700
committerHafidBuroiroh <hafidburoiroh09@gmail.com>2026-03-14 10:28:02 +0700
commitb25df7e1279192ffff31b933dcb3c219b05d7f85 (patch)
treeeb67f45f9689d49506670f20df15def80b7e2193 /indoteknik_custom/models
parentd9e637e5b3b398a0e0d6cae6631bb65358b8feef (diff)
<hafid> fix error purchase price
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_pricelist.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py
index 83e06f55..1caa6dc2 100755
--- a/indoteknik_custom/models/purchase_pricelist.py
+++ b/indoteknik_custom/models/purchase_pricelist.py
@@ -74,6 +74,9 @@ class PurchasePricelist(models.Model):
@api.constrains('vendor_id', 'product_id')
def _check_duplicate_purchase_pricelist(self):
for price in self:
+ if not price.product_id or not price.vendor_id:
+ continue
+
domain = [
('product_id', '=', price.product_id.id),
('vendor_id', '=', price.vendor_id.id)