mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-31 23:07:51 +00:00
fix(stock): set item price reference for buying and selling price lists
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user