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

store = []
for products in self.order_line:
store.append ((0,0, {'name': products.name, 'project_id': project_id,
'sale_order': products.id}))

for l in store:
self.env ['project.task']. create (l)



But i am getting this error: project_id = vals.get ('project_id') or self.env.context.get ('default_project_id')
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 639, in _handle_exception
return super (JsonRequest, self) ._ handle_exception (exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback (None) from new_cause
AttributeError: 'int' object has no attribute 'get'

아바타
취소
베스트 답변

store.append ((0,0, {'name': products.name, 'project_id': project_id,
'sale_order': products.id}))

->store.append ((0,0, {'name': products.name, 'project_id': products.project_id,
'sale_order': products.id}))


아바타
취소
베스트 답변

I don't understand exactly the code that you posted, but I think that it is possible that the vals variable has the id of the project and it is a int variable without get method

아바타
취소
작성자 베스트 답변

How to use get method on int? Just simply tell how to create multiple task in existing project by code. I tried to fetch Id of existing project and then create task in it but I get this attribute error.

아바타
취소
관련 게시물 답글 화면 활동
1
4월 24
3751
2
9월 23
3960
1
6월 23
4063
0
2월 22
2055
1
6월 21
4894