I'm trying to add a column (field) to heavy nested tree.
I need to position (after, before, inside, replace) the field, but I am not able to this.
I get various errors in different cases:
When trying
<field name="x" position="after" />
<field name="new_field"/>
I get the error that 'x' is a duplicate.
The other error tells me that XML is incorrect (while it isn't).
How is this posisble?
I will show what I want to get accomplished. First the View Architecture as is and then the View Architecture as needed. I'm concerned about a 'fdate' field. (<field name="fdate"/>)
<?xml version="1.0"?>
<form string="Timesheet">
<field name="name"/>
<field name="user_id"/>
<field name="date_from"/>
<field name="date_to"/>
<notebook colspan="4">
<page string="Daily View">
<group col="6" colspan="4">
<button name="button_dummy" string="Go to:" type="object"/>
<field name="date_current" nolabel="1"/>
<label string=""/>
<button icon="gtk-media-previous" name="date_previous" string="" type="object"/>
<button name="date_today" string="Today" type="object"/>
<button icon="gtk-media-next" name="date_next" string="" type="object"/>
</group>
<field colspan="3" context="name=date_current,user_id=user_id" groups="hr_attendance.group_hr_attendance" height="100" name="attendances_ids" nolabel="1">
<tree string="Attendances">
<field name="name"/>
<field name="action"/>
<field invisible="1" name="employee_id"/>
</tree>
</field>
<group col="1" colspan="1" groups="hr_attendance.group_hr_attendance">
<button name="sign_in" string="Sign In" type="object"/>
<button name="sign_out" string="Sign Out" type="object"/>
</group>
<field groups="hr_attendance.group_hr_attendance" name="state_attendance"/>
<field groups="hr_attendance.group_hr_attendance" name="total_attendance_day" widget="float_time"/>
<field colspan="4" context="date=date_current,user_id=user_id" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet">
<field invisible="1" name="date"/>
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
<field name="to_invoice"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
<field name="amount"/>
<field name="general_account_id"/>
<field invisible="1" name="user_id" required="1"/>
</tree>
<form string="Timesheet">
<field name="date"/>
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
<field name="to_invoice"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
<field name="amount"/>
<field name="general_account_id"/>
<field name="user_id" required="1"/>
</form>
</field>
<field name="total_difference_day" widget="float_time"/>
<field name="total_timesheet_day" widget="float_time"/>
</page>
<page string="By Day">
<field colspan="4" name="period_ids" nolabel="1">
<tree colors="red:total_difference<=0.1;blue:total_difference>=0.1" string="Period">
<field name="name"/>
<field groups="hr_attendance.group_hr_attendance" name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field groups="hr_attendance.group_hr_attendance" name="total_difference" widget="float_time"/>
</tree>
</field>
<field name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
</page>
</notebook>
<field name="state"/>
<group col="4" colspan="2">
<button name="button_confirm" states="draft" string="Confirm" type="object"/>
<button name="action_set_to_draft" states="done" string="Set to Draft" type="object"/>
<button name="cancel" states="confirm" string="Refuse"/>
<button name="done" states="confirm" string="Accept"/>
</group>
</form>
============needed:
<?xml version="1.0"?>
<form string="Timesheet">
<field name="name"/>
<field name="user_id"/>
<field name="date_from"/>
<field name="date_to"/>
<notebook colspan="4">
<page string="Daily View">
<group col="6" colspan="4">
<button name="button_dummy" string="Go to:" type="object"/>
<field name="date_current" nolabel="1"/>
<label string=""/>
<button icon="gtk-media-previous" name="date_previous" string="" type="object"/>
<button name="date_today" string="Today" type="object"/>
<button icon="gtk-media-next" name="date_next" string="" type="object"/>
</group>
<field colspan="3" context="name=date_current,user_id=user_id" groups="hr_attendance.group_hr_attendance" height="100" name="attendances_ids" nolabel="1">
<tree string="Attendances">
<field name="name"/>
<field name="action"/>
<field invisible="1" name="employee_id"/>
</tree>
</field>
<group col="1" colspan="1" groups="hr_attendance.group_hr_attendance">
<button name="sign_in" string="Sign In" type="object"/>
<button name="sign_out" string="Sign Out" type="object"/>
</group>
<field groups="hr_attendance.group_hr_attendance" name="state_attendance"/>
<field groups="hr_attendance.group_hr_attendance" name="total_attendance_day" widget="float_time"/>
<field colspan="4" context="date=date_current,user_id=user_id" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet">
<field invisible="1" name="date"/>
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
<field name="name"/>
<field name="fdate"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
<field name="to_invoice"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
<field name="amount"/>
<field name="general_account_id"/>
<field invisible="1" name="user_id" required="1"/>
</tree>
<form string="Timesheet">
<field name="date"/>
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
<field name="to_invoice"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
<field name="amount"/>
<field name="general_account_id"/>
<field name="user_id" required="1"/>
</form>
</field>
<field name="total_difference_day" widget="float_time"/>
<field name="total_timesheet_day" widget="float_time"/>
</page>
<page string="By Day">
<field colspan="4" name="period_ids" nolabel="1">
<tree colors="red:total_difference<=0.1;blue:total_difference>=0.1" string="Period">
<field name="name"/>
<field groups="hr_attendance.group_hr_attendance" name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field groups="hr_attendance.group_hr_attendance" name="total_difference" widget="float_time"/>
</tree>
</field>
<field name="total_attendance" widget="float_time"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
</page>
</notebook>
<field name="state"/>
<group col="4" colspan="2">
<button name="button_confirm" states="draft" string="Confirm" type="object"/>
<button name="action_set_to_draft" states="done" string="Set to Draft" type="object"/>
<button name="cancel" states="confirm" string="Refuse"/>
<button name="done" states="confirm" string="Accept"/>
</group>
</form>