Get context from default config to get chart ID to create
49ca1e40161c replace the .find call by get_id which requires a context.
This commit is contained in:
@@ -5,6 +5,7 @@ import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
from proteus import Model, Wizard
|
||||
from proteus.config import get_config
|
||||
from trytond.modules.company.tests.tools import get_company
|
||||
|
||||
__all__ = ['create_fiscalyear', 'create_chart', 'get_accounts',
|
||||
@@ -50,6 +51,8 @@ def create_fiscalyear(company=None, today=None, config=None):
|
||||
def create_chart(
|
||||
company=None, chart='account.account_template_root_en', config=None):
|
||||
"Create chart of accounts"
|
||||
if config is None:
|
||||
config = get_config()
|
||||
AccountTemplate = Model.get('account.account.template', config=config)
|
||||
ModelData = Model.get('ir.model.data', config=config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user