[FIX] common onchange with voucher

This commit is contained in:
unknown
2013-01-31 13:04:05 +01:00
parent d57d123d74
commit e7550d2226
2 changed files with 6 additions and 4 deletions

View File

@@ -27,7 +27,8 @@
'complexity': 'normal', 'complexity': 'normal',
'depends': [ 'depends': [
'account', 'account',
'report_webkit' 'report_webkit',
'account_voucher'
], ],
'description': """ 'description': """
Improve the basic bank statement, by adding various new features, Improve the basic bank statement, by adding various new features,

View File

@@ -549,7 +549,7 @@ class AccountBankSatementLine(Model):
res['account_id'] = receiv_account res['account_id'] = receiv_account
return res return res
def onchange_partner_id(self, cr, uid, ids, partner_id, profile_id, context=None): def onchange_partner_id(self, cr, uid, ids, partner_id, profile_id=None, context=None):
""" """
Override of the basic method as we need to pass the profile_id in the on_change_type Override of the basic method as we need to pass the profile_id in the on_change_type
call. call.
@@ -569,7 +569,8 @@ class AccountBankSatementLine(Model):
type = 'customer' type = 'customer'
res_type = self.onchange_type(cr, uid, ids, partner_id, type, profile_id, context=context) # Chg res_type = self.onchange_type(cr, uid, ids, partner_id, type, profile_id, context=context) # Chg
if res_type['value'] and res_type['value'].get('account_id', False): if res_type['value'] and res_type['value'].get('account_id', False):
return {'value': {'type': type, 'account_id': res_type['value']['account_id']}} return {'value': {'type': type, 'account_id': res_type['value']['account_id'],
'voucher_id': False}}
return {'value': {'type': type}} return {'value': {'type': type}}
def onchange_type(self, cr, uid, line_id, partner_id, type, profile_id, context=None): def onchange_type(self, cr, uid, line_id, partner_id, type, profile_id, context=None):