From 26bb219a74ca586de0f935e544991a9202da311f Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 24 Mar 2010 17:12:16 +0100 Subject: [PATCH 001/220] [IMP] wording: "customize" intead of "customise" lp bug: https://launchpad.net/bugs/546138 fixed bzr revid: ls@numerigraphe.fr-20100324161216-uvzz3vrr3s3vth5e --- bin/osv/orm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 165b9a21137..bcd05438a7b 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1222,7 +1222,7 @@ class orm_template(object): for field in fields_def: if field == 'id': - # sometime, the view may containt the (invisible) field 'id' needed for a domain (when 2 objects have cross references) + # sometime, the view may contain the (invisible) field 'id' needed for a domain (when 2 objects have cross references) fields['id'] = {'readonly': True, 'type': 'integer', 'string': 'ID'} elif field in fields: fields[field].update(fields_def[field]) @@ -1232,7 +1232,7 @@ class orm_template(object): model = res[0][1] res.insert(0, ("Can't find field '%s' in the following view parts composing the view of object model '%s':" % (field, model), None)) msg = "\n * ".join([r[0] for r in res]) - msg += "\n\nEither you wrongly customised this view, or some modules bringing those views are not compatible with your current data model" + msg += "\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model" netsvc.Logger().notifyChannel('orm', netsvc.LOG_ERROR, msg) raise except_orm('View error', msg) return arch, fields From 25a424a89d32e4485ae1e120c1d8b2ada216800e Mon Sep 17 00:00:00 2001 From: Numerigraphe - Lionel Sausin Date: Wed, 24 Mar 2010 17:32:22 +0100 Subject: [PATCH 002/220] [REF] 'children' instead of 'childs' lp bug: https://launchpad.net/bugs/327259 fixed bzr revid: ls@numerigraphe.fr-20100324163222-dj03gxme8sawtdmz --- bin/addons/base/module/module.py | 4 ++-- bin/osv/orm.py | 10 +++++----- bin/report/print_xml.py | 2 +- bin/report/render/rml2pdf/trml2pdf.py | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 01ea8cc0745..223a9ac1e42 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -46,8 +46,8 @@ class module_category(osv.osv): result = dict(cr.fetchall()) for id in ids: cr.execute('select id from ir_module_category where parent_id=%s', (id,)) - childs = [c for c, in cr.fetchall()] - result[id] = reduce(lambda x,y:x+y, [result.get(c, 0) for c in childs], result.get(id, 0)) + children = [c for c, in cr.fetchall()] + result[id] = reduce(lambda x,y:x+y, [result.get(c, 0) for c in children], result.get(id, 0)) return result _columns = { diff --git a/bin/osv/orm.py b/bin/osv/orm.py index bcd05438a7b..3d2e3d7a748 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1085,7 +1085,7 @@ class orm_template(object): context = {} result = False fields = {} - childs = True + children = True if node.tag == 'field': if node.get('name'): @@ -1100,7 +1100,7 @@ class orm_template(object): if column: relation = column._obj - childs = False + children = False views = {} for f in node: if f.tag in ('form', 'tree', 'graph'): @@ -1159,7 +1159,7 @@ class orm_template(object): if trans: node.set('sum', trans) - if childs: + if children: for f in node: fields.update(self.__view_look_dom(cr, user, f, view_id, context)) @@ -1966,8 +1966,8 @@ class orm(orm_template): where += ' order by '+self._parent_order cr.execute('SELECT id FROM '+self._table+' WHERE '+where) pos2 = pos + 1 - childs = cr.fetchall() - for id in childs: + children = cr.fetchall() + for id in children: pos2 = browse_rec(id[0], pos2) cr.execute('update '+self._table+' set parent_left=%s, parent_right=%s where id=%s', (pos,pos2,root)) return pos2+1 diff --git a/bin/report/print_xml.py b/bin/report/print_xml.py index 2c24d3766f3..a45270447e1 100644 --- a/bin/report/print_xml.py +++ b/bin/report/print_xml.py @@ -253,7 +253,7 @@ class document(object): for el_cld in node: self.parse_node(el_cld, el, v) else: - # if there is no "type" attribute in the node, copy it to the xml data and parse its childs + # if there is no "type" attribute in the node, copy it to the xml data and parse its children if not node.tag == etree.Comment: if node.tag == parent.tag: el = parent diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py index 0574f563c90..02352b44cc7 100644 --- a/bin/report/render/rml2pdf/trml2pdf.py +++ b/bin/report/render/rml2pdf/trml2pdf.py @@ -489,8 +489,8 @@ class _rml_flowable(object): return rc1 def _table(self, node): - childs = utils._child_get(node,self,'tr') - if not childs: + children = utils._child_get(node,self,'tr') + if not children: return None length = 0 colwidths = None @@ -498,7 +498,7 @@ class _rml_flowable(object): data = [] styles = [] posy = 0 - for tr in childs: + for tr in children: paraStyle = None if tr.get('style'): st = copy.deepcopy(self.styles.table_styles[tr.get('style')]) From b91ce5adb061443811ce2a6851215a5a8bc45ebc Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 11 Jun 2010 19:05:08 +0530 Subject: [PATCH 003/220] base_report_desinger: Add the remove file bzr revid: sbh@tinyerp.com-20100611133508-0jzv1uv50yxi9ff3 --- addons/base_report_designer/__openerp__.py | 3 +- .../base_report_designer_wizard.xml | 9 ++- .../base_report_designer/wizard/__init__.py | 1 + .../wizard/base_openoffice.py | 58 +++++++++++++++++++ .../wizard/base_openoffice_view.xml | 43 ++++++++++++++ 5 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 addons/base_report_designer/wizard/base_openoffice.py create mode 100644 addons/base_report_designer/wizard/base_openoffice_view.xml diff --git a/addons/base_report_designer/__openerp__.py b/addons/base_report_designer/__openerp__.py index f19d179a1ed..8934c54fcbc 100644 --- a/addons/base_report_designer/__openerp__.py +++ b/addons/base_report_designer/__openerp__.py @@ -37,7 +37,8 @@ upload the report using the same wizard. 'website': 'http://www.openerp.com', 'depends': ['base'], 'init_xml': ['base_report_data.xml'], - 'update_xml': ['base_report_designer_wizard.xml'], + 'update_xml': ['wizard/base_openoffice_view.xml', + 'base_report_designer_wizard.xml'], 'demo_xml': [], 'installable': True, 'active': False, diff --git a/addons/base_report_designer/base_report_designer_wizard.xml b/addons/base_report_designer/base_report_designer_wizard.xml index 8882d2de9e9..4d6a075d456 100644 --- a/addons/base_report_designer/base_report_designer_wizard.xml +++ b/addons/base_report_designer/base_report_designer_wizard.xml @@ -22,9 +22,12 @@ type="wizard" id="menu_wizard_report_designer_modify" sequence="70"/> - - - + diff --git a/addons/base_report_designer/wizard/__init__.py b/addons/base_report_designer/wizard/__init__.py index f80f87da1d5..1df66bdd200 100644 --- a/addons/base_report_designer/wizard/__init__.py +++ b/addons/base_report_designer/wizard/__init__.py @@ -20,5 +20,6 @@ ############################################################################## import base_report_designer_modify +import base_openoffice # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_report_designer/wizard/base_openoffice.py b/addons/base_report_designer/wizard/base_openoffice.py new file mode 100644 index 00000000000..7886b7cf028 --- /dev/null +++ b/addons/base_report_designer/wizard/base_openoffice.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import fields +from osv import osv +from tools import config + +import base64 +class base_openoffice(osv.osv_memory): + _name = "base.openoffice" + _description = "Open Office Report Desinger" + _columns = { + 'base_desinger_url': fields.char('Documentation URL', size=300, readonly=True), + 'plugin_file':fields.binary('OpenOffice Report Desinger',readonly=True), + 'pdf_file':fields.binary('Documenation', size=64 ,readonly=True), + } + def add_plugin(self, cr, uid, ids, context): + data = {} + file = open(config['addons_path'] + "/base_report_designer/report_desinger/openoffice_report_designer/openerp_report_designer.zip", 'r') + data['plugin_file'] = base64.encodestring(file.read()) + self.write(cr, uid, ids, data) + return False + + def process_pdf_file(self, cr, uid, ids, context): + """ + Default Attach Plug-in Installation File. + """ + data = {} + pdf_file = open(config['addons_path'] + "/base_report_designer/report_desinger/doc/OpenOffice.pdf", 'r') + data['pdf_file'] = base64.encodestring(pdf_file.read()) + self.write(cr, uid, ids, data) + return False + _defaults = { + 'name' : 'tiny_plugin-2.0.xpi', + 'pdf_name' : 'Installation Guide to OpenOffice Report Desinger.pdf', + 'base_desinger_url':'http://doc.openerp.com/developer/7_23_RAD_tools/index.html#open-office-report-designer' + + } + +base_openoffice() \ No newline at end of file diff --git a/addons/base_report_designer/wizard/base_openoffice_view.xml b/addons/base_report_designer/wizard/base_openoffice_view.xml new file mode 100644 index 00000000000..d3ed246a0f8 --- /dev/null +++ b/addons/base_report_designer/wizard/base_openoffice_view.xml @@ -0,0 +1,43 @@ + + + + + + + OpenOffice Report Designer + base.openoffice + form + +
+ + + + + +