From 990a299b3ac69751054c2b17baa0aebd95c404c0 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 17 Jan 2020 08:46:15 +0000 Subject: [PATCH] [FIX] account: purchase receipt with included tax - Create a 10 % purchase tax with price included - Create a Purchase Receipt with a price unit of 100 and the 10 % tax The total is 90.91 + 8.26 = 99.17. The root cause of the issue is that... actually I have no idea. For some mysterious reasons, in case of an `in_invoice`, `in_refund` and `in_receipt`, we go through `_compute_base_line_taxes` when the price is changed. In case of the `in_receipt`, we compute the tax based on the `balance` (= 90.91) rather than the price unit, which screws things up. Note that in case of `out_*` moves, we simply don't go through `_compute_base_line_taxes` at all, so Sales Receipts are fine. opw-2170975 closes odoo/odoo#43475 X-original-commit: 1bbf66937c2b4fdb45318652e3ed1147f1edd29b Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 752f358b104..48cd247f8bb 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -453,7 +453,7 @@ class AccountMove(models.Model): ''' move = base_line.move_id - if move.is_invoice(): + if move.is_invoice(include_receipts=True): sign = -1 if move.is_inbound() else 1 quantity = base_line.quantity if base_line.currency_id: