I am trying to filter a relation (one to many list of suppliers from product.supplierinfo) to only show the vendors listed in the current product (product.template). I am not sure how the syntax for this should work. Please help!
Thank you!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I am trying to filter a relation (one to many list of suppliers from product.supplierinfo) to only show the vendors listed in the current product (product.template). I am not sure how the syntax for this should work. Please help!
Thank you!
A compute field of type m2m (res.partner) should be added in the new model, which can be later used in domain. A compute field can be added under Settings >> Technical >> Database Structure >> Fields, accessible when developer mode ON. The code for compute field is as shown below in the screenshot.
> for record in self:
> record['x_vendor_ids'] = record.x_studio_many2one_field_K4KUV.seller_ids.name
x_studio_many2one_field_K4KUV is m2o of product.product.
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
1
Jan 23
|
1592 | ||
Creating and using an app created with Studio.
Diselesaikan
|
|
1
Okt 24
|
1493 | |
|
2
Okt 24
|
2824 | ||
Odoo Studio hide field based on other Field
Diselesaikan
|
|
1
Jul 24
|
2087 | |
|
0
Jun 24
|
1070 |
Qiadjohar,
Thank you so much for your response, let me clarify because I do not think that solution is what I need.
I am working on the form in the product.template and I have this related field named prefered supplier (m2o for "supplier pricelist). I want this prefered supplier list to only show the vendors added in the product.template tab for purchasing, for the current product that I am under, this way I can select one vendor from the list of vendors for this specific product. Right now without domain filtering, I see all supplier pricelists and not the ones specific to the product that I am on.