I actually got the solution, and I'd like to share it as well:
This is the answer I found working after understanding the syntax of the logic needed:
<odoo>
<data>
<!-- Update existing action record -->
<record id="mrp.action_mrp_production_moves" model="ir.actions.act_window">
<field
name="domain">['|',
('move_id.raw_material_production_id', '=',active_id),
'|',
('move_id.production_id', '=', active_id),
'&',
('move_id.raw_material_production_id','=',False),
'&',
('move_id.production_id', '=', False),
('production_id', '=',active_id),
]</field>
</record>
</data>
</odoo>
Here is the explanation of this complex domain syntax:
- Understanding it starts from the end.
-
| and& take only two "terms", not more. So, the "expression" is always an operator that has (precedes) two following "terms". A "term" can be a simple one(,,) or an expression. - For
|A|B&C&DE, it's evaluated as following (from the end): -
&DE: D & E => AsX -
&CX: C & X = C & (D & E) => AsY -
|BY: B | Y = B | (C & (D & E)) => AsZ -
|AZ: A | (B | (C & (D & E)))
-
-
The proper escaping of
& as& ensures the XML is valid.