def on_update(self): NestedSet.on_update(self) if not frappe.db.sql("""select name from tabAccount where company=%s and docstatus<2 limit 1""", self.name): if not frappe.local.flags.ignore_chart_of_accounts: frappe.flags.country_change = True self.create_default_accounts() self.create_default_warehouses() if frappe.flags.country_change: install_country_fixtures(self.name) self.create_default_tax_template() if not frappe.db.get_value("Department", {"company": self.name}): from erpnext.setup.setup_wizard.operations.install_fixtures import install_post_company_fixtures install_post_company_fixtures(frappe._dict({'company_name': self.name})) if not frappe.db.get_value("Cost Center", {"is_group": 0, "company": self.name}): self.create_default_cost_center() if not frappe.local.flags.ignore_chart_of_accounts: self.set_default_accounts() if self.default_cash_account: self.set_mode_of_payment_account() if self.default_currency: frappe.db.set_value("Currency", self.default_currency, "enabled", 1) if hasattr(frappe.local, 'enable_perpetual_inventory') and \ self.name in frappe.local.enable_perpetual_inventory: frappe.local.enable_perpetual_inventory[self.name] = self.enable_perpetual_inventory frappe.clear_cache()
def on_update(self): NestedSet.on_update(self) if not frappe.db.sql( """SELECT name FROM tabAccount WHERE company=%s and docstatus<2 limit 1""", self.name): self.create_accounts() self.set_default_accounts()
def on_update(self): NestedSet.on_update(self) invalidate_cache_for(self) self.validate_name_with_item() self.validate_one_root() self.delete_child_item_groups_key()
def on_update(self): NestedSet.on_update(self) WebsiteGenerator.on_update(self) invalidate_cache_for(self) self.validate_name_with_item() self.validate_one_root()
def on_update(self): NestedSet.on_update(self)
def on_update(self): NestedSet.on_update(self) self.create_accounts()
def on_update(self): NestedSet.on_update(self) self.validate_one_root()
def on_update(self): if self.get_url() != self.name: self.rename() if not frappe.flags.in_sync_website: NestedSet.on_update(self) self.clear_cache()
def on_update(self): # super(Location, self).on_update() NestedSet.on_update(self)
def on_update(self): if not frappe.flags.in_rebuild_config: NestedSet.on_update(self) self.clear_cache()
def on_update(self): NestedSet.on_update(self) self.set_parent()
def on_update(self): WebsiteGenerator.on_update(self) NestedSet.on_update(self) clear_cache(website_group=self.name)
def on_update(self): NestedSet.on_update(self) invalidate_cache_for(self) self.validate_name_with_item() self.validate_one_root()