Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
1660 Представления

Hello everyone, Iam new in odoo15 and i have problem to find the XPATH to filter with name Direction, i want to add a new filter after the out, but i cant do this, I try to do some examples but, I do not getit


​fleet.vehicle.inspection.search (in fleet_vehicle_inspection)

​fleet.vehicle.inspection


Аватар
Отменить
Лучший ответ

Hi,


If you want to modify the search view and add a new filter after an existing one (like after the "Out" filter), you need to inherit the original search view and use the correct xpath to position your new filter.

Here’s a simple example of how you can do that:

xml


<record id="fleet_vehicle_inspection_search" model="ir.ui.view"> <field name="name">fleet.vehicle.inspection.search.inherit</field> <field name="model">fleet.vehicle.inspection</field> <field name="inherit_id" ref="fleet_vehicle_inspection.fleet_vehicle_inspection_search"/> <field name="arch" type="xml"> <xpath expr="//filter[@name='out']" position="after"> <filter string="Direction" name="direction" domain="[('your_field_name', '=', 'value')]"/> </xpath> </field> </record>

Hope it helps

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
февр. 24
1410
1
янв. 24
2673
4
дек. 23
18035
1
апр. 22
6301
2
мая 24
2558