Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
4571 Widoki

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>

Awatar
Odrzuć
Autor

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!

Autor Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
sty 23
6529
2
sty 23
951
1
sty 20
11000
3
sie 25
2589
2
lis 22
5155