Skip to Content
Menu
This question has been flagged
3 Replies
3183 Views

I want to filter for parent_id only categories that are in the same configurator. I've tried filter

domain="[('configurator_id', '=', id)]" for the ID takes the categories ID. If I give for the right argument "configurator_id" or "configurator_id.id" it just raises error.

How can I create this filter?

<record id="tabla_configurator_form_view" model="ir.ui.view">
	<field name="name">Tabla Configurator Form View</field>
	<field name="model">tabla.configurator</field>
	<field name="arch" type="xml">
		<form>
			<sheet>
				<group string="Configurator" colspan="4">
					<field name="id" readonly="1"/>
					<field name="name" required="1"/>
					<field name="active"/>
				</group>
				<group string="Categories" colspan="4">
					<field name="category_ids" nolabel="1">
						<tree editable="bottom">
							<field name="name"/>
							<field name="configurator_id" invisible="1"/>
							<field name="parent_id" domain="[('configurator_id', '=', parent.id)]"/>
						</tree>
					</field>
				</group>
			</sheet>
		</form>
	</field>
</record>

Avatar
Discard
Author

As usual your blog is no help at all! The method that creates the domain filter gets only executed when I'm on the views of the model and even then it doesn't work! I need a filter that works when you're on the parent model view!

Author Best Answer

The domain that worked was:

<field name="parent_id" domain="[('configurator_id', '=', configurator_id)]"/>

Looks like pycharm didn't save it when I updated the module, when I tried it the first time.

Avatar
Discard
Related Posts Replies Views Activity
3
Jan 23
4895
2
Jan 23
951
1
Jan 20
9277
2
Nov 22
3887
0
Aug 22
970