From f734b92a701d8631bee799d5e441e150037be03e Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 3 Oct 2017 09:33:47 +0200 Subject: [PATCH] [FIX] account: manually editable tax amounts in supplier bills. People should be able to change manually the tax amounts on vendor bills, since they have to encode exactly what they receive and because the supplier may round differently than Odoo. On the other hand, in vendor bills, it's useless to try to compute a cash rounding impacting the taxes... as they should be now able to manually adapt it. So in vendor bills, the 'amount' field has to be the visible and editable one --- addons/account/models/account_invoice.py | 4 ++-- addons/account/views/account_invoice_view.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 3610dafc605..1fae487036a 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -711,7 +711,7 @@ class AccountInvoice(models.Model): if tax_line.amount_rounding != 0.0: tax_line.amount_rounding = 0.0 - if self.cash_rounding_id: + if self.cash_rounding_id and self.type in ('out_invoice', 'out_refund'): rounding_amount = self.cash_rounding_id.compute_difference(self.currency_id, self.amount_total) if not self.currency_id.is_zero(rounding_amount): if self.cash_rounding_id.strategy == 'biggest_tax': @@ -1692,7 +1692,7 @@ class AccountInvoiceTax(models.Model): account_analytic_id = fields.Many2one('account.analytic.account', string='Analytic account') amount = fields.Monetary() amount_rounding = fields.Monetary() - amount_total = fields.Monetary(compute='_compute_amount_total') + amount_total = fields.Monetary(string="Amount", compute='_compute_amount_total') manual = fields.Boolean(default=True) sequence = fields.Integer(help="Gives the sequence order when displaying a list of invoice tax.") company_id = fields.Many2one('res.company', string='Company', related='account_id.company_id', store=True, readonly=True) diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index 02941c25c56..ad5ccdd84c3 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -294,9 +294,9 @@ - + - +