Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2390 มุมมอง

I have created a new field x_status for task in project.task model in Odoo 13 Saas.
I want to use it to filter the task when entering a new timesheet.
I have added a new inherited view to account.analytic.line.tree.hr_timesheet that goes like :
Original fields: 

<field name="project_id" required="1" class="o_timesheet_tour_project_name" context="{'form_view_ref': 'project.project_project_view_form_simplified',}"/>

<field name="task_id" context="{'default_project_id': project_id}" class="o_timesheet_tour_task_name"/>

inherited view:

    <xpath expr="//field[@name='task_id']" position="attributes">
      <attribute name="domain">[('x_status', '!=', True)]</attribute>
    </xpath>
 

However, the domain is not taken into account when creating a new timesheet: All tasks are displayed irrespectively from the field.

If I create a timesheet and let the task empty before saving, then edit this timesheet, the domain is used and only those with x_status=False are displayed.

What am I doing wrong?

อวตาร
ละทิ้ง

would you like to try this?
<attribute name="domain">[('company_id' ,'=', company_id),('project_id.allow_timesheets','=',True),('project_id','=?', project_id),"|",('x_status', '!=', True)]</attribute>

ผู้เขียน

Got this message :

AssertionError: This domain is syntactically not correct: [['company_id', '=', 1], ['project_id.allow_timesheets', '=', True], ['project_id', '=?', 15], '|', ['x_status', '!=', True]]

Related Posts ตอบกลับ มุมมอง กิจกรรม
naked domain set up แก้ไขแล้ว
3
ก.ค. 25
4410
0
พ.ค. 25
924
2
มี.ค. 24
2170
0
ม.ค. 23
1759
1
พ.ย. 22
3223