<group>
<field name="id" invisible="1"/>
<field name="q_versions" widget="selection" on_change="onchange_version(id)" domain="[('sale_id', '=', id)]"/>
</group>
<group>
<button name="add_version" string="add version" type="object" class="oe_edit_only" />
there is a error, that id is not defined. how can i use dynamic domain
I am also facing the same problem...
Note:
we can define domain="[('sale_id', '=', id)]" only in py file
when widget="selection" is used in xml, the domain provided in python file gets overridden