merge
commit
07a430d160
|
|
@ -0,0 +1 @@
|
||||||
|
lang,type,name,res_id,src,value
|
||||||
|
|
|
@ -64,6 +64,8 @@ def main():
|
||||||
'setup_journals',
|
'setup_journals',
|
||||||
'set_currencies',
|
'set_currencies',
|
||||||
'set_decimal_price',
|
'set_decimal_price',
|
||||||
|
'import_users',
|
||||||
|
'set_translations',
|
||||||
]
|
]
|
||||||
|
|
||||||
if cmd == 'rollout':
|
if cmd == 'rollout':
|
||||||
|
|
|
||||||
|
|
@ -175,3 +175,9 @@ class Config():
|
||||||
#'cam_hr_overtime',
|
#'cam_hr_overtime',
|
||||||
#'cam_hr',
|
#'cam_hr',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
self.users_file = "res.users.csv"
|
||||||
|
|
||||||
|
self.translation_files = [
|
||||||
|
"ir.translation.csv"
|
||||||
|
]
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@ Port: %s
|
||||||
|
|
||||||
ENVIRONMENTS = {
|
ENVIRONMENTS = {
|
||||||
'br': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
'br': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
||||||
'sk': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
'sk': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
||||||
|
'ka': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
||||||
'test': Environment('https://INSTANCE.camadeus.at', '443', 'INSTANCE_1', 'admin', '141kcal', 'asdfasdf'),
|
'test': Environment('https://INSTANCE.camadeus.at', '443', 'INSTANCE_1', 'admin', '141kcal', 'asdfasdf'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -544,4 +544,42 @@ class CamadeusFunctions():
|
||||||
self._execute('ir.values', 'set_default', 'product.template', 'cost_method', method)
|
self._execute('ir.values', 'set_default', 'product.template', 'cost_method', method)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def import_users(self):
|
||||||
|
"""User importieren"""
|
||||||
|
|
||||||
|
if hasattr(self.config, 'users_file'):
|
||||||
|
vals = {}
|
||||||
|
vals['res_model'] = 'res.users'
|
||||||
|
vals['file'] = self._readAndReturnFile(self.config.users_file)
|
||||||
|
fields = [u'id', u'name', u'login', u'email', u'groups_id/id', False, u'tz', u'mobile', u'phone', u'function']
|
||||||
|
options = {u'headers': True, u'quoting': u'"', u'separator': u',', u'encoding': u'utf-8'}
|
||||||
|
|
||||||
|
wizard_id = self._execute('base_import.import', 'create', vals)
|
||||||
|
if wizard_id:
|
||||||
|
try:
|
||||||
|
self._execute('base_import.import', 'do',wizard_id,fields,options)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def set_translations(self):
|
||||||
|
"""Übersetzungen aktualisieren """
|
||||||
|
|
||||||
|
if hasattr(self.config, 'translation_files'):
|
||||||
|
for file in self.config.translation_files:
|
||||||
|
data = self._readAndReturnFile(file,encode='base64')
|
||||||
|
vals = {
|
||||||
|
'name': 'test',
|
||||||
|
'code': 'de_DE',
|
||||||
|
'data': data,
|
||||||
|
'overwrite': True,
|
||||||
|
}
|
||||||
|
wizard_id = self._execute('base.language.import', 'create', vals)
|
||||||
|
self._execute('base.language.import', 'import_lang', [wizard_id])
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
id,name,login,email,groups_id/id,department_ids/id,tz,mobile,phone,function
|
||||||
|
Loading…
Reference in New Issue