diff --git a/ext/custom-addons/dp_custom/data/glaser_company_data.xml b/ext/custom-addons/dp_custom/data/glaser_company_data.xml index 15222c20..d8de0f1c 100644 --- a/ext/custom-addons/dp_custom/data/glaser_company_data.xml +++ b/ext/custom-addons/dp_custom/data/glaser_company_data.xml @@ -31,7 +31,8 @@ (4,ref('sales_team.group_sale_manager')), (4,ref('stock.group_stock_manager')), (4,ref('base.group_system')), - (4,ref('base.group_partner_manager'))]"/> + (4,ref('base.group_partner_manager')), + (4,ref('account.group_account_user'))]"/> diff --git a/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml b/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml index b9d43ca2..5b8cafe9 100644 --- a/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml +++ b/ext/custom-addons/dp_custom/data/tz_austria_company_data.xml @@ -11,7 +11,8 @@ (4,ref('sales_team.group_sale_manager')), (4,ref('stock.group_stock_manager')), (4,ref('base.group_system')), - (4,ref('base.group_partner_manager'))]"/> + (4,ref('base.group_partner_manager')), + (4,ref('account.group_account_user'))]"/> diff --git a/setup/lib/cli.py b/setup/lib/cli.py index 41ea240f..e1986a2d 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -117,6 +117,8 @@ def main(): #'stock_set_cost_method', #'set_incoterms', 'set_company', + 'enable_res_config_for_company', # muss bei multicompany ausgefuehrt werden + 'set_multicompany_data', # set_multicompany_data 'set_uom', 'set_taxes', 'set_fiscal_position', diff --git a/setup/lib/config.py b/setup/lib/config.py index bc15bbbc..b63fb620 100644 --- a/setup/lib/config.py +++ b/setup/lib/config.py @@ -125,6 +125,7 @@ class Config(): 'web_environment_ribbon', 'web_no_bubble', 'report_intrastat', + 'dp_sale_hide_discount' ] diff --git a/setup/lib/config_glaser.py b/setup/lib/config_glaser.py index cd1120dd..d5e3ff7f 100644 --- a/setup/lib/config_glaser.py +++ b/setup/lib/config_glaser.py @@ -79,3 +79,7 @@ class ConfigGlaser(Config): # }, } + self.multi_company_settings = { + 'chart_template_id': ('xmlid', 'l10n_at.austria_chart_template') + } + diff --git a/setup/lib/environments.py b/setup/lib/environments.py index a6a5f420..8c641f5f 100644 --- a/setup/lib/environments.py +++ b/setup/lib/environments.py @@ -31,7 +31,8 @@ ENVIRONMENTS = { 'br': Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config=ConfigTZA()), 'br-glaser': Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config=ConfigGlaser()), - 'aa': Environment('http://localhost', '8080', 'tz-austria_1', 'admin', 'x', 'admin'), + 'aa': Environment('http://localhost', '8080', 'tz-austria_1', 'tz-admin', 'x', 'admin', config=ConfigTZA()), + 'aa-glaser': Environment('http://localhost', '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config=ConfigGlaser()), 'oa': Environment('http://localhost', '8080', 'tz-austria_1', 'admin', 'x', 'admin'), # Remote environments are always listed without passwords! diff --git a/setup/lib/functions.py b/setup/lib/functions.py index acac9212..dd680f15 100644 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -93,6 +93,30 @@ class DatenpolFunctions: vals['country_id'] = country_id return self.odoo.env.ref(self.config.company_xmlid).write(vals) + def enable_res_config_for_company(self): + """Setze beim portal_template_user die Company als zulässiges Unternehmen""" + portal_template_user = self.odoo.env.ref('auth_signup.default_template_user') + vals = {} + if self.odoo.env.ref(self.config.company_xmlid) not in portal_template_user.company_ids: + vals = {'company_ids': [(4, self.odoo.env.ref(self.config.company_xmlid).id)]} + + return portal_template_user.write(vals) + + def set_multicompany_data(self): + """Multicompany Systemeinstellungen konfigurieren""" + res_settings = self.odoo.env['res.config.settings'] + vals = res_settings.default_get([]) + newvals = {} + for key, value in self.config.multi_company_settings.items(): + if isinstance(value, tuple): + if value[0] == 'xmlid': + newvals.update({key: self.odoo.env.ref(value[1]).id}) + else: + newvals.update({key: value}) + vals.update(newvals) + wizard_id = res_settings.create(vals) + return res_settings.browse(wizard_id).execute() + def load_languages(self): """Lade zusätzliche Sprachen"""