Допомога

3

Is it possible to relate Products and Vendors?

Avatar
Ricardo Gross

Hi,

It is possible that when creating an RFQ and selecting a vendor, the list of products that can be added is limited to products related to that vendor, or if I add first the product I can only choose the vendor(s) related to this product?

Thanks,

Ricardo

1 Коментар
Аватар
Відмінити
Avatar
Chris TRINGHAM
-

Can you use Supplier Price Lists (product.supplierinfo) for the linkage?

4 Відповіді
2
Avatar
Ray Carnes (ray)
Найкраща відповідь

Adding this domain to the product_id field on the Request for Quotation Form View will do that:

 ['|',  ('seller_ids.name', '=', parent.partner_id),
        ('seller_ids.name.child_ids', '=', parent.partner_id),
        ('purchase_ok', '=', True)] 
2 Коментар
Аватар
Відмінити
Avatar
Oscar Beltran
-

Hi Ray, thanks for your great Idea. I try to use your code in V13 last update. It seems that the code is changed a little.

I get this result:

["&","|",["seller_ids.name","=","parent.partner_id"],["seller_ids.name.child_ids","=","parent.partner_id"],["purchase_ok","=",True]]

However, I am doing something wrong, because I do not get any product. Can you please guide. Tks a lot.

Avatar
Ray Carnes (ray)
-

Your domain is wrong. I posted an example tested with v13. You are asking Odoo to show you products where (1) the name of one of the Vendors is the same as the Vendor on the PO "and" (2) the name of one of the child records of the Vendors is the same as the Vendor on the PO "or" (3) the product can be purchased. (1) and (2) cannot be true at the same time.