838
838
class account_bank_statement_line(osv.osv):
839
839
_inherit="account.bank.statement.line"
841
def _get_tax(self, cr, uid, context={}):
842
tax_id = self.pool.get('account.tax').search(cr, uid, [])
848
841
'tax_id': fields.many2one('account.tax', 'Tax'),
849
842
'tax_type': fields.selection([('tax_included','Tax included'),
850
843
('tax_excluded','Tax excluded')],
851
844
'Tax method', required=True,),
854
847
def onchange_account_id(self, cr, uid, ids, account_id, context=None):
857
850
taxes = self.pool.get('account.account').browse(cr, uid, account_id, context=context).tax_ids
858
851
for tax_id in taxes:
862
854
result['tax_id'] = tax
864
856
result['tax_id'] = False
858
return {'value': result}
860
def onchange_type(self, cr, uid, ids, type, context=None):
862
tax_id = self.pool.get('account.tax').search(cr, uid, [])
864
if type == 'general' and tax_id:
865
result['tax_id'] = tax_id[0]
867
result['tax_id'] = False
866
868
return {'value': result}
870
871
'tax_type':lambda *a :'tax_included',
872
873
account_bank_statement_line()