fix: Test Cases

This commit is contained in:
Deepesh Garg
2020-06-22 09:40:15 +05:30
parent c70eb30e7e
commit ded3ab1cd7
3 changed files with 18 additions and 9 deletions

View File

@@ -46,6 +46,7 @@ class Company(NestedSet):
self.validate_currency()
self.validate_coa_input()
self.validate_perpetual_inventory()
self.validate_perpetual_inventory_for_non_stock_items()
self.check_country_change()
self.set_chart_of_accounts()
self.validate_parent_company()
@@ -182,6 +183,12 @@ class Company(NestedSet):
frappe.msgprint(_("Set default inventory account for perpetual inventory"),
alert=True, indicator='orange')
def validate_perpetual_inventory_for_non_stock_items(self):
if not self.get("__islocal"):
if cint(self.enable_perpetual_inventory_for_non_stock_items) == 1 and not self.service_received_but_not_billed:
frappe.throw(_("Set default {0} account for perpetual inventory for non stock items").format(
frappe.bold('Service Received But Not Billed')))
def check_country_change(self):
frappe.flags.country_change = False