[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) <nim@odoo.com>
This commit is contained in:
Nicolas Martinelli
2020-01-17 11:58:45 +00:00
parent a1c175bae7
commit 990a299b3a
+1 -1
View File
@@ -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: