fix(stock): set item price reference for buying and selling price lists

This commit is contained in:
R-Jayaraman
2026-10-22 12:13:13 +05:30
committed by pandiyan
parent 55a5b9d2af
commit 91bc66ebda
@@ -144,14 +144,11 @@ class ItemPrice(Document):
)
def before_save(self):
if self.selling:
self.reference = self.customer
if self.buying:
self.reference = self.supplier
if self.selling and not self.buying:
# if only selling then remove supplier
self.supplier = None
if self.buying and not self.selling:
# if only buying then remove customer
self.customer = None
self.reference = self.customer or self.supplier