From 21b24b298327f29f2ebf4a98856acbf115a7d2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=BCckl?= Date: Wed, 3 Dec 2014 17:38:31 +0100 Subject: [PATCH 1/4] update script, testenv --- ext/custom-addons/cam_testenv/__openerp__.py | 7 ++---- .../controllers/testenv_controller.py | 4 +-- .../cam_testenv/views/cam_testenv.xml | 13 ++++++++++ setup/lib/cli.py | 3 ++- setup/lib/config_at.py | 25 +++++++++++++------ setup/lib/functions.py | 23 ++++++++++++++++- 6 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 ext/custom-addons/cam_testenv/views/cam_testenv.xml diff --git a/ext/custom-addons/cam_testenv/__openerp__.py b/ext/custom-addons/cam_testenv/__openerp__.py index 1ddf5d6a..0199de01 100644 --- a/ext/custom-addons/cam_testenv/__openerp__.py +++ b/ext/custom-addons/cam_testenv/__openerp__.py @@ -35,12 +35,9 @@ Test Environment 'author': 'camadeus Consulting GmbH', 'website': 'http://www.camadeus.at', 'depends': ['web','base'], - 'js': [ - 'static/src/js/testenv.js', + 'data': [ + 'views/cam_testenv.xml', ], - 'css': [ - 'static/src/css/testenv.css', - ], 'update_xml': [], 'demo_xml': [], 'installable': True, diff --git a/ext/custom-addons/cam_testenv/controllers/testenv_controller.py b/ext/custom-addons/cam_testenv/controllers/testenv_controller.py index 02e70dbd..cd49947e 100644 --- a/ext/custom-addons/cam_testenv/controllers/testenv_controller.py +++ b/ext/custom-addons/cam_testenv/controllers/testenv_controller.py @@ -47,8 +47,8 @@ class WebClient(http.Controller): if db: h = req.httprequest.environ['HTTP_HOST'].split(':')[0] - d = h.split('.')[0] - r = openerp.tools.config.get('dbfilter_test', 'test*').replace('%h', h).replace('%d', d) + d = h.split('.')[0] + r = openerp.tools.config.get('dbfilter_test', 'test.*').replace('%h', h).replace('%d', d) try: pattern_list = eval(r) if not hasattr(pattern_list, '__iter__'): diff --git a/ext/custom-addons/cam_testenv/views/cam_testenv.xml b/ext/custom-addons/cam_testenv/views/cam_testenv.xml new file mode 100644 index 00000000..f0e25814 --- /dev/null +++ b/ext/custom-addons/cam_testenv/views/cam_testenv.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/setup/lib/cli.py b/setup/lib/cli.py index 5b543fef..7be22343 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -55,7 +55,8 @@ def main(): 'set_company', 'set_taxes', 'set_uom', - 'set_steuerzuordnung', + 'set_steuerzuordnung', + 'setup_journals', ] if cmd == 'rollout': diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index 51722c02..5288e63c 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -11,18 +11,18 @@ class Config(): self.company_data = { 'name': 'Camadeus GmbH', - 'street': 'Seeböckgasse 39', + 'street': 'Kriehubergasse 16', 'street2': False, 'city': 'Wien', - 'zip': 'A-1160', - 'phone': '+43 (0)1 486 36 49', + 'zip': '1050', + 'phone': '+43 1 78910 96 70', 'fax': False, - 'email': 'office@zeibich.at', - 'website': 'http://www.zeibich.at', - 'company_registry': '51835d ', + 'email': 'office@camadeus.at', + 'website': 'http://www.camadeus.at', + 'company_registry': '280076b ', 'country_id': 'at', # "de" für deutschland 'logo': False, - 'vat': 'ATU14644107 ', + 'vat': 'ATU 62991855 ', 'rml_header1': False, 'vat_check_vies': True, 'tax_calculation_rounding_method': 'round_globally', @@ -72,6 +72,11 @@ class Config(): 'prefix': 'A-', 'padding': 5, }, +# 'work.order': { +# 'number_next_actual': 100, +# 'prefix': 'AS-', +# 'padding': 5, +# }, # 'picking.out': { # 'number_next_actual': 2000, # 'prefix': 'L-', @@ -96,6 +101,9 @@ class Config(): #'product.product_uom_hour': 'h', } + # Soll das Ändern einer Rechnung im Nachhinein erlaubt sein? + self.allow_cancel_invoice = True + self.modules = [ 'document', 'auth_crypt', @@ -103,7 +111,8 @@ class Config(): 'cam_max_width', 'oerp_no_phoning_home', 'cam_custom', - 'custom_reports', + 'custom_reports', + 'account_cancel', #'crm', #'sale', #'cam_hr_overtime', diff --git a/setup/lib/functions.py b/setup/lib/functions.py index 52e7fa29..6486a852 100755 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -183,6 +183,14 @@ class CamadeusFunctions(): return False if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('sale.order')): return False + + # Arbeitsschein + if seq_dict.get('work.order',False): + s_ids = self._execute('ir.sequence', 'search', [('code','=','work.order')]) + if len(s_ids) != 1: + return False + if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('work.order')): + return False # EK-Angebot if seq_dict.get('purchase.order',False): @@ -324,4 +332,17 @@ class CamadeusFunctions(): wizard_id = self._execute('base.module.update', 'create', {}) vals = self._execute('base.module.update', 'update_module', [wizard_id]) - return True \ No newline at end of file + return True + + def setup_journals(self): + """Update journals""" + # Verkauf- und Gutschriftenjournal + j_ids = self._execute('account.journal', 'search', [('code','in',['VK','GSV','SAJ','SCNJ'])]) + if len(j_ids) != 2: + return False + vals = { + 'update_posted': self.config.allow_cancel_invoice + } + if not self._execute('account.journal', 'write', j_ids, vals): + return False + return True \ No newline at end of file From c4ff35023b3d20949413055999a03a915d12e045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=BCckl?= Date: Thu, 4 Dec 2014 13:58:57 +0100 Subject: [PATCH 2/4] eclipse runner --- dev/Server.launch | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 dev/Server.launch diff --git a/dev/Server.launch b/dev/Server.launch new file mode 100644 index 00000000..e8a48a3e --- /dev/null +++ b/dev/Server.launch @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + From 039b0b96394b009e55aa63ad5e2e2b43745d570f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=BCckl?= Date: Wed, 10 Dec 2014 11:50:51 +0100 Subject: [PATCH 3/4] warehouse name, patches --- patches/rml_align.patch | 11 +++++++++++ setup/lib/cli.py | 1 + setup/lib/config_at.py | 8 ++++++-- setup/lib/functions.py | 12 ++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 patches/rml_align.patch diff --git a/patches/rml_align.patch b/patches/rml_align.patch new file mode 100644 index 00000000..4a688bf1 --- /dev/null +++ b/patches/rml_align.patch @@ -0,0 +1,11 @@ +--- 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: diff --git a/setup/lib/cli.py b/setup/lib/cli.py index 5230888c..5106df6b 100755 --- a/setup/lib/cli.py +++ b/setup/lib/cli.py @@ -49,6 +49,7 @@ def main(): 'login', 'uninstall_chat', 'install_modules', + 'set_warehouse', 'base_config', 'sale_config', 'set_date_format', diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index 5288e63c..c4922076 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -27,9 +27,13 @@ class Config(): 'vat_check_vies': True, 'tax_calculation_rounding_method': 'round_globally', #'rml_header' : './ext/addons/custom_reports/report/page.rml', # Report File - #'logo': './ext/addons/custom_reports/logo.png', + 'logo': './ext/addons/cam_reports/logo.png', } + # Nur für Lager + # Wenn nicht gesetzt, dann wird der Firmenname genommen + self.warehouse_name = False + self.valid_taxes = [ '20% MwSt', '10% MwSt', @@ -111,7 +115,7 @@ class Config(): 'cam_max_width', 'oerp_no_phoning_home', 'cam_custom', - 'custom_reports', + 'cam_reports', 'account_cancel', #'crm', #'sale', diff --git a/setup/lib/functions.py b/setup/lib/functions.py index dbe49b4f..a53d3a2b 100755 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -358,3 +358,15 @@ class CamadeusFunctions(): res = self._execute('base.module.upgrade', 'upgrade_module', []) return True + def set_warehouse(self): + """Name des Zentrallagers setzen""" + + is_installed = self._execute('ir.module.module', 'search', [('name','=','stock'),('state','=','installed')]) + if is_installed: + vals = { + 'name': self.config.warehouse_name or self.config.company_data.get('name','Mein Unternehmen') + } + warehouse_ids = self._execute('stock.warehouse', 'search', []) + return self._execute('stock.warehouse', 'write', warehouse_ids, vals) + else: + return True From 0d18e36a127c577ceb903a41f2df2e84e72b61d8 Mon Sep 17 00:00:00 2001 From: Andreas Date: Mon, 15 Dec 2014 23:44:49 +0100 Subject: [PATCH 4/4] typos --- .../report/{stock.picking.list.rml => stock.picking.rml} | 0 setup/lib/config_at.py | 2 +- setup/lib/functions.py | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) rename ext/custom-addons/cam_reports/report/{stock.picking.list.rml => stock.picking.rml} (100%) diff --git a/ext/custom-addons/cam_reports/report/stock.picking.list.rml b/ext/custom-addons/cam_reports/report/stock.picking.rml similarity index 100% rename from ext/custom-addons/cam_reports/report/stock.picking.list.rml rename to ext/custom-addons/cam_reports/report/stock.picking.rml diff --git a/setup/lib/config_at.py b/setup/lib/config_at.py index c4922076..fa3b64fd 100644 --- a/setup/lib/config_at.py +++ b/setup/lib/config_at.py @@ -27,7 +27,7 @@ class Config(): 'vat_check_vies': True, 'tax_calculation_rounding_method': 'round_globally', #'rml_header' : './ext/addons/custom_reports/report/page.rml', # Report File - 'logo': './ext/addons/cam_reports/logo.png', + 'logo': '../ext/custom-addons/cam_reports/logo.png', } # Nur für Lager diff --git a/setup/lib/functions.py b/setup/lib/functions.py index a53d3a2b..df8984d8 100755 --- a/setup/lib/functions.py +++ b/setup/lib/functions.py @@ -207,7 +207,7 @@ class CamadeusFunctions(): return False journals = self._execute('account.journal', 'read', j_ids, ['sequence_id']) s_ids = [t['sequence_id'][0] for t in journals] - if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('account.invoicer')): + if not self._execute('ir.sequence', 'write', s_ids, seq_dict.get('account.invoice')): return False return True @@ -228,6 +228,7 @@ class CamadeusFunctions(): vals = { 'groups_id': groups, + 'tz': 'Europe/Vienna', } return self._execute('res.users', 'write', [user_id], vals)