[FIX] account: do not restrict tax move lines creation from account_move_line.create()
This commit is contained in:
parent
371e96767d
commit
239e1618f2
|
@ -1341,8 +1341,6 @@ class account_move_line(osv.osv):
|
||||||
tax_sign = 'ref_tax_sign'
|
tax_sign = 'ref_tax_sign'
|
||||||
base_adjusted = False
|
base_adjusted = False
|
||||||
for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00, force_excluded=False).get('taxes'):
|
for tax in tax_obj.compute_all(cr, uid, [tax_id], total, 1.00, force_excluded=False).get('taxes'):
|
||||||
if bool(tax[base_code]) != bool(tax[tax_code]):
|
|
||||||
raise osv.except_osv(_('Tax misconfiguration !'), _('You cannot apply a tax which doesn\'t have a base code and a tax code. Please fix the configuration of tax %s.') % tax['name'])
|
|
||||||
#create the base movement
|
#create the base movement
|
||||||
if base_adjusted == False:
|
if base_adjusted == False:
|
||||||
base_adjusted = True
|
base_adjusted = True
|
||||||
|
|
|
@ -1237,6 +1237,11 @@ class account_voucher(osv.osv):
|
||||||
'account_tax_id': voucher.tax_id.id,
|
'account_tax_id': voucher.tax_id.id,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if move_line.get('account_tax_id', False):
|
||||||
|
tax_data = tax_obj.browse(cr, uid, [move_line['account_tax_id']], context=context)[0]
|
||||||
|
if not (tax_data.base_code_id and tax_data.tax_code_id):
|
||||||
|
raise osv.except_osv(_('No Account Base Code and Account Tax Code!'),_("You have to configure account base code and account tax code on the '%s' tax!") % (tax_data.name))
|
||||||
|
|
||||||
# compute the amount in foreign currency
|
# compute the amount in foreign currency
|
||||||
foreign_currency_diff = 0.0
|
foreign_currency_diff = 0.0
|
||||||
amount_currency = False
|
amount_currency = False
|
||||||
|
|
Loading…
Reference in New Issue