Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Create relationship with Underlying Many to Many table in another relationship

By
Cade
on 7/12/16, 4:23 PM 115 views

I have created a model which allows be to create a group of Products under a Product for the purposes of identifying potential Alternative Parts

So For example I have the following Parts in my inventory

Part A
Part A1
Part A2
Part A3
Part B
Part B1
Part B2
Part B3
Part C
Part C1
Part C2
Part C3

Under the Product.template I have a Many2Many field that links to a Model so I can list "Potential Alternative Parts".


So under "Part A" I have "Part A1", "Part A2", "Part A3" listed as "Potential Alternative Parts"

Under "Part B" I have "Part B1", "Part B2", "Part B3" listed as "Potential Alternative Parts"

and under "Part C" I have "Part C1", "Part C2", "Part C3" listed as "Potential Alternative Parts".


What I am trying to do now, is under the BoM Line model add a field of "Approved Alternative Parts"


So basically if I add "Part A" as a line item, I should be able to select from "Part A1", "Part A2" or "Part A3" as "Approved Alternatives"

Business Reason is under the product would be our way of determining what WE will are equivalent parts.  But under the BoM would be where the alternative parts would be approved or not for that particular assembly.


Problem I am having is I cannot figure out how to create a relationship with the generated "x_product_template_product_template_rel" table so that I can select from its records in my Many2Many relationship I created on the BoM line

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/12/16, 4:23 PM
Seen: 115 times
Last updated: 7/12/16, 6:42 PM