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

Hi,


I'm new to Odoo development and am trying to setup Odoo Project. In my process, I need to connect a task's kanban_state from project A to the kanban_state of another task in project B. The change is also stage dependent.

The logic goes like this: When task a in project A is on stage 3, I want task b in Project B on stage 4 to turn green. 

The two tasks originate from the sale order and I have created a field called x_studio_sales_order, that shows the sales Order number in both tasks.

I wrote a python script, but nothing is happening. Can you help me with this code?

Thanks a lot in advance!!


if True:
# Retrieve SO-ID
​ori_so_id = record['x_studio_sales_order']

# All Tasks search
​all_tasks = env['project.task'].search([('project.id.name', '=', 'B')])

# Filter S0-ID-Tasks:
​tasks_from_sales = all_tasks.filtered(lambda so: so.x_studio_sales_order == ori_so_id)

# Apply on Stage:
​if tasks_from_sales:
​​stage_id = record['stage_id.sequence']
if stage_id == 4:
​​record['kanban_state'] = 'done'
else:
​​​record['kanban_state'] = 'blocked'




아바타
취소
관련 게시물 답글 화면 활동
1
6월 23
2805
1
5월 25
824
0
4월 25
763
2
4월 24
2388
2
12월 23
2679