Defaults in Item Group (#14874)

* Add Defaults table in Item Group

* Fetch defaults from Item group if not found in Item

* Add patch

* Remove default fields from Item Group

* Set query for defaults

* Fix Codacy

* Modify test records

* Modify budget.py and sales_order.py

* Remove join from query

* Else condition to avoid error if no defaults found

* refrain from making item test records before item_group

* default cost center fetch correction

* Remove tab item group from query
This commit is contained in:
Shreya Shah
2018-07-17 18:01:44 +05:30
committed by Nabin Hait
parent af479c8192
commit 3c9839f832
17 changed files with 275 additions and 80 deletions

View File

@@ -79,6 +79,12 @@ class BuyingController(StockController):
{"parent": d.item_code, "company": self.company}, "default_supplier")
if supplier:
self.supplier = supplier
else:
item_group = frappe.db.get_value("Item", d.item_code, "item_group")
supplier = frappe.db.get_value("Item Default",
{"parent": item_group, "company": self.company}, "default_supplier")
if supplier:
self.supplier = supplier
break
def validate_stock_or_nonstock_items(self):