fix: pricing rule not working for production discount

This commit is contained in:
Rohit Waghchaure
2019-12-13 16:18:38 +05:30
parent a41d464198
commit 4e8e466a98
6 changed files with 76 additions and 32 deletions

View File

@@ -735,10 +735,6 @@ class BuyingController(StockController):
if not self.get("items"):
return
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
if earliest_schedule_date:
self.schedule_date = earliest_schedule_date
if self.schedule_date:
for d in self.get('items'):
if not d.schedule_date:
@@ -750,6 +746,10 @@ class BuyingController(StockController):
else:
frappe.throw(_("Please enter Reqd by Date"))
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
if earliest_schedule_date:
self.schedule_date = earliest_schedule_date
def validate_items(self):
# validate items to see if they have is_purchase_item or is_subcontracted_item enabled
if self.doctype=="Material Request": return