[FIX] better coding standard

bzr revid: nicolas.bessi@camptocamp.com-20110128084801-a2w9hvy2ipl1wzis
This commit is contained in:
nicolas.bessi@camptocamp.com 2011-01-28 09:48:01 +01:00
parent f68cef0d9a
commit 3d618f2de4
7 changed files with 21 additions and 21 deletions

View File

@ -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"""

View File

@ -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

View File

@ -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 ?',

View File

@ -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),
}

View File

@ -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)

View File

@ -2,8 +2,8 @@
<openerp>
<data>
<record id="ir_header_webkit_bvr_invoice0" model="ir.header_webkit">
<field eval="&quot;&quot;&quot;Portrait&quot;&quot;&quot;" name="orientation"/>
<field eval="&quot;&quot;&quot;A4&quot;&quot;&quot;" name="format"/>
<field name="orientation">Portrait</field>
<field name="format">A4</field>
<field name="html"><![CDATA[<html>
<head>
<script>
@ -144,7 +144,7 @@ width:74%;
.tax {
width:50%;
}]]></field>
<field eval="&quot;&quot;&quot;BVR header&quot;&quot;&quot;" name="name"/>
<field name="name">BVR header</field>
</record>
<report auto="True"

View File

@ -554,7 +554,7 @@ def _create_dta(obj, cr, uid, data, context=None):
dta = dta + record_gt890(v).generate()
dta_data = base64.encodestring(dta)
payment_obj.set_done(cr, uid, data['id'], context)
payment_obj.set_done(cr, uid, [data['id']], context)
attachment_obj.create(cr, uid, {
'name': 'DTA',
'datas': dta_data,