From 683cf35070c9723099fe3b90ddcbe7de2e0a57c9 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 14 Sep 2010 13:36:35 +0000 Subject: [PATCH 001/150] openerp local commit bzr revid: al@openerp.com-20100914133635-9yuqmkxqdkmde2ql --- .../report/account_aged_partner_balance.rml | 2 +- addons/account/report/invoice.rml | 2 -- .../account_report_aged_partner_balance.py | 6 +++--- addons/base_action_rule/base_action_rule.py | 19 +++++++++++++++---- .../base_action_rule_view.xml | 1 + addons/crm/report/crm_lead_report.py | 8 ++++---- addons/crm/wizard/crm_forward_to_partner.py | 16 ++++++++++++++-- addons/document/document.py | 1 + .../security/email_template_security.xml | 2 -- addons/mrp/mrp_view.xml | 2 +- addons/sale/report/sale_order.rml | 10 +++++----- 11 files changed, 45 insertions(+), 24 deletions(-) diff --git a/addons/account/report/account_aged_partner_balance.rml b/addons/account/report/account_aged_partner_balance.rml index bd52f9be4f5..5a74e46a115 100644 --- a/addons/account/report/account_aged_partner_balance.rml +++ b/addons/account/report/account_aged_partner_balance.rml @@ -168,7 +168,7 @@ Partners - [[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not due' ]] [[ formatLang(data['form']['date1'],date=True) ]] + [[ data['form']['direction_selection'] == 'future' and 'Due' or 'Not Due' ]] [[ data['form']['4']['name'] ]] diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index f05198876b9..59342941829 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -239,8 +239,6 @@ - Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] - Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]] VAT : [[ o.partner_id.vat or removeParentNode('para') ]] diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py index 29867f04d5b..0431bafacb2 100644 --- a/addons/account/wizard/account_report_aged_partner_balance.py +++ b/addons/account/wizard/account_report_aged_partner_balance.py @@ -75,9 +75,9 @@ class account_aged_trial_balance(osv.osv_memory): for i in range(5)[::-1]: stop = start - RelativeDateTime(days=period_length) res[str(i)] = { - 'name' : str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length), + 'name' : (i!=0 and (str((5-(i+1)) * period_length) + '-' + str((5-i) * period_length)) or ('+'+str(4 * period_length))), 'stop': start.strftime('%Y-%m-%d'), - 'start' : stop.strftime('%Y-%m-%d'), + 'start' : (i!=0 and stop.strftime('%Y-%m-%d') or time.strftime('01-01-1900')), } start = stop - RelativeDateTime(days=1) else: @@ -99,4 +99,4 @@ class account_aged_trial_balance(osv.osv_memory): account_aged_trial_balance() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py index ff6321e599f..b4cd4f8ec00 100644 --- a/addons/base_action_rule/base_action_rule.py +++ b/addons/base_action_rule/base_action_rule.py @@ -113,6 +113,8 @@ the rule to mark CC(mail to any other person defined in actions)."), 'filter_id':fields.many2one('ir.filters', 'Filter', required=False), 'act_email_from' : fields.char('Email From', size=64, required=False, help="Use a python expression to specify the right field on which one than we will use for the 'From' field of the header"), + 'act_email_to' : fields.char('Email To', size=64, required=False, + help="Use a python expression to specify the right field on which one than we will use for the 'To' field of the header"), } _defaults = { @@ -356,13 +358,22 @@ the rule to mark CC(mail to any other person defined in actions)."), emails += (action.act_email_cc or '').split(',') if action.act_mail_to_email: emails += (action.act_mail_to_email or '').split(',') + import pdb + #pdb.set_trace() + + locals_for_emails = { + 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context), + 'obj' : obj, + } + + if action.act_email_to: + emails.append(safe_eval(action.act_email_to, {}, locals_for_emails)) + emails = filter(None, emails) + if len(emails) and action.act_mail_body: emails = list(set(emails)) - email_from = safe_eval(action.act_email_from, {}, { - 'user' : self.pool.get('res.users').browse(cr, uid, uid, context=context), - 'obj' : obj, - }) + email_from = safe_eval(action.act_email_from, {}, locals_for_emails) self.email_send(cr, uid, obj, emails, action.act_mail_body, emailfrom=email_from) return True diff --git a/addons/base_action_rule/base_action_rule_view.xml b/addons/base_action_rule/base_action_rule_view.xml index 526fe55f4a3..76620f26fe1 100644 --- a/addons/base_action_rule/base_action_rule_view.xml +++ b/addons/base_action_rule/base_action_rule_view.xml @@ -65,6 +65,7 @@ + diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py index 4f6f39e0690..09a80519cdb 100644 --- a/addons/crm/report/crm_lead_report.py +++ b/addons/crm/report/crm_lead_report.py @@ -127,9 +127,9 @@ class crm_lead_report(osv.osv): CREATE OR REPLACE VIEW crm_lead_report AS ( SELECT id, - to_char(c.create_date, 'YYYY') as name, - to_char(c.create_date, 'MM') as month, - to_char(c.create_date, 'YYYY-MM-DD') as day, + to_char(c.date_deadline, 'YYYY') as name, + to_char(c.date_deadline, 'MM') as month, + to_char(c.date_deadline, 'YYYY-MM-DD') as day, to_char(c.create_date, 'YYYY-MM-DD') as creation_date, to_char(c.date_open, 'YYYY-MM-DD') as opening_date, to_char(c.date_closed, 'YYYY-mm-dd') as date_closed, @@ -145,7 +145,7 @@ class crm_lead_report(osv.osv): c.partner_id, c.country_id, c.planned_revenue, - c.planned_revenue*(c.probability/100) as probable_revenue, + c.planned_revenue*(c.probability/100) as probable_revenue, 1 as nbr, 0 as avg_answers, 0.0 as perc_done, diff --git a/addons/crm/wizard/crm_forward_to_partner.py b/addons/crm/wizard/crm_forward_to_partner.py index aaa26c438b6..8f2d778c973 100644 --- a/addons/crm/wizard/crm_forward_to_partner.py +++ b/addons/crm/wizard/crm_forward_to_partner.py @@ -27,6 +27,18 @@ from osv import osv, fields import tools from tools.translate import _ +FWD_TEMPLATE="""Hello, + +OpenERP Leads are now forwarded to our trusted partners, through the CRM, we hope that they provide you with interesting projects, we know that they have shown keen interest in our software. +Below is an interesting lead for you. + +Please let us know about the advancements of this lead or if you are not able to answer to its requests by replying to this email. This way, we can keep track of closed leads or forward them to other partners. +Don't forget to propose our maintenance at the beginning of your implementation projects, together with your services quotation. The maintenance provides unlimited bugfixing that will avoid you waste time on bugs detected during the implementation. It also provides free migration services for the current stable version at the time of signature; otherwise if we released a new version during your implementation, the customer would not always be able to easily migrate to newer versions. + +Kind regards, OpenERP Team + +""" + class crm_lead_forward_to_partner(osv.osv_memory): """Forwards lead history""" _name = 'crm.lead.forward.to.partner' @@ -110,7 +122,7 @@ class crm_lead_forward_to_partner(osv.osv_memory): res_id = context.get('active_id') msg_val = self._get_case_history(cr, uid, history_type, res_id, context=context) if msg_val: - res = {'value': {'body' : '\n\n' + msg_val}} + res = {'value': {'body' : FWD_TEMPLATE + '\n\n' + msg_val}} return res def _get_case_history(self, cr, uid, history_type, res_id, context=None): @@ -268,7 +280,7 @@ class crm_lead_forward_to_partner(osv.osv_memory): body = self._get_case_history(cr, uid, defaults.get('history', 'latest'), lead.id, context=context) defaults.update({ 'subject' : '%s: %s' % (_('Fwd'), lead.name), - 'body' : body, + 'body' : FWD_TEMPLATE + '\n\n' + body, }) return defaults diff --git a/addons/document/document.py b/addons/document/document.py index 46cf6d189c1..f60531f40ef 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -144,6 +144,7 @@ class document_file(osv.osv): return super(document_file, self).copy(cr, uid, id, default, context) def write(self, cr, uid, ids, vals, context=None): + result = False if not isinstance(ids, list): ids = [ids] res = self.search(cr, uid, [('id', 'in', ids)]) diff --git a/addons/email_template/security/email_template_security.xml b/addons/email_template/security/email_template_security.xml index 7e6c1f4b560..9fcf47d94d8 100755 --- a/addons/email_template/security/email_template_security.xml +++ b/addons/email_template/security/email_template_security.xml @@ -1,10 +1,8 @@ - Marketing / User - diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 4504de8a2cf..402d352c174 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -6,7 +6,7 @@ groups="group_mrp_user,group_mrp_manager,base.group_system" sequence="8"/> - + Shipping address : - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]] + [[ o.partner_id.title.name or '' ]] [[ o.partner_id.name ]] + [[ o.partner_shipping_id.title.name or '' ]] [[ o.partner_shipping_id.name ]] [[ o.partner_shipping_id.street ]] [[ o.partner_shipping_id.street2 or '' ]] [[ o.partner_shipping_id.zip or '' ]] [[ o.partner_shipping_id.city or '' ]] @@ -145,7 +145,7 @@ Invoice address : - [[ o.partner_invoice_id.title or '' ]] [[ o.partner_invoice_id.name or '' ]] + [[ o.partner_invoice_id.title.name or '' ]] [[ o.partner_invoice_id.name or '' ]] [[ o.partner_invoice_id.street ]] [[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]] [[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] [[ o.partner_invoice_id.state_id and o.partner_invoice_id.state_id.name or '' ]][[ o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '' ]] @@ -156,8 +156,8 @@ - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.partner_order_id.title or '' ]] [[ o.partner_order_id.name ]] + [[ o.partner_id.title.name or '' ]] [[ o.partner_id.name ]] + [[ o.partner_order_id.title.name or '' ]] [[ o.partner_order_id.name ]] [[ o.partner_order_id.street ]] [[ o.partner_order_id.street2 or '' ]] [[ o.partner_order_id.zip or '' ]] [[ o.partner_order_id.city or '' ]] From 29721236fc1346555a15b8eea322986d82cef46c Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:49:50 +0200 Subject: [PATCH 002/150] document: fix matching of names with non-latin chars At a previous fix, the "res_name == name" condition was added, that didn't, however, consider the case where res_name was unicode and name in utf8. Conflicts: document/nodes.py bzr revid: p_christ@hol.gr-20110118164950-avtkxy8dc4u03fu4 --- addons/document/nodes.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 1b7aebcd389..0c4194847c1 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -23,6 +23,7 @@ import pooler from tools.safe_eval import safe_eval +from tools.misc import ustr import errno # import os import time @@ -808,7 +809,7 @@ class node_res_dir(node_class): return res[0] return None - def _child_get(self, cr, name = None, domain=None): + def _child_get(self, cr, name=None, domain=None): """ return virtual children of resource, based on the foreign object. @@ -868,7 +869,7 @@ class node_res_dir(node_class): # Escape the name for characters not supported in filenames res_name = res_name.replace('/','_') # any other weird char? - if name and (res_name != name): + if name and (res_name != ustr(name)): # we have matched _ to any character, but we only meant to match # the special ones. # Eg. 'a_c' will find 'abc', 'a/c', 'a_c', may only @@ -1044,7 +1045,7 @@ class node_res_obj(node_class): if not res_name: continue res_name = res_name.replace('/', '_') - if name and (res_name != name): + if name and (res_name != ustr(name)): continue # TODO Revise klass = directory.get_node_class(directory, dynamic=True, context=ctx) From e9b56eafe2db066332d0065302ca10befa39f381 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:49:56 +0200 Subject: [PATCH 003/150] docuement: armor the ir.action.report.xml code It was a little careless, better have an assertion there, at least, for the cases we don't cover. Historically, it has been here since commit: efeed12bea5c008ed6 ;) bzr revid: p_christ@hol.gr-20110118164956-vboodk5j4g9eofix --- addons/document/directory_report.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/document/directory_report.py b/addons/document/directory_report.py index 6eb18dae850..1665a7abf68 100644 --- a/addons/document/directory_report.py +++ b/addons/document/directory_report.py @@ -42,8 +42,12 @@ class ir_action_report_xml(osv.osv): def _model_search(self, cr, uid, obj, name, args, context=None): if not len(args): return [] + assert len(args) == 1 and args[0][1] == '=', 'expression is not what we expect: %r' % args model_id= args[0][2] if not model_id: + # a deviation from standard behavior: when searching model_id = False + # we return *all* reports, not just ones with empty model. + # One reason is that 'model' is a required field so far return [] model = self.pool.get('ir.model').read(cr, uid, [model_id])[0]['model'] report_id = self.search(cr, uid, [('model','=',model)]) From d9b74f05e44600f85e0d4f823b36135ccc767462 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:49:59 +0200 Subject: [PATCH 004/150] document_ics: relax domain restriction, it broke PDF reports, too. This whole thing of inheriting the same model for different functionality is a bit problematic. Document ICS is a Frankenstein, too. At least, don't let it break the other document.directory.content entries. bzr revid: p_christ@hol.gr-20110118164959-ctp4l2uj0xvc4v4y --- addons/document_ics/document_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/document_ics/document_view.xml b/addons/document_ics/document_view.xml index 40174612539..39b6908dc76 100644 --- a/addons/document_ics/document_view.xml +++ b/addons/document_ics/document_view.xml @@ -24,7 +24,7 @@ - + From 6572531524011266b5ddc80c25795332073817e3 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:50:15 +0200 Subject: [PATCH 005/150] caldav: Let the ETag of calendar entries be refreshed Skipped earlier, because it is an expensive operation, the write_date of nodes (aka. calendar entries) was cached. That meant that changes from the Gtk client wouldn't be depicted in CalDAV/GroupDAV clients. Now, go for the expensive operation and let them sync. bzr revid: p_christ@hol.gr-20110118165015-vn7avq6zk4t9g2yg --- addons/caldav/caldav_node.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index 70671507b01..5272d0fc1fd 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -494,6 +494,17 @@ class res_node_calendar(nodes.node_class): res = '%d' % (self.calendar_id) return res + def _get_wtag(self, cr): + uid = self.context.uid + context = self.context.context + if self.model and self.res_id: + mod_obj = self.context._dirobj.pool.get(self.model) + pr = mod_obj.perm_read(cr, uid, [self.res_id], context=context, details=False)[0] + self.write_date = pr.get('write_date') or pr.get('create_date') + + # Super will use self.write_date, so we should be fine. + return super(res_node_calendar, self)._get_wtag(cr) + def rm(self, cr): uid = self.context.uid res = False From 9b0993e74c77282bf0dbe6726421dc1e5450b7d7 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 18 Jan 2011 18:50:21 +0200 Subject: [PATCH 006/150] webdav: ';' in name not handled correctly [Bug 704444] Reported by: Dr. Ferdinand Gassauer Locations that contain a semicolon are split by the urlparse.urlparse(), thus setting their 'path' and 'params' return fields (rather than just the 'path'). In our syntax, there is no params, so the part after the semicolon needs to be appended back to the patch. bzr revid: p_christ@hol.gr-20110118165021-4knt76njdqnt1eln --- addons/document_webdav/dav_fs.py | 4 ++++ addons/document_webdav/webdav.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index 22f50cb8e9a..8c606e4cca0 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -414,6 +414,8 @@ class openerp_dav_handler(dav_interface): # relative part, because ul is relative, anyway uparts=urlparse.urlparse(turi) turi=uparts[2] + if uparts[3]: + turi += ';' + uparts[3] if turi.startswith(ul): result.append( turi[len(self.parent.davpath):]) else: @@ -440,6 +442,8 @@ class openerp_dav_handler(dav_interface): def uri2local(self, uri): uparts=urlparse.urlparse(uri) reluri=uparts[2] + if uparts[3]: + reluri += ';'+uparts[3] if reluri and reluri[-1]=="/": reluri=reluri[:-1] return reluri diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py index 1b60ade698f..3a68fb04fed 100644 --- a/addons/document_webdav/webdav.py +++ b/addons/document_webdav/webdav.py @@ -167,6 +167,8 @@ def mk_prop_response(self, uri, good_props, bad_props, doc): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") @@ -246,6 +248,8 @@ def mk_propname_response(self,uri,propnames,doc): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") @@ -303,6 +307,8 @@ def mk_lock_response(self, uri, props): # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] + if uparts[3]: + fileloc += ';' + uparts[3] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') davpath = self.parent.get_davpath() From ad91862c11b1361e7a0aeaaca180cf222f2a2a09 Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Wed, 19 Jan 2011 15:50:32 +0100 Subject: [PATCH 007/150] [FIX] bug 704870 webkit_locals bzr revid: nicolas.bessi@camptocamp.com-20110119145032-61kf5gqi281x0br7 --- addons/report_webkit/webkit_report.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index 2944b768643..47d3e58482d 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -123,17 +123,17 @@ class WebKitParser(report_sxw): command.append("--footer-html '%s'"%(foot_file.name)) if webkit_header.margin_top : - command.append('--margin-top %s'%(webkit_header.margin_top)) + command.append('--margin-top %s'%(str(webkit_header.margin_top).replace(',', '.'))) if webkit_header.margin_bottom : - command.append('--margin-bottom %s'%(webkit_header.margin_bottom)) + command.append('--margin-bottom %s'%(str(webkit_header.margin_bottom).replace(',', '.'))) if webkit_header.margin_left : - command.append('--margin-left %s'%(webkit_header.margin_left)) + command.append('--margin-left %s'%(str(webkit_header.margin_left).replace(',', '.'))) if webkit_header.margin_right : - command.append('--margin-right %s'%(webkit_header.margin_right)) + command.append('--margin-right %s'%(str(webkit_header.margin_right).replace(',', '.'))) if webkit_header.orientation : - command.append("--orientation '%s'"%(webkit_header.orientation)) + command.append("--orientation '%s'"%(str(webkit_header.orientation).replace(',', '.'))) if webkit_header.format : - command.append(" --page-size '%s'"%(webkit_header.format)) + command.append(" --page-size '%s'"%(str(webkit_header.format).replace(',', '.'))) count = 0 for html in html_list : html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w') From 4832c55df9d08ae11f0e97ae9104d14ef4d54d09 Mon Sep 17 00:00:00 2001 From: Bogdan Stanciu Date: Wed, 26 Jan 2011 13:57:55 +0100 Subject: [PATCH 008/150] [FIX] COA correction (account_account_type data was missing) for BS and P&L reporting lp bug: https://launchpad.net/bugs/707314 fixed bzr revid: bogdanovidiu.stanciu@gmail.com-20110126125755-urjp29cl0yibs5ur --- addons/l10n_ch/sterchi_chart/account.xml | 30 ++++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/addons/l10n_ch/sterchi_chart/account.xml b/addons/l10n_ch/sterchi_chart/account.xml index dbc99227c42..8c907653b4a 100644 --- a/addons/l10n_ch/sterchi_chart/account.xml +++ b/addons/l10n_ch/sterchi_chart/account.xml @@ -10,26 +10,31 @@ Bilan : Liquidites et titres cash balance + asset Bilan : Actif de regularisation adjusting_asset balance + asset Bilan : Capitaux propres equity balance + liability PP : Chiffre d'affaires income none + income Bilan : Passifs de regularisation adj_liability balance + liability Autre : Cloture @@ -40,103 +45,123 @@ PP : Amortissement depreciation none + expense PP : Resultat financier financial_result none + income Bilan : Immobilisations financieres financial_asset balance + asset Bilan : Immo corporelles immobilieres building_asset balance + asset Bilan : Actifs hors exploitation non_ope_asset balance + asset PP : Autres charges d'exploitation other_ope_expense none + expense Bilan : Dettes hors exploitation non_ope_debts balance + liability Bilan : Immo corporelles mobilieres fixed_asset balance + asset Bilan : Immo incorporelles intangible_asset balance + asset Bilan : Stocks inventory balance + asset Bilan : Dettes à LT lt_liability balance + liability PP : Resultat activites annexes non_oper_result none + income Bilan : Autres creanciers à CT other_payable balance + liability Bilan : Autres créances other_receivable balance + asset PP : Charge de personnel personnal_exp none + expense Bilan : Provisions et reserves provision_reserve balance + liability PP : Achat de marchandise purchase none + expense Bilan : Resultat reporte report_result balance + liability Bilan : Debiteurs receivable True unreconciled + asset Bilan : Fournisseurs payable True unreconciled + liability Autre : Consolidation @@ -148,11 +173,6 @@ other none - - Autre : Closed - closed - none - Plan comptable 0 From 3d618f2de49325f7b83c65493f6ae0619d3dc90f Mon Sep 17 00:00:00 2001 From: "nicolas.bessi@camptocamp.com" <> Date: Fri, 28 Jan 2011 09:48:01 +0100 Subject: [PATCH 009/150] [FIX] better coding standard bzr revid: nicolas.bessi@camptocamp.com-20110128084801-a2w9hvy2ipl1wzis --- addons/l10n_ch/account_move_line.py | 2 +- addons/l10n_ch/account_wizard.py | 3 ++- addons/l10n_ch/company.py | 9 ++++----- addons/l10n_ch/invoice.py | 1 - addons/l10n_ch/report/report_webkit_html.py | 19 ++++++++++--------- .../report/report_webkit_html_view.xml | 6 +++--- addons/l10n_ch/wizard/create_dta.py | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/addons/l10n_ch/account_move_line.py b/addons/l10n_ch/account_move_line.py index da9aab741a6..9cf2ea26b6b 100644 --- a/addons/l10n_ch/account_move_line.py +++ b/addons/l10n_ch/account_move_line.py @@ -60,7 +60,7 @@ class AccountMoveLine(osv.osv): _inherit = 'account.move.line' - def line2bank(self, cr, uid, ids, payment_type='manual', context=None): + def __line2bank(self, cr, uid, ids, payment_type='manual', context=None): """add a link to account.move.line in order to link supplier invoice line and bank. The original link was defined in account_payment""" diff --git a/addons/l10n_ch/account_wizard.py b/addons/l10n_ch/account_wizard.py index b2e1ab00924..08c969dd654 100644 --- a/addons/l10n_ch/account_wizard.py +++ b/addons/l10n_ch/account_wizard.py @@ -21,6 +21,7 @@ import tools from osv import osv import addons +import os class WizardMultiChartsAccounts(osv.osv_memory): @@ -35,7 +36,7 @@ class WizardMultiChartsAccounts(osv.osv_memory): def execute(self, cr, uid, ids, context=None): """Override of code in order to be able to link journal with account in XML""" res = super(WizardMultiChartsAccounts, self).execute(cr, uid, ids, context) - path = addons.get_module_resource('l10n_ch/sterchi_chart/account_journal_rel.xml') + path = addons.get_module_resource(os.path.join('l10n_ch','sterchi_chart','account_journal_rel.xml')) tools.convert_xml_import(cr, 'l10n_ch', path, idref=None, mode='init', noupdate=True, report=None) return res diff --git a/addons/l10n_ch/company.py b/addons/l10n_ch/company.py index da8f7b53cc6..20f6b6168ec 100644 --- a/addons/l10n_ch/company.py +++ b/addons/l10n_ch/company.py @@ -27,13 +27,12 @@ class res_company(osv.osv): _inherit = "res.company" _columns = { - ### horiz. delta in mm 1.2 will print the bvz 1.2mm lefter 'bvr_delta_horz': fields.float('BVR Horz. Delta (mm)', - help='horiz. delta in mm 1.2 will print the bvz 1.2mm lefter'), - ### vert. delta in mm 1.2 will print the bvz 1.2mm lefter + help='horiz. delta in mm 1.2 will print the bvr 1.2mm lefter, negative value is possible'), + 'bvr_delta_vert': fields.float('BVR Vert. Delta (mm)', - help='vert. delta in mm 1.2 will print the bvz 1.2mm lefter'), - ### print bvr background image for standard paper or e-mail + help='vert. delta in mm 1.2 will print the bvr 1.2mm lower, negative value is possible'), + 'bvr_background': fields.boolean('Insert BVR background ?'), 'bvr_only': fields.boolean('Separated BVR only ?', diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py index aa59a742722..07c62d43d51 100644 --- a/addons/l10n_ch/invoice.py +++ b/addons/l10n_ch/invoice.py @@ -191,7 +191,6 @@ class account_tax_code(osv.osv): _name = 'account.tax.code' _inherit = "account.tax.code" _columns = { - ### The case code of the tax code 'code': fields.char('Case Code', size=512), } diff --git a/addons/l10n_ch/report/report_webkit_html.py b/addons/l10n_ch/report/report_webkit_html.py index 449bcb15051..5e0a1f22995 100644 --- a/addons/l10n_ch/report/report_webkit_html.py +++ b/addons/l10n_ch/report/report_webkit_html.py @@ -33,6 +33,7 @@ import addons import pooler from tools.config import config from mako.template import Template +from tools.translate import _ class l10n_ch_report_webkit_html(report_sxw.rml_parse): @@ -60,12 +61,12 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): def police_absolute_path(self, inner_path) : """Will get the ocrb police absolute path""" - path = addons.get_module_resource('l10n_ch/report/'+inner_path) + path = addons.get_module_resource(os.path.join('l10n_ch','report',inner_path)) return path def bvr_absolute_path(self) : """Will get the ocrb police absolute path""" - path = addons.get_module_resource('l10n_ch/report/bvr1.jpg') + path = addons.get_module_resource(os.path.join('l10n_ch','report','bvr1.jpg')) return path def headheight(self): @@ -113,18 +114,18 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): ids = [x.id for x in invoices] for invoice in invoice_obj.browse(cursor, self.uid, ids): if not invoice.partner_bank_id: - raise wizard.except_wizard('UserError', - 'No bank specified on invoice:\n' + \ + raise wizard.except_wizard(_('UserError'), + _('No bank specified on invoice:\n' + \ invoice_obj.name_get(cursor, self.uid, [invoice.id], - context={})[0][1]) + context={})[0][1])) if not self._compile_check_bvr.match( invoice.partner_bank_id.bvr_number or ''): - raise wizard.except_wizard('UserError', - "Your bank BVR number should be of the form 0X-XXX-X! " + + raise wizard.except_wizard(_('UserError'), + _("Your bank BVR number should be of the form 0X-XXX-X! " + 'Please check your company ' + 'information for the invoice:\n' + invoice_obj.name_get(cursor, self.uid, [invoice.id], - context={})[0][1]) + context={})[0][1])) if invoice.partner_bank_id.bvr_adherent_num \ and not self._compile_check_bvr_add_num.match( invoice.partner_bank_id.bvr_adherent_num): @@ -198,7 +199,7 @@ class BVRWebKitParser(webkit_report.WebKitParser): #default_filters=['unicode', 'entity'] can be used to set global filter body_mako_tpl = Template(parse_template ,input_encoding='utf-8') #BVR specific - bvr_path = addons.get_module_resource('l10n_ch/report/bvr.mako') + bvr_path = addons.get_module_resource(os.path.join('l10n_ch','report','bvr.mako')) body_bvr_tpl = Template(file(bvr_path).read(), input_encoding='utf-8') helper = report_helper.WebKitHelper(cursor, uid, report_xml.id, context) diff --git a/addons/l10n_ch/report/report_webkit_html_view.xml b/addons/l10n_ch/report/report_webkit_html_view.xml index 8c66b1038c8..c03db709162 100644 --- a/addons/l10n_ch/report/report_webkit_html_view.xml +++ b/addons/l10n_ch/report/report_webkit_html_view.xml @@ -2,8 +2,8 @@ - - + Portrait + A4