fix(setup): Create regional taxes on creation on company

This commit is contained in:
Nabin Hait 2019-01-24 17:56:19 +05:30
parent 49b41e49ae
commit 2a1aedfff1
2 changed files with 5 additions and 11 deletions

View File

@ -94,6 +94,9 @@ class Company(NestedSet):
if frappe.flags.country_change: if frappe.flags.country_change:
install_country_fixtures(self.name) install_country_fixtures(self.name)
self.create_default_tax_template()
if not frappe.db.get_value("Department", {"company": self.name}): if not frappe.db.get_value("Department", {"company": self.name}):
from erpnext.setup.setup_wizard.operations.install_fixtures import install_post_company_fixtures from erpnext.setup.setup_wizard.operations.install_fixtures import install_post_company_fixtures

View File

@ -6,7 +6,7 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from .operations import install_fixtures as fixtures, company_setup, taxes_setup, sample_data from .operations import install_fixtures as fixtures, company_setup, sample_data
def get_setup_stages(args=None): def get_setup_stages(args=None):
if frappe.db.sql("select name from tabCompany"): if frappe.db.sql("select name from tabCompany"):
@ -37,18 +37,13 @@ def get_setup_stages(args=None):
] ]
}, },
{ {
'status': _('Setting up company and taxes'), 'status': _('Setting up company'),
'fail_msg': _('Failed to setup company'), 'fail_msg': _('Failed to setup company'),
'tasks': [ 'tasks': [
{ {
'fn': setup_company, 'fn': setup_company,
'args': args, 'args': args,
'fail_msg': _("Failed to setup company") 'fail_msg': _("Failed to setup company")
},
{
'fn': setup_taxes,
'args': args,
'fail_msg': _("Failed to setup taxes")
} }
] ]
}, },
@ -94,9 +89,6 @@ def stage_fixtures(args):
def setup_company(args): def setup_company(args):
fixtures.install_company(args) fixtures.install_company(args)
def setup_taxes(args):
taxes_setup.create_sales_tax(args)
def setup_post_company_fixtures(args): def setup_post_company_fixtures(args):
fixtures.install_post_company_fixtures(args) fixtures.install_post_company_fixtures(args)
@ -132,7 +124,6 @@ def login_as_first_user(args):
def setup_complete(args=None): def setup_complete(args=None):
stage_fixtures(args) stage_fixtures(args)
setup_company(args) setup_company(args)
setup_taxes(args)
setup_post_company_fixtures(args) setup_post_company_fixtures(args)
setup_defaults(args) setup_defaults(args)
stage_four(args) stage_four(args)