Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6748 Vistas

<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<record id="hr_timesheet_sheet_tree_leistungserfassung" model="ir.ui.view">

<field name="name">hr.leistungserfassung.tree</field>

<field name="model">hr_timesheet_sheet.sheet</field>

<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_tree_simplified"/>

<field name="arch" type="xml">

<!--<xpath expr="//field[@name='date_to']" position="after">-->

<xpath expr="//form/sheet/group/group/field[@name='date_to']" position="after">

<field name="testfield" widget="float_time" string="testfield"/>

<field name="testfield2" widget="float_time" string="testfield2"/>

</xpath>

</field>

</record>

</data>

</openerp>


what is wrong here? I want to put those 2 fields after the date_to field.

this xpath thing is not working never.

Avatar
Descartar
Mejor respuesta

Hello, 

external ID / XML ID """hr_timesheet_sheet_tree_simplified""" is define tree view inside default Odoo module "hr_timesheet_sheet". And you are trying to search element inside "form" thats why you can not get any result for you xpath.


Please make proper inheritance inside your view and then use proper xpath, it works well. You have to make your view as like below.

<record id="hr_timesheet_sheet_tree_leistungserfassung" model="ir.ui.view">
<field name="name">hr.leistungserfassung.tree</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/group/group/field[@name='date_to']" position="after">
<field name="testfield" widget="float_time" string="testfield"/>
<field name="testfield2" widget="float_time" string="testfield2"/>
</xpath>
</field>
</record>


Above view inheritance is working well. Please try it inside your Odoo.


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
5
ene 19
4913
1
mar 17
6084
3
jun 16
9146
1
mar 16
22228
3
may 24
15096