Modifs BVR
bzr revid: pinky-f92eed801b81e8c0e09cf9f182832c6e19f77a5a
This commit is contained in:
parent
236c801441
commit
4bfeef46b5
|
@ -165,7 +165,6 @@
|
|||
<field name="tax_line" nolabel="1" widget="one2many_list" colspan="4"/>
|
||||
</page>
|
||||
<page string="Other Information">
|
||||
<field name="bank_id"/>
|
||||
<field name="reference" select="1"/>
|
||||
<field name="origin"/>
|
||||
<field name="address_contact_id" domain="[('partner_id','=',partner_id)]" colspan="3"/>
|
||||
|
|
|
@ -112,7 +112,6 @@ class account_invoice(osv.osv):
|
|||
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}, relate=True),
|
||||
'partner_bank_id': fields.many2one('res.partner.bank', 'Partner bank'),
|
||||
'bank_id': fields.many2one('res.partner.bank', 'Company bank'),
|
||||
'address_contact_id': fields.many2one('res.partner.address', 'Contact Address', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'address_invoice_id': fields.many2one('res.partner.address', 'Invoice Address', readonly=True, required=True, states={'draft':[('readonly',False)]}),
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ class account_invoice_bvr(report_sxw.rml_parse):
|
|||
'mod10r': self._mod10r,
|
||||
'_space': self._space,
|
||||
'_get_ref': self._get_ref,
|
||||
'_bank_get': self._bank_get,
|
||||
})
|
||||
|
||||
def _space(self,nbr, nbrspc=5):
|
||||
|
@ -47,6 +48,9 @@ class account_invoice_bvr(report_sxw.rml_parse):
|
|||
res = res + ' '
|
||||
return res
|
||||
|
||||
def _bank_get(self, bid):
|
||||
return self.pool.get("res.partner.bank").browse(cr,uid,bid)
|
||||
|
||||
def _get_ref(self, o):
|
||||
res = ''
|
||||
if o.bank_id.bank_code:
|
||||
|
|
|
@ -157,7 +157,7 @@
|
|||
-->
|
||||
|
||||
<setFont name="ocrb" size="11.5"/>
|
||||
<drawString x="66.72mm" y="16.20mm">01[[mod10r('%.2f' % o.amount_total).rjust(11,'0')]]>[[ _get_ref(o) ]]+ [[o.bank_id.bvr_number.split('-')[0]+(o.bank_id.bvr_number.split('-')[1]).rjust(6,'0')+o.bank_id.bvr_number.split('-')[2] ]]></drawString>
|
||||
<drawString x="66.72mm" y="16.20mm">01[[mod10r('%.2f' % o.amount_total).rjust(11,'0')]]>[[ _get_ref(o) ]]+ [[_bank_get(data['form']['bank']).bvr_number.split('-')[0]+(o.bank_id.bvr_number.split('-')[1]).rjust(6,'0')+o.bank_id.bvr_number.split('-')[2] ]]></drawString>
|
||||
|
||||
</illustration>
|
||||
<frameEnd/>
|
||||
|
|
|
@ -29,6 +29,33 @@ import wizard
|
|||
import pooler
|
||||
import re
|
||||
|
||||
def _bank_get(self, cr, uid, context={}):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
partner_id = pool.get('res.users').browse(cr,uid,[uid])[0].company_id.partner_id
|
||||
obj = pool.get('res.partner.bank')
|
||||
ids = obj.search(cr, uid, [('partner_id','=',partner_id.id)])
|
||||
res = obj.read(cr, uid, ids, ['active', 'name'], context)
|
||||
res = [(r['id'], r['name']) for r in res]
|
||||
return res
|
||||
|
||||
check_form = """<?xml version="1.0"?>
|
||||
<form string="BVR Print">
|
||||
<separator colspan="4" string="BVR Infos" />
|
||||
<field name="bank"/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
check_fields = {
|
||||
'bank' : {
|
||||
'string':'Bank Account',
|
||||
'type':'selection',
|
||||
'selection':_bank_get,
|
||||
'required': True,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
def _check(self, cr, uid, data, context):
|
||||
for invoice in pooler.get_pool(cr.dbname).get('account.invoice').browse(cr, uid, data['ids'], context):
|
||||
if not invoice.bank_id:
|
||||
|
@ -41,7 +68,16 @@ def _check(self, cr, uid, data, context):
|
|||
|
||||
class wizard_report(wizard.interface):
|
||||
states = {
|
||||
'init': {
|
||||
'init':{
|
||||
'actions' : [],
|
||||
'result' : {
|
||||
'type' : 'form',
|
||||
'arch' : check_form,
|
||||
'fields' : check_fields,
|
||||
'state' : [('end', 'Cancel'),('bvr_print', 'Print') ]
|
||||
}
|
||||
},
|
||||
'bvr_print': {
|
||||
'actions': [_check],
|
||||
'result': {'type':'print', 'report':'l10n_ch.bvr', 'state':'end'}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue