Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
6752 Visualizzazioni

<?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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
5
gen 19
4922
1
mar 17
6091
3
giu 16
9152
1
mar 16
22228
3
mag 24
15097