diff --git a/setup/lib/cli.py b/setup/lib/cli.py index 14ab3bce..5db70c41 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -85,7 +85,8 @@ def main(): 'set_default_removal_strategy', 'default_set_order_policy', 'delete_mail_server', - 'update_values', + 'update_values', + 'set_sys_params', ] if cmd == 'rollout': diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index 7dd3127e..29aa3379 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -223,4 +223,8 @@ class Config(): 'mrp.route_warehouse0_manufacture': {'name': 'Produzieren'}, 'purchase.route_warehouse0_buy': {'name': 'Einkaufen'}, 'stock.route_warehouse0_mto': {'name': 'Beschaffe von Auftrag'}, - } \ No newline at end of file + } + + self.system_parameters = { + 'ir_attachment.location': 'db', # [db] oder [file] + } \ No newline at end of file diff --git a/setup/lib/functions.py b/setup/lib/functions.py index bf689d81..0d054673 100755 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -656,4 +656,17 @@ class CamadeusFunctions(): dummy,model,res_id = self._execute('ir.model.data', 'xmlid_lookup', xml_id) self._execute(model, 'write', [res_id], vals) - return True \ No newline at end of file + return True + + def set_sys_params(self): + """Systemparameter setzen""" + + for key,value in self.config.system_parameters.items(): + param_ids = self._execute('ir.config_parameter', 'search', [('key','=',key)]) + vals = {'key': key, + 'value': value} + if param_ids: + self._execute('ir.config_parameter', 'write', param_ids, vals) + else: + self._execute('ir.config_parameter', 'create', vals) + return True \ No newline at end of file