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'
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
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.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
เม.ย. 24
|
3764 | ||
|
2
ก.ย. 23
|
3966 | ||
|
1
มิ.ย. 23
|
4079 | ||
|
0
ก.พ. 22
|
2058 | ||
|
1
มิ.ย. 21
|
4898 |