update Repo für 10.0
parent
5db603678a
commit
ea7df087a0
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<launchConfiguration type="org.python.pydev.debug.regularLaunchConfigurationType">
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
|
||||||
<listEntry value="/INSTANCE/setup/lib/cli.py"/>
|
|
||||||
</listAttribute>
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
|
||||||
<listEntry value="1"/>
|
|
||||||
</listAttribute>
|
|
||||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:INSTANCE/setup/lib/cli.py}"/>
|
|
||||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_OTHER_WORKING_DIRECTORY" value=""/>
|
|
||||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${env_var:CAM_USER} update cam_custom"/>
|
|
||||||
<stringAttribute key="org.python.pydev.debug.ATTR_INTERPRETER" value="__default"/>
|
|
||||||
<stringAttribute key="org.python.pydev.debug.ATTR_PROJECT" value="INSTANCE"/>
|
|
||||||
<stringAttribute key="process_factory_id" value="org.python.pydev.debug.processfactory.PyProcessFactory"/>
|
|
||||||
</launchConfiguration>
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<launchConfiguration type="org.python.pydev.debug.regularLaunchConfigurationType">
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
|
||||||
<listEntry value="/INSTANCE/ext/odoo/odoo-dev.py"/>
|
|
||||||
</listAttribute>
|
|
||||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
|
||||||
<listEntry value="1"/>
|
|
||||||
</listAttribute>
|
|
||||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:INSTANCE/ext/odoo/odoo-dev.py}"/>
|
|
||||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_OTHER_WORKING_DIRECTORY" value=""/>
|
|
||||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-c dev/odoo-server-dev-${env_var:CAM_USER}.conf --db-filter="^INSTANCE.*""/>
|
|
||||||
<stringAttribute key="org.python.pydev.debug.ATTR_INTERPRETER" value="__default"/>
|
|
||||||
<stringAttribute key="org.python.pydev.debug.ATTR_PROJECT" value="INSTANCE"/>
|
|
||||||
<stringAttribute key="process_factory_id" value="org.python.pydev.debug.processfactory.PyProcessFactory"/>
|
|
||||||
</launchConfiguration>
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[options]
|
|
||||||
|
|
||||||
xmlrpc_port = 8080
|
|
||||||
; This is the password that allows database operations:
|
|
||||||
; admin_passwd = admin
|
|
||||||
db_host = False
|
|
||||||
db_port = 5432
|
|
||||||
db_user = False
|
|
||||||
db_password = False
|
|
||||||
|
|
||||||
addons_path = ext/odoo/addons,ext/custom-addons,dmi/run1
|
|
||||||
timezone = Europe/Brussels
|
|
||||||
|
|
||||||
#dbfilter_test = ['.*',]
|
|
||||||
show_debug = 1
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
[options]
|
|
||||||
|
|
||||||
xmlrpc_port = 8080
|
|
||||||
; This is the password that allows database operations:
|
|
||||||
; admin_passwd = admin
|
|
||||||
db_host = False
|
|
||||||
db_port = 5432
|
|
||||||
db_user = False
|
|
||||||
db_password = False
|
|
||||||
|
|
||||||
addons_path = ext/odoo/addons,ext/custom-addons,dmi/run1
|
|
||||||
timezone = Europe/Brussels
|
|
||||||
|
|
||||||
#dbfilter_test = ['.*',]
|
|
||||||
show_debug = 1
|
|
||||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
|
@ -1,13 +0,0 @@
|
||||||
--- ext/odoo/odoo-dev.py 2015-04-08 10:11:02.000000000 +0200
|
|
||||||
+++ ext/odoo/odoo-dev.py 2015-04-08 10:11:02.000000000 +0200
|
|
||||||
@@ -0,0 +1,10 @@
|
|
||||||
+#!/usr/bin/env python
|
|
||||||
+import sys
|
|
||||||
+if sys.modules.get("gevent") is not None:
|
|
||||||
+ del sys.modules['gevent']
|
|
||||||
+import openerp
|
|
||||||
+
|
|
||||||
+if __name__ == "__main__":
|
|
||||||
+ openerp.cli.main()
|
|
||||||
+
|
|
||||||
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
--- ext/odoo/openerp/report/report_sxw.py 2015-04-15 12:18:30.132784074 +0200
|
|
||||||
+++ ext/odoo/openerp/report/report_sxw.py 2015-04-15 11:48:21.743518606 +0200
|
|
||||||
@@ -476,6 +476,8 @@
|
|
||||||
processed_rml = etree.XML(rml)
|
|
||||||
if report_xml.use_global_header:
|
|
||||||
rml_parser._add_header(processed_rml, self.header)
|
|
||||||
+ else:
|
|
||||||
+ rml_parser._add_header(processed_rml, 'internal')
|
|
||||||
processed_rml = self.preprocess_rml(processed_rml,report_xml.report_type)
|
|
||||||
if rml_parser.logo:
|
|
||||||
logo = base64.decodestring(rml_parser.logo)
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
--- ext/odoo/openerp/report/render/rml2pdf/trml2pdf.py 2014-01-14 14:18:12.302306370 +0100
|
|
||||||
+++ ext/odoo/openerp/report/render/rml2pdf/trml2pdf.py 2014-01-14 14:18:16.770419846 +0100
|
|
||||||
@@ -740,7 +740,7 @@
|
|
||||||
rowheights = [utils.unit_get(f.strip()) for f in node.get('rowHeights').split(',')]
|
|
||||||
if len(rowheights) == 1:
|
|
||||||
rowheights = rowheights[0]
|
|
||||||
- table = platypus.LongTable(data = data, colWidths=colwidths, rowHeights=rowheights, **(utils.attr_get(node, ['splitByRow'] ,{'repeatRows':'int','repeatCols':'int'})))
|
|
||||||
+ table = platypus.LongTable(data = data, colWidths=colwidths, rowHeights=rowheights, **(utils.attr_get(node, ['splitByRow'] ,{'repeatRows':'int','repeatCols':'int', 'hAlign':'str'})))
|
|
||||||
if node.get('style'):
|
|
||||||
table.setStyle(self.styles.table_styles[node.get('style')])
|
|
||||||
for s in styles:
|
|
||||||
|
|
@ -5,18 +5,18 @@ import urlparse
|
||||||
|
|
||||||
from config_at import Config
|
from config_at import Config
|
||||||
from environments import ENVIRONMENTS, Environment
|
from environments import ENVIRONMENTS, Environment
|
||||||
from functions import CamadeusFunctions
|
from functions import DatenpolFunctions
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
def _usage():
|
def _usage():
|
||||||
print '\nVerwendung: cam.py <environment> <command> [<module_name>/<setup_function>]\n'
|
print '\nVerwendung: dp.py <environment> <command> [<module_name>/<setup_function>]\n'
|
||||||
print 'Commands:\n'
|
print 'Commands:\n'
|
||||||
print ' create Neue Datenbank erstellen'
|
print ' create Neue Datenbank erstellen'
|
||||||
print ' create_from_dump Neue Datenbank von Dump erstellen'
|
print ' create_from_dump Neue Datenbank von Dump erstellen'
|
||||||
print ' setup Modulinstallation, Konfigurationen'
|
print ' setup Modulinstallation, Konfigurationen'
|
||||||
print ' setup_part setup_function Aufruf eines einzelnen Setup-Schrittes'
|
print ' setup_part setup_function Aufruf eines einzelnen Setup-Schrittes'
|
||||||
print ' "setup_part info" listet die verfügbaren Setup-Schritte auf'
|
print ' "setup_part info" listet die verfügbaren Setup-Schritte auf'
|
||||||
print ' rollout Setzt Dokumentnummern, importiert Benutzer, setzt cam_dmi auf noupdate, ...'
|
print ' rollout Setzt Dokumentnummern, importiert Benutzer, setzt dp_dmi auf noupdate, ...'
|
||||||
print ' update module_name Modul updaten'
|
print ' update module_name Modul updaten'
|
||||||
print ' install module_name Modul installieren'
|
print ' install module_name Modul installieren'
|
||||||
print ' uninstall module_name Modul deinstallieren'
|
print ' uninstall module_name Modul deinstallieren'
|
||||||
|
|
@ -35,7 +35,7 @@ def main():
|
||||||
_usage()
|
_usage()
|
||||||
|
|
||||||
# RUNBOT
|
# RUNBOT
|
||||||
# ./cam runbot create [db] [port] [working-dir]
|
# ./dp runbot create [db] [port] [working-dir]
|
||||||
|
|
||||||
if argv[0] == 'runbot':
|
if argv[0] == 'runbot':
|
||||||
import os
|
import os
|
||||||
|
|
@ -67,7 +67,7 @@ def main():
|
||||||
print 'Unbekannte Umgebung'
|
print 'Unbekannte Umgebung'
|
||||||
_usage()
|
_usage()
|
||||||
|
|
||||||
instance = CamadeusFunctions(env, config)
|
instance = DatenpolFunctions(env, config)
|
||||||
|
|
||||||
methods = None
|
methods = None
|
||||||
|
|
||||||
|
|
@ -81,8 +81,8 @@ def main():
|
||||||
'create_db',
|
'create_db',
|
||||||
'login',
|
'login',
|
||||||
'install_module_sale',
|
'install_module_sale',
|
||||||
'setup_accounting',
|
#'setup_accounting',
|
||||||
'setup_accounting2',
|
#'setup_accounting2',
|
||||||
'set_admin_rights',
|
'set_admin_rights',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -101,32 +101,32 @@ def main():
|
||||||
'uninstall_chat',
|
'uninstall_chat',
|
||||||
'install_modules',
|
'install_modules',
|
||||||
'set_warehouse',
|
'set_warehouse',
|
||||||
'base_config',
|
#'base_config',
|
||||||
'sale_config',
|
#'sale_config',
|
||||||
#'finance_config',
|
#'finance_config',
|
||||||
'hr_config',
|
#'hr_config',
|
||||||
'stock_config',
|
#'stock_config',
|
||||||
'mrp_config',
|
#'mrp_config',
|
||||||
'stock_set_cost_method',
|
#'stock_set_cost_method',
|
||||||
'set_incoterms',
|
#'set_incoterms',
|
||||||
'purchase_config',
|
#'purchase_config',
|
||||||
'set_date_format',
|
'set_date_format',
|
||||||
'set_company',
|
'set_company',
|
||||||
'set_taxes',
|
'set_taxes',
|
||||||
'set_uom',
|
'set_uom',
|
||||||
'set_steuerzuordnung',
|
'set_steuerzuordnung',
|
||||||
'setup_journals',
|
#'setup_journals',
|
||||||
'set_currencies',
|
'set_currencies',
|
||||||
'set_decimal_price',
|
'set_decimal_price',
|
||||||
'set_default_values',
|
#'set_default_values',
|
||||||
'set_translations',
|
#'set_translations',
|
||||||
'set_default_removal_strategy',
|
#'set_default_removal_strategy',
|
||||||
'default_set_order_policy',
|
#'default_set_order_policy',
|
||||||
'delete_mail_server',
|
#'delete_mail_server',
|
||||||
'update_values',
|
#'update_values',
|
||||||
'update_special_values',
|
#'update_special_values',
|
||||||
'set_sys_params',
|
'set_sys_params',
|
||||||
'setup_reports',
|
#'setup_reports',
|
||||||
]
|
]
|
||||||
|
|
||||||
if cmd == 'setup':
|
if cmd == 'setup':
|
||||||
|
|
@ -135,10 +135,10 @@ def main():
|
||||||
if cmd == 'rollout':
|
if cmd == 'rollout':
|
||||||
methods = [
|
methods = [
|
||||||
'login',
|
'login',
|
||||||
'set_dokumentennummern',
|
#'set_dokumentennummern',
|
||||||
'set_dmi_noupdate',
|
#'set_dmi_noupdate',
|
||||||
'dmi_confirm_inventory',
|
#'dmi_confirm_inventory',
|
||||||
'import_users',
|
#'import_users',
|
||||||
]
|
]
|
||||||
|
|
||||||
if cmd == 'update':
|
if cmd == 'update':
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Config():
|
class Config():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.dump_file = 'upgraded_file_name.dump'
|
self.dump_file = 'odoo_backup.dump'
|
||||||
|
|
||||||
self.module_name = None
|
self.module_name = None
|
||||||
self.lang = 'de_DE' # de_DE, en_US
|
self.lang = 'de_DE' # de_DE, en_US
|
||||||
|
|
@ -14,23 +14,23 @@ class Config():
|
||||||
self.uom_decimals = 3 # Nachkommastellen Mengeneinheiten
|
self.uom_decimals = 3 # Nachkommastellen Mengeneinheiten
|
||||||
|
|
||||||
self.company_data = {
|
self.company_data = {
|
||||||
'name': 'Camadeus GmbH',
|
'name': 'datenpol gmbh',
|
||||||
'street': 'Wiedner Hauptstraße 135/B3',
|
'street': 'Lederergasse 32',
|
||||||
'street2': False,
|
'street2': False,
|
||||||
'city': 'Wien',
|
'city': 'Linz',
|
||||||
'zip': '1050',
|
'zip': '4020',
|
||||||
'phone': '+43 1 78910 96 70',
|
'phone': '+43 732 997 035-0',
|
||||||
'fax': False,
|
'fax': False,
|
||||||
'email': 'office@camadeus.at',
|
'email': 'office@datenpol.at',
|
||||||
'website': 'http://www.camadeus.at/',
|
'website': 'http://www.datenpol.at/',
|
||||||
'company_registry': '280076b',
|
'company_registry': '359270p',
|
||||||
'country_id': 'at', # 'de' für Deutschland
|
'country_id': 'at', # 'de' für Deutschland
|
||||||
'logo': False,
|
'logo': False,
|
||||||
'vat': 'ATU 62991855',
|
'vat': 'ATU 66309611',
|
||||||
'rml_header1': False,
|
'rml_header1': False,
|
||||||
'vat_check_vies': True,
|
'vat_check_vies': True,
|
||||||
'tax_calculation_rounding_method': 'round_globally',
|
'tax_calculation_rounding_method': 'round_globally',
|
||||||
'logo': '../ext/custom-addons/cam_custom/static/src/img/logo.png',
|
'logo': '../ext/custom-addons/dp_custom/static/src/img/logo.png',
|
||||||
}
|
}
|
||||||
|
|
||||||
self.mail_server = {
|
self.mail_server = {
|
||||||
|
|
@ -241,8 +241,8 @@ class Config():
|
||||||
]
|
]
|
||||||
|
|
||||||
self.default_values = [ # ir.values
|
self.default_values = [ # ir.values
|
||||||
#('product.template', 'type', 'service'),
|
('product.template', 'type', 'service'),
|
||||||
#('product.template', 'type', 'XML:xmlid'), #mit prefix "XML:" kann eine XML ID übergeben werden
|
('product.template', 'type', 'XML:xmlid'), #mit prefix "XML:" kann eine XML ID übergeben werden
|
||||||
]
|
]
|
||||||
|
|
||||||
self.data_updates = {
|
self.data_updates = {
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,8 @@ Port: %s
|
||||||
ENVIRONMENTS = {
|
ENVIRONMENTS = {
|
||||||
# Local environments are listed with passwords
|
# Local environments are listed with passwords
|
||||||
'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'),
|
|
||||||
'ha': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
|
||||||
'jb': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
|
||||||
'uk': Environment('http://localhost', '8080', 'INSTANCE_1', 'admin', 'x', 'admin'),
|
|
||||||
# Remote environments are always listed without passwords!
|
# Remote environments are always listed without passwords!
|
||||||
# Do not store them here, you have to type them anyway!
|
# Do not store them here, you have to type them anyway!
|
||||||
'test': Environment('https://INSTANCE.camadeus.at', '443', 'INSTANCE_1', 'admin'),
|
'test': Environment('https://INSTANCE.datenpol.at', '443', 'INSTANCE_1', 'admin'),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import xmlrpclib
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
class CamadeusFunctions():
|
|
||||||
|
class DatenpolFunctions():
|
||||||
def __init__(self, environment, config):
|
def __init__(self, environment, config):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
@ -16,23 +17,22 @@ class CamadeusFunctions():
|
||||||
def create_db(self):
|
def create_db(self):
|
||||||
"""Neue Datenbank erstellen"""
|
"""Neue Datenbank erstellen"""
|
||||||
|
|
||||||
payload = {'fields': [ {'name': 'super_admin_pwd', 'value': self.env.super_admin_pw},
|
params = {
|
||||||
{'name': 'db_name', 'value': self.env.dbname},
|
'master_pwd': self.env.super_admin_pw,
|
||||||
{'name': 'demo_data', 'value': False},
|
'name': self.env.dbname,
|
||||||
{'name': 'db_lang', 'value': self.config.lang},
|
'login': self.env.username,
|
||||||
{'name': 'create_admin_pwd', 'value': self.env.pwd},
|
'password': self.env.pwd,
|
||||||
]
|
'lang': self.config.lang,
|
||||||
|
'country_code': self.config.company_data.get('country_id', 'at'),
|
||||||
}
|
}
|
||||||
payload = {'params': payload}
|
if self.env.demo:
|
||||||
json_data = json.dumps(payload)
|
params.update(demo=1)
|
||||||
headers = {'content-type': 'application/json'}
|
|
||||||
r = requests.post('%s:%s/web/database/create' % (self.env.host, self.env.port), data=json_data, headers=headers, auth=self.env.basic_auth, verify=False)
|
base_url = '%s:%s/web/database/create' % (self.env.host, self.env.port)
|
||||||
if r and r.json().get('result', False):
|
res = requests.post(base_url, params=params, verify=False, stream=True)
|
||||||
return True
|
if not res.ok:
|
||||||
else:
|
|
||||||
msg = pprint.pformat(r.json().get('error', '????'))
|
|
||||||
print 'Error occured: %s' % msg
|
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def create_dump(self):
|
def create_dump(self):
|
||||||
""" Erstelle Odoo-Dump"""
|
""" Erstelle Odoo-Dump"""
|
||||||
|
|
@ -69,7 +69,6 @@ class CamadeusFunctions():
|
||||||
print "\nACHTUNG: Nicht vergessen './cam [env] anonym' auszuführen, sodass es zu keiner Kommunikation mit dem Produktivsystem kommt"
|
print "\nACHTUNG: Nicht vergessen './cam [env] anonym' auszuführen, sodass es zu keiner Kommunikation mit dem Produktivsystem kommt"
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def login(self):
|
def login(self):
|
||||||
"""Login"""
|
"""Login"""
|
||||||
|
|
||||||
|
|
@ -196,7 +195,8 @@ class CamadeusFunctions():
|
||||||
terms = self.config.incoterms
|
terms = self.config.incoterms
|
||||||
|
|
||||||
for name, code in terms:
|
for name, code in terms:
|
||||||
existing_ids = self._execute('stock.incoterms', 'search', ['|', ('active', '=', True), ('active', '=', False), ('code', '=', code)])
|
existing_ids = self._execute('stock.incoterms', 'search',
|
||||||
|
['|', ('active', '=', True), ('active', '=', False), ('code', '=', code)])
|
||||||
if existing_ids:
|
if existing_ids:
|
||||||
vals = {
|
vals = {
|
||||||
'active': True,
|
'active': True,
|
||||||
|
|
@ -227,7 +227,8 @@ class CamadeusFunctions():
|
||||||
def install_module_sale(self):
|
def install_module_sale(self):
|
||||||
"""Modul 'Sale' installieren"""
|
"""Modul 'Sale' installieren"""
|
||||||
|
|
||||||
modules_to_install = self._execute('ir.module.module', 'search', [('name', '=', 'sale'), ('state', '!=', 'installed')])
|
modules_to_install = self._execute('ir.module.module', 'search',
|
||||||
|
[('name', '=', 'sale'), ('state', '!=', 'installed')])
|
||||||
self._execute('ir.module.module', 'button_install', modules_to_install)
|
self._execute('ir.module.module', 'button_install', modules_to_install)
|
||||||
self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
||||||
return True
|
return True
|
||||||
|
|
@ -235,7 +236,8 @@ class CamadeusFunctions():
|
||||||
def install_modules(self):
|
def install_modules(self):
|
||||||
"""Module installieren"""
|
"""Module installieren"""
|
||||||
|
|
||||||
modules_to_install = self._execute('ir.module.module', 'search', [('name', 'in', self.config.modules), ('state', '!=', 'installed')])
|
modules_to_install = self._execute('ir.module.module', 'search',
|
||||||
|
[('name', 'in', self.config.modules), ('state', '!=', 'installed')])
|
||||||
self._execute('ir.module.module', 'button_install', modules_to_install)
|
self._execute('ir.module.module', 'button_install', modules_to_install)
|
||||||
self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
self._execute('base.module.upgrade', 'upgrade_module', modules_to_install)
|
||||||
return True
|
return True
|
||||||
|
|
@ -354,10 +356,12 @@ class CamadeusFunctions():
|
||||||
"""Konfiguration Kontenplan"""
|
"""Konfiguration Kontenplan"""
|
||||||
|
|
||||||
c = self.config
|
c = self.config
|
||||||
sales_tax_ids = self._execute('account.tax.template', 'search', [('description', '=', c.sales_tax), ('parent_id', '=', False)])
|
sales_tax_ids = self._execute('account.tax.template', 'search',
|
||||||
|
[('description', '=', c.sales_tax), ('parent_id', '=', False)])
|
||||||
if not sales_tax_ids:
|
if not sales_tax_ids:
|
||||||
return False
|
return False
|
||||||
purchase_tax_ids = self._execute('account.tax.template', 'search', [('description', '=', c.purchase_tax), ('parent_id', '=', False)])
|
purchase_tax_ids = self._execute('account.tax.template', 'search',
|
||||||
|
[('description', '=', c.purchase_tax), ('parent_id', '=', False)])
|
||||||
if not purchase_tax_ids:
|
if not purchase_tax_ids:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
@ -443,10 +447,13 @@ class CamadeusFunctions():
|
||||||
self._execute('account.fiscal.position', 'write', invalid_ids, {'active': False})
|
self._execute('account.fiscal.position', 'write', invalid_ids, {'active': False})
|
||||||
|
|
||||||
# Mappings inaktiver Steuern löschen (also wenn rechte Seite eine inaktive Steuer ist, wie z. B "strf. i.g.L"))
|
# Mappings inaktiver Steuern löschen (also wenn rechte Seite eine inaktive Steuer ist, wie z. B "strf. i.g.L"))
|
||||||
valid_position_ids = self._execute('account.fiscal.position', 'search', [('name', 'in', c.valid_fiscal_positions)])
|
valid_position_ids = self._execute('account.fiscal.position', 'search',
|
||||||
|
[('name', 'in', c.valid_fiscal_positions)])
|
||||||
valid_tax_ids = self._execute('account.tax', 'search', [('parent_id', '=', False)])
|
valid_tax_ids = self._execute('account.tax', 'search', [('parent_id', '=', False)])
|
||||||
|
|
||||||
position_tax_line_ids = self._execute('account.fiscal.position.tax', 'search', [('position_id', 'in', valid_position_ids), ('tax_dest_id', 'not in', valid_tax_ids)])
|
position_tax_line_ids = self._execute('account.fiscal.position.tax', 'search',
|
||||||
|
[('position_id', 'in', valid_position_ids),
|
||||||
|
('tax_dest_id', 'not in', valid_tax_ids)])
|
||||||
vals = {'tax_dest_id': False}
|
vals = {'tax_dest_id': False}
|
||||||
return self._execute('account.fiscal.position.tax', 'write', position_tax_line_ids, vals)
|
return self._execute('account.fiscal.position.tax', 'write', position_tax_line_ids, vals)
|
||||||
|
|
||||||
|
|
@ -466,7 +473,8 @@ class CamadeusFunctions():
|
||||||
"""Installiere Modul"""
|
"""Installiere Modul"""
|
||||||
|
|
||||||
module_name = self.config.module_name
|
module_name = self.config.module_name
|
||||||
mod_ids = self._execute('ir.module.module', 'search', [('name', '=', module_name), ('state', '=', 'uninstalled')])
|
mod_ids = self._execute('ir.module.module', 'search',
|
||||||
|
[('name', '=', module_name), ('state', '=', 'uninstalled')])
|
||||||
if not len(mod_ids) == 1:
|
if not len(mod_ids) == 1:
|
||||||
raise Exception('Module "%s" not found or is not in state "uninstalled".' % module_name)
|
raise Exception('Module "%s" not found or is not in state "uninstalled".' % module_name)
|
||||||
|
|
||||||
|
|
@ -495,7 +503,8 @@ class CamadeusFunctions():
|
||||||
def cancel_upgrade_module(self):
|
def cancel_upgrade_module(self):
|
||||||
"""Modul Upgrade abbrechen"""
|
"""Modul Upgrade abbrechen"""
|
||||||
module_name = self.config.module_name
|
module_name = self.config.module_name
|
||||||
mod_ids = self._execute('ir.module.module', 'search', [('name','=',module_name),('state','=','to upgrade')])
|
mod_ids = self._execute('ir.module.module', 'search',
|
||||||
|
[('name', '=', module_name), ('state', '=', 'to upgrade')])
|
||||||
if not len(mod_ids) == 1:
|
if not len(mod_ids) == 1:
|
||||||
raise Exception("Module '%s' not found or is not installed." % module_name)
|
raise Exception("Module '%s' not found or is not installed." % module_name)
|
||||||
|
|
||||||
|
|
@ -520,7 +529,8 @@ class CamadeusFunctions():
|
||||||
"""Aktualisiere Modul"""
|
"""Aktualisiere Modul"""
|
||||||
|
|
||||||
for module_name in self.config.modules:
|
for module_name in self.config.modules:
|
||||||
mod_ids = self._execute('ir.module.module', 'search', [('name', '=', module_name), ('state', '=', 'installed')])
|
mod_ids = self._execute('ir.module.module', 'search',
|
||||||
|
[('name', '=', module_name), ('state', '=', 'installed')])
|
||||||
if not len(mod_ids) == 1:
|
if not len(mod_ids) == 1:
|
||||||
raise Exception('Module "%s" not found or ist not installed.' % module_name)
|
raise Exception('Module "%s" not found or ist not installed.' % module_name)
|
||||||
self._execute('ir.module.module', 'button_upgrade', mod_ids)
|
self._execute('ir.module.module', 'button_upgrade', mod_ids)
|
||||||
|
|
@ -531,7 +541,8 @@ class CamadeusFunctions():
|
||||||
def set_warehouse(self):
|
def set_warehouse(self):
|
||||||
"""Name des Zentrallagers setzen"""
|
"""Name des Zentrallagers setzen"""
|
||||||
|
|
||||||
is_installed = self._execute('ir.module.module', 'search', [('name', '=', 'stock'), ('state', '=', 'installed')])
|
is_installed = self._execute('ir.module.module', 'search',
|
||||||
|
[('name', '=', 'stock'), ('state', '=', 'installed')])
|
||||||
if is_installed:
|
if is_installed:
|
||||||
vals = {
|
vals = {
|
||||||
'name': self.config.warehouse_name or self.config.company_data.get('name', 'Mein Unternehmen'),
|
'name': self.config.warehouse_name or self.config.company_data.get('name', 'Mein Unternehmen'),
|
||||||
|
|
@ -547,7 +558,7 @@ class CamadeusFunctions():
|
||||||
def set_dmi_noupdate(self):
|
def set_dmi_noupdate(self):
|
||||||
"""DMI: Einträge auf 'no update' setzen"""
|
"""DMI: Einträge auf 'no update' setzen"""
|
||||||
|
|
||||||
domain = [('module','=','cam_dmi'), ('noupdate', '=', False)]
|
domain = [('module', '=', 'dp_dmi'), ('noupdate', '=', False)]
|
||||||
data_ids = self._execute('ir.model.data', 'search', domain)
|
data_ids = self._execute('ir.model.data', 'search', domain)
|
||||||
|
|
||||||
vals = {'noupdate': True}
|
vals = {'noupdate': True}
|
||||||
|
|
@ -556,7 +567,7 @@ class CamadeusFunctions():
|
||||||
def dmi_confirm_inventory(self):
|
def dmi_confirm_inventory(self):
|
||||||
"""DMI: Lagerstand einbuchen"""
|
"""DMI: Lagerstand einbuchen"""
|
||||||
|
|
||||||
dummy,inventory_id = self._execute('ir.model.data', 'get_object_reference', 'cam_dmi','inv_init')
|
dummy, inventory_id = self._execute('ir.model.data', 'get_object_reference', 'dp_dmi', 'inv_init')
|
||||||
|
|
||||||
inventory = self._execute('stock.inventory', 'read', inventory_id, ['state'])
|
inventory = self._execute('stock.inventory', 'read', inventory_id, ['state'])
|
||||||
|
|
||||||
|
|
@ -620,7 +631,8 @@ class CamadeusFunctions():
|
||||||
vals = {}
|
vals = {}
|
||||||
vals['res_model'] = 'res.users'
|
vals['res_model'] = 'res.users'
|
||||||
vals['file'] = self._readAndReturnFile(self.config.users_file)
|
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']
|
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'}
|
options = {u'headers': True, u'quoting': u'"', u'separator': u',', u'encoding': u'utf-8'}
|
||||||
|
|
||||||
wizard_id = self._execute('base_import.import', 'create', vals)
|
wizard_id = self._execute('base_import.import', 'create', vals)
|
||||||
|
|
@ -749,6 +761,17 @@ class CamadeusFunctions():
|
||||||
self._execute('ir.config_parameter', 'create', vals)
|
self._execute('ir.config_parameter', 'create', vals)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def remove_sys_params(self):
|
||||||
|
"""Systemparameter entfernen"""
|
||||||
|
|
||||||
|
for key, value in self.config.system_parameters_remove_on_rollout.items():
|
||||||
|
print key
|
||||||
|
param_ids = self._execute('ir.config_parameter', 'search', [('key', '=', key)])
|
||||||
|
print param_ids
|
||||||
|
if param_ids:
|
||||||
|
self._execute('ir.config_parameter', 'unlink', param_ids)
|
||||||
|
return True
|
||||||
|
|
||||||
def setup_reports(self):
|
def setup_reports(self):
|
||||||
"""Berichte konfigurieren"""
|
"""Berichte konfigurieren"""
|
||||||
|
|
||||||
|
|
@ -864,3 +887,28 @@ class CamadeusFunctions():
|
||||||
cron_ids = self._execute('ir.cron', 'search', [])
|
cron_ids = self._execute('ir.cron', 'search', [])
|
||||||
if cron_ids:
|
if cron_ids:
|
||||||
self._execute('ir.cron', 'write', cron_ids, {'active': False})
|
self._execute('ir.cron', 'write', cron_ids, {'active': False})
|
||||||
|
|
||||||
|
def set_ext_ids(self):
|
||||||
|
"""ExtIDs für Accounts und Types"""
|
||||||
|
|
||||||
|
# # Konten Ext IDs
|
||||||
|
# lst_accs = ['200000', '330000', '250000', '350000'] # odoo 9 nummern
|
||||||
|
# for acc in lst_accs:
|
||||||
|
# res_id = self._execute('account.account', 'search', [('code', '=', acc)])
|
||||||
|
# # print "---------------------------------------------"
|
||||||
|
# # print acc
|
||||||
|
# # print res_id
|
||||||
|
# vals = {
|
||||||
|
# 'name': 'cust_account_mapp_' + acc,
|
||||||
|
# 'module': 'account',
|
||||||
|
# 'model': 'account.account',
|
||||||
|
# 'res_id': res_id[0],
|
||||||
|
# }
|
||||||
|
# try:
|
||||||
|
# self._execute('ir.model.data', 'create', vals)
|
||||||
|
# except:
|
||||||
|
# print "Fehler Anlage ExtID " + 'cust_account_mapp_' + acc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue