Hi everybody !
Today I have a new question, I’m trying to do the following query at domain field
SELECT *
FROM model_a
INNER /LEFT/ RIGHT JOIN model_b
ON model_a.field_equivalent = model_b.field_equivalent
What is it the best way to represent that query?
Thanks for your answers !
pokoli
(Sergi Almacellas Abellana)
February 27, 2023, 2:29pm
2
On model_b
you should add the field:
model_a = fields.Many2One('model_a', "Model A",
domain=[('field_equivalent', '=', Eval('field_equivalent')])
Hope it helps.
1 Like
ced
(Cédric Krier)
February 27, 2023, 2:48pm
3
Domain on Many2One are always LEFT JOIN
. RIGHT JOIN
will be impossible for an ORM. For INNER JOIN
it is most of the time the same as LEFT JOIN
depending on the operator.
1 Like