+1 vote
47 views

I want to add on the sale orders a new field for customer product reference.

So I created a one2many field (customer_product_reference_ids) in product.product related to a custom model customer_product_reference.

Fields in customer_product_reference are : nameproduct_id, a many2one field related to product.product; and customer_id, a many2one field related to res.partner

Now, I created a new field for sale.order.line in order to get the customer product reference based on the customer for the sale order and the product added to the sale order line.

This field is a many2one field, customer_reference_id. I tried to use context to get the customer product reference but it is not working. Here is the context: "{'customer_id': order_partner_id,'product_id': product_id}".

customer_reference_id stays empty. What is wrong with the context?

in Back-end by (10.2k points) | 47 views

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
192 questions
163 answers
32 comments
39,435 users