Skip to Content
Menu
This question has been flagged
1527 Views

Hi All,

I have added two fields through xpath in my custom module project.task in that Timesheet tab.The values are not updating in Timesheet line when i add these two fields in line item of timesheet tab.If i remove these two fields from xpath then the timesheet line items are getting updated.

class project_task(models.Model):
    _inherit = 'project.task'
    timesheet_ids = fields.One2many('account.analytic.line','timesheet', string='Timesheet')
class account_analytic_line_inherit(models.Model):
    _inherit = 'account.analytic.line'
   
timesheet=fields.Many2one('project.task' )   
job_selections = fields.Boolean(string="Job Start" )   
job_stop = fields.Boolean(string="Job Stop" )  

.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>    <data>       
<record model="ir.ui.view" id="view_task_form2_wms_inherited">           
<field name="name">wms.project.task.form.inherited</field>           
<field name="model">project.task</field>           
<field name="inherit_id" ref="project.view_task_form2" />           
<field name="arch" type="xml">               
    <xpath expr="//field[@name='timesheet_ids']/tree/field[1]" position="after">                        
        <field name="job_selections"/>                     
        <field name="job_stop"/>                                 
    </xpath>           
</field>       
</record>   
</data>
</openerp>
 

Expecting Suggestions..

Avatar
Discard