From 5fe7633b009f12e886b93467c6f4eb574000c271 Mon Sep 17 00:00:00 2001 From: Christian Hattemer Date: Fri, 9 Sep 2016 14:36:49 +0200 Subject: [PATCH] =?UTF-8?q?Camadeus=20->=20datenpol=20f=C3=BCr=20die=20wic?= =?UTF-8?q?htigsten=20Module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ext/custom-addons/cam_custom/__init__.py | 3 +- ext/custom-addons/cam_custom/__openerp__.py | 14 +- ext/custom-addons/cam_custom/cam_custom.py | 36 +- ext/custom-addons/cam_reports/__init__.py | 4 +- ext/custom-addons/cam_reports/__openerp__.py | 12 +- ext/custom-addons/cam_reports/cam_reports.py | 41 +- .../cam_reports/report/account.invoice.rml | 382 +++++++++--------- .../cam_reports/report/mrp.production.rml | 246 +++++------ .../cam_reports/report/sale.order.rml | 248 ++++++------ .../cam_reports/report/stock.picking.rml | 202 ++++----- 10 files changed, 592 insertions(+), 596 deletions(-) diff --git a/ext/custom-addons/cam_custom/__init__.py b/ext/custom-addons/cam_custom/__init__.py index 8dbb873f..a03f810f 100644 --- a/ext/custom-addons/cam_custom/__init__.py +++ b/ext/custom-addons/cam_custom/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 20014-2016 Camadeus GmbH (). +# Copyright (C) 20014-2016 datenpol gmbh (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -22,4 +22,3 @@ import cam_custom # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/ext/custom-addons/cam_custom/__openerp__.py b/ext/custom-addons/cam_custom/__openerp__.py index c1759a24..c002870f 100644 --- a/ext/custom-addons/cam_custom/__openerp__.py +++ b/ext/custom-addons/cam_custom/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 20014-2016 Camadeus GmbH (). +# Copyright (C) 20014-2016 datenpol gmbh (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,19 +21,19 @@ { - 'name': 'Camadeus Anpassungen', - 'category': 'Custom', + 'name': 'datenpol-Anpassungen', + 'category': 'Custom', 'version': '1.0', 'description': """Individuelle Anpassungen""", - 'author': 'camadeus GmbH', - 'website': 'http://www.camadeus.at', + 'author': 'datenpol gmbh', + 'website': 'http://www.datenpol.at/', 'depends': ['sale','mail','product','account','knowledge'], - 'data': [ + 'data': [ 'cam_custom_view.xml', 'cam_custom_data.xml', 'views/custom_theme.xml', 'security/ir.model.access.csv', - ], + ], 'installable': True, 'auto_install': False, } diff --git a/ext/custom-addons/cam_custom/cam_custom.py b/ext/custom-addons/cam_custom/cam_custom.py index 6a3ab475..9f59fe5f 100644 --- a/ext/custom-addons/cam_custom/cam_custom.py +++ b/ext/custom-addons/cam_custom/cam_custom.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 20014-2016 Camadeus GmbH (). +# Copyright (C) 20014-2016 datenpol gmbh (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -24,30 +24,29 @@ from openerp import api from openerp.tools.translate import _ from openerp import SUPERUSER_ID from openerp import tools -from lxml import etree DISABLED_MENUS = [ ] class ir_ui_menu(models.Model): _inherit = 'ir.ui.menu' - + @tools.ormcache(skiparg=2) def get_disabled_menu_ids(self, cr, uid, context=None): data_obj = self.pool.get('ir.model.data') - + menu_ids = [] for menu in DISABLED_MENUS: module,xml_id = menu.split('.') menu = data_obj.get_object(cr, uid, module, xml_id) if menu: menu_ids.append(menu.id) - return menu_ids + return menu_ids - def _filter_visible_menus(self, cr, uid, ids, context=None): - if uid != 1: + def _filter_visible_menus(self, cr, uid, ids, context=None): + if uid != 1: disabled_ids = self.get_disabled_menu_ids(cr, uid) - + ids = [id for id in ids if id not in disabled_ids] ids = super(ir_ui_menu, self)._filter_visible_menus(cr, uid, ids, context) @@ -55,12 +54,11 @@ class ir_ui_menu(models.Model): class res_partner(models.Model): _inherit = 'res.partner' - + @api.model def fields_view_get_address(self, arch): """ verhindert das Überschreiben von address_format """ return arch - class mail_notification(models.Model): _inherit = 'mail.notification' @@ -98,7 +96,7 @@ class mail_notification(models.Model): # else: # company = user.company_id.name # sent_by = _('Sent by %(company)s using %(odoo)s') -# +# # signature_company = '
%s' % (sent_by % { # 'company': company, # 'odoo': "Odoo" @@ -106,20 +104,20 @@ class mail_notification(models.Model): # footer = tools.append_content_to_html(footer, signature_company, plaintext=False, container_tag='div') return footer - + # class product_product(osv.osv): # _inherit = 'product.product' -# +# # def name_get(self, cr, user, ids, context=None): # if context is None: # context = {} # c = context.copy() # c.update({'display_default_code': False}) -# return super(product_product, self).name_get(cr, user, ids, context=c) - +# return super(product_product, self).name_get(cr, user, ids, context=c) + class sale_order_line(models.Model): _inherit = 'sale.order.line' - + @api.onchange('name') def onchange_name(self): if self.name != False and self.product_id.id == False: @@ -131,7 +129,7 @@ class sale_order_line(models.Model): class product_product(models.Model): _inherit = 'product.product' - + def name_get(self, cr, user, ids, context=None): """ beim Angebot die Nummer nicht in das Feld Bezeichnung übernehmen""" if context is None: @@ -144,5 +142,5 @@ class product_product(models.Model): class res_country(models.Model): _inherit = 'res.country' - - active = fields.Boolean('Aktiv', default=True) \ No newline at end of file + + active = fields.Boolean('Aktiv', default=True) diff --git a/ext/custom-addons/cam_reports/__init__.py b/ext/custom-addons/cam_reports/__init__.py index 4739d040..bdbf6bf8 100644 --- a/ext/custom-addons/cam_reports/__init__.py +++ b/ext/custom-addons/cam_reports/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 20014-2016 Camadeus GmbH (). +# Copyright (C) 20014-2016 datenpol gmbh (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -20,5 +20,5 @@ ############################################################################## import cam_reports -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/ext/custom-addons/cam_reports/__openerp__.py b/ext/custom-addons/cam_reports/__openerp__.py index 57cda6ef..742a0809 100644 --- a/ext/custom-addons/cam_reports/__openerp__.py +++ b/ext/custom-addons/cam_reports/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 20014-2016 Camadeus GmbH (). +# Copyright (C) 20014-2016 datenpol gmbh (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -21,14 +21,14 @@ { - 'name': 'Camadeus Reports', - 'category': 'Custom', + 'name': 'Datenpol-Reports', + 'category': 'Custom', 'version': '1.0', 'description': """Individuelle Dokumentenvorlagen""", - 'author': 'camadeus GmbH', - 'website': 'http://www.camadeus.at', + 'author': 'datenpol gmbh', + 'website': 'http://www.datenpol.at/', 'depends': ['purchase','sale','account','stock'], - 'data': ['reports_data.xml', + 'data': ['reports_data.xml', ], 'installable': True, 'auto_install': False, diff --git a/ext/custom-addons/cam_reports/cam_reports.py b/ext/custom-addons/cam_reports/cam_reports.py index 1406531f..cb7952e4 100644 --- a/ext/custom-addons/cam_reports/cam_reports.py +++ b/ext/custom-addons/cam_reports/cam_reports.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 20014-2016 Camadeus GmbH (). +# Copyright (C) 20014-2016 datenpol gmbh (). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -26,16 +26,15 @@ import base64 class res_company(osv.osv): _inherit = 'res.company' - + def get_image(self, img): - def _get_dir(): styles_dir = 'cam_reports/static/src/img' - adps = addons.module.ad_paths + adps = addons.module.ad_paths for adp in adps: dir = os.path.join(adp, styles_dir) - if os.path.isdir(dir): - return dir + if os.path.isdir(dir): + return dir return False def _get_file_data(filename): @@ -46,48 +45,48 @@ class res_company(osv.osv): return data except: print "Error openening file '%s'." % (filename) - return False - + return False + path = _get_dir() - fname = os.path.join(path, img) + fname = os.path.join(path, img) img_data = _get_file_data(fname) return img_data - + def _get_rml_header(self, cr, uid, ids, _field_name, _args, context=None): result = dict.fromkeys(ids, False) # Get filename dirname = 'cam_reports/report' - adps = addons.module.ad_paths + adps = addons.module.ad_paths for adp in adps: dir = os.path.join(adp, dirname) if os.path.isdir(dir): break - + if os.path.isdir(dir): - filename = os.path.join(dir, 'briefkopf.rml') + filename = os.path.join(dir, 'briefkopf.rml') f = open(filename , 'rb') data = f.read() result = dict.fromkeys(ids, data) return result - + def _get_rml_header2(self, cr, uid, ids, _field_name, _args, context=None): result = dict.fromkeys(ids, False) # Get filename dirname = 'cam_reports/report' - adps = addons.module.ad_paths + adps = addons.module.ad_paths for adp in adps: dir = os.path.join(adp, dirname) if os.path.isdir(dir): break - + if os.path.isdir(dir): - filename = os.path.join(dir, 'page.rml') + filename = os.path.join(dir, 'page.rml') f = open(filename , 'rb') data = f.read() result = dict.fromkeys(ids, data) return result - + _columns = { - 'rml_header': fields.function(_get_rml_header, type='text', string='Briefkopf',readonly=True), - 'rml_header2': fields.function(_get_rml_header2, type='text', string='RML Header',readonly=True), - } \ No newline at end of file + 'rml_header': fields.function(_get_rml_header, type='text', string='Briefkopf', readonly=True), + 'rml_header2': fields.function(_get_rml_header2, type='text', string='RML Header', readonly=True), + } diff --git a/ext/custom-addons/cam_reports/report/account.invoice.rml b/ext/custom-addons/cam_reports/report/account.invoice.rml index a4a8ec3d..61b8c80b 100644 --- a/ext/custom-addons/cam_reports/report/account.invoice.rml +++ b/ext/custom-addons/cam_reports/report/account.invoice.rml @@ -1,81 +1,81 @@ -