[FIX] sale: Discount on re-invoicable product

Steps to reproduce the bug:

- Let's consider a re-invoicable and expensable product P at 100€
- Let's consider a pricelist PL with 20% of visible discount on every product
- Let's consider a confirmed sale order SO with PL set on it
- Create an expense E with P at 100€ and reinvoice customer set to SO
- Generate the entries of E

Bug:

A new sale order line was created with 80€ as unit price and no discount instead of
20% discount.

opw:2423147

closes odoo/odoo#64194

X-original-commit: 8815f4d9ab8620428d50abbe603c7f6c63076d6c
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
Goffin Simon
2021-01-07 10:24:18 +00:00
parent 1877079c3b
commit e131028dec
+1
View File
@@ -135,6 +135,7 @@ class AccountMoveLine(models.Model):
# create the sale lines in batch
new_sale_lines = self.env['sale.order.line'].create(sale_line_values_to_create)
new_sale_lines._onchange_discount()
# build result map by replacing index with newly created record of sale.order.line
result = {}