Skip to content
Snippets Groups Projects
Commit 6e7f778e authored by niyasraphy's avatar niyasraphy
Browse files

[FIX] purchase_requisition: wrong seller in context to get supplier info


the context passed to the method _get_product_purchase_description for the seller_id is wrong. system is expecting to get product.supplierinfo record set in this context key and from this function res.partner record set is passed, which results in the below error:

Record does not exist or has been deleted.
(Record: product.supplierinfo(70,), User: 2)

closes odoo/odoo#105012

Signed-off-by: default avatarTiffany Chang <tic@odoo.com>
parent 811f34bd
Branches
Tags
No related merge requests found
......@@ -255,7 +255,14 @@ class PurchaseOrderLine(models.Model):
if line.product_id == pol.product_id:
pol.price_unit = line.product_uom_id._compute_price(line.price_unit, pol.product_uom)
partner = pol.order_id.partner_id or pol.order_id.requisition_id.vendor_id
product_ctx = {'seller_id': partner.id, 'lang': get_lang(pol.env, partner.lang).code}
params = {'order_id': pol.order_id}
seller = pol.product_id._select_seller(
partner_id=partner,
quantity=self.product_qty,
date=pol.order_id.date_order and pol.order_id.date_order.date(),
uom_id=line.product_uom_id,
params=params)
product_ctx = {'seller_id': seller.id, 'lang': get_lang(pol.env, partner.lang).code}
name = pol._get_product_purchase_description(pol.product_id.with_context(product_ctx))
if line.product_description_variants:
name += '\n' + line.product_description_variants
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment