Skip to content

Commit

Permalink
[FIX][l10n_it_withholding_tax] coeff computation (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoRubi authored and eLBati committed Aug 22, 2018
1 parent c670d0a commit c8a2a3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion l10n_it_withholding_tax/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
'name': 'Italian Withholding Tax',
'version': '10.0.1.2.2',
'version': '10.0.1.2.3',
'category': 'Account',
'author': 'Openforce, Odoo Italia Network, '
'Odoo Community Association (OCA)',
Expand Down
8 changes: 4 additions & 4 deletions l10n_it_withholding_tax/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,14 @@ def _prepare_price_unit(self, line):
(1 - (line.discount or 0.0) / 100.0)
return price_unit

@api.depends('base', 'tax')
@api.depends('base', 'tax', 'invoice_id.amount_untaxed')
def _compute_coeff(self):
for inv_wt in self:
if inv_wt.invoice_id.amount_untaxed:
inv_wt.base_coeff = round(
inv_wt.base / inv_wt.invoice_id.amount_untaxed, 5)
inv_wt.base_coeff = \
inv_wt.base / inv_wt.invoice_id.amount_untaxed
if inv_wt.base:
inv_wt.tax_coeff = round(inv_wt.tax / inv_wt.base, 5)
inv_wt.tax_coeff = inv_wt.tax / inv_wt.base

invoice_id = fields.Many2one('account.invoice', string='Invoice',
ondelete="cascade")
Expand Down

0 comments on commit c8a2a3f

Please sign in to comment.