_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"""
import tools
from osv import osv
import addons
+import os
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
_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 ?',
_name = 'account.tax.code'
_inherit = "account.tax.code"
_columns = {
- ### The case code of the tax code
'code': fields.char('Case Code', size=512),
}
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):
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):
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):
#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)
<openerp>
<data>
<record id="ir_header_webkit_bvr_invoice0" model="ir.header_webkit">
- <field eval=""""Portrait"""" name="orientation"/>
- <field eval=""""A4"""" name="format"/>
+ <field name="orientation">Portrait</field>
+ <field name="format">A4</field>
<field name="html"><![CDATA[<html>
<head>
<script>
.tax {
width:50%;
}]]></field>
- <field eval=""""BVR header"""" name="name"/>
+ <field name="name">BVR header</field>
</record>
<report auto="True"
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,