[Enhance] Companywise perpetual inventory setting

This commit is contained in:
Rohit Waghchaure
2017-06-16 15:21:36 +05:30
parent 80ef298519
commit a5f40941ae
32 changed files with 2160 additions and 1980 deletions

View File

@@ -36,12 +36,13 @@ def get_company_currency(company):
frappe.flags.company_currency[company] = frappe.db.get_value('Company', company, 'default_currency')
return frappe.flags.company_currency[company]
def set_perpetual_inventory(enable=1, company=None):
if not company:
company = get_default_company()
def set_perpetual_inventory(enable=1):
accounts_settings = frappe.get_doc("Accounts Settings")
accounts_settings.auto_accounting_for_stock = enable
accounts_settings.save()
company = frappe.get_doc("Company", company)
company.enable_perpetual_inventory = enable
company.save()
def encode_company_abbr(name, company):
'''Returns name encoded with company abbreviation'''