콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2397 화면

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]]

관련 게시물 답글 화면 활동
naked domain set up 해결 완료
3
7월 25
4412
0
5월 25
925
2
3월 24
2171
0
1월 23
1760
1
11월 22
3225