[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#105998 X-original-commit: 6e7f778e1d0dbe4795fa9446bfd3542ecec9815c Signed-off-by: Tiffany Chang <tic@odoo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user