Exemple #1
0
	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()
Exemple #2
0
	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()
Exemple #3
0
    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()
Exemple #4
0
	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()
Exemple #5
0
	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()
Exemple #6
0
 def on_update(self):
     NestedSet.on_update(self)
Exemple #7
0
 def on_update(self):
     NestedSet.on_update(self)
     self.create_accounts()
Exemple #8
0
	def on_update(self):
		NestedSet.on_update(self)
		self.validate_one_root()
Exemple #9
0
 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()
Exemple #10
0
 def on_update(self):
     # super(Location, self).on_update()
     NestedSet.on_update(self)
Exemple #11
0
 def on_update(self):
     NestedSet.on_update(self)
     self.validate_one_root()
Exemple #12
0
 def on_update(self):
     if not frappe.flags.in_rebuild_config:
         NestedSet.on_update(self)
     self.clear_cache()
Exemple #13
0
	def on_update(self):
		NestedSet.on_update(self)
Exemple #14
0
	def on_update(self):
		# super(Location, self).on_update()
		NestedSet.on_update(self)
Exemple #15
0
 def on_update(self):
     if not frappe.flags.in_rebuild_config:
         NestedSet.on_update(self)
     self.clear_cache()
Exemple #16
0
 def on_update(self):
     NestedSet.on_update(self)
     self.set_parent()
Exemple #17
0
 def on_update(self):
     WebsiteGenerator.on_update(self)
     NestedSet.on_update(self)
     clear_cache(website_group=self.name)
Exemple #18
0
 def on_update(self):
     NestedSet.on_update(self)
     invalidate_cache_for(self)
     self.validate_name_with_item()
     self.validate_one_root()
Exemple #19
0
	def on_update(self):
		WebsiteGenerator.on_update(self)
		NestedSet.on_update(self)
		clear_cache(website_group=self.name)