Merge pull request #14166 from rohitwaghchaure/version_11_patch_budget
[Fix] Patch, default cost center, expense account for the item
This commit is contained in:
commit
734b874f3e
@ -264,9 +264,12 @@ def get_accumulated_monthly_budget(monthly_distribution, posting_date, fiscal_ye
|
|||||||
def get_item_details(args):
|
def get_item_details(args):
|
||||||
cost_center, expense_account = None, None
|
cost_center, expense_account = None, None
|
||||||
|
|
||||||
|
if not args.get('company'):
|
||||||
|
return cost_center, expense_account
|
||||||
|
|
||||||
if args.item_code:
|
if args.item_code:
|
||||||
cost_center, expense_account = frappe.db.get_value('Item',
|
cost_center, expense_account = frappe.db.get_value('Item Default',
|
||||||
args.item_code, ['buying_cost_center', 'expense_account'])
|
{'parent': args.item_code, 'company': args.get('company')}, ['buying_cost_center', 'expense_account'])
|
||||||
|
|
||||||
if not (cost_center and expense_account):
|
if not (cost_center and expense_account):
|
||||||
for doctype in ['Item Group', 'Company']:
|
for doctype in ['Item Group', 'Company']:
|
||||||
|
@ -10,7 +10,7 @@ def execute():
|
|||||||
frappe.reload_doc('stock', 'doctype', 'warehouse')
|
frappe.reload_doc('stock', 'doctype', 'warehouse')
|
||||||
|
|
||||||
for d in frappe.get_all('Warehouse',
|
for d in frappe.get_all('Warehouse',
|
||||||
fields = ['warehouse_name', 'is_group', 'parent_warehouse'], order_by="is_group desc"):
|
fields = ['warehouse_name', 'is_group', 'parent_warehouse'], order_by="lft asc"):
|
||||||
try:
|
try:
|
||||||
loc = frappe.new_doc('Location')
|
loc = frappe.new_doc('Location')
|
||||||
loc.location_name = d.warehouse_name
|
loc.location_name = d.warehouse_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user