Skip to Content
Menu
This question has been flagged
1 Reply
1042 Views

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'

Avatar
Discard
Best Answer

Hello, Mayank Parashar

In your code, if vals result in the dictionary then you can use vals.get('project_id'),
it is an integer value for that giving error.

Hope this may help you!

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Avatar
Discard