From af9cdeae15d859243cf412519d36ca59b7f85ba4 Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Thu, 12 Aug 2021 14:06:17 +0000 Subject: [PATCH] [FIX] purchase_stock: add the partner_id to the price difference lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Create a storable product, e.g:”Product A”, with a AVCO + Automated category - Make sure to assign an account in the price difference account field - Create an RFQ with the “Product A” - Confirm RFQ and receive the product - Create the vendor bill and edit to change the unit cost from 55 to 56 - Post the bill - Check journal items Problem: Price difference accounts have no partner_id opw-2616388 closes odoo/odoo#75085 X-original-commit: 75b45e736bde32e264e7e660b4626142d8f05df2 Signed-off-by: Arnold Moyaux --- addons/purchase_stock/models/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/purchase_stock/models/account_invoice.py b/addons/purchase_stock/models/account_invoice.py index e2454486a18..7f3fab2b3aa 100644 --- a/addons/purchase_stock/models/account_invoice.py +++ b/addons/purchase_stock/models/account_invoice.py @@ -153,6 +153,7 @@ class AccountMove(models.Model): 'analytic_tag_ids': [(6, 0, line.analytic_tag_ids.ids)], 'exclude_from_invoice_tab': True, 'is_anglo_saxon_line': True, + 'partner_id': line.partner_id.id, } vals.update(line._get_fields_onchange_subtotal(price_subtotal=vals['price_subtotal'])) lines_vals_list.append(vals) @@ -172,6 +173,7 @@ class AccountMove(models.Model): 'analytic_tag_ids': [(6, 0, line.analytic_tag_ids.ids)], 'exclude_from_invoice_tab': True, 'is_anglo_saxon_line': True, + 'partner_id': line.partner_id.id, } vals.update(line._get_fields_onchange_subtotal(price_subtotal=vals['price_subtotal'])) lines_vals_list.append(vals)