Im using Odoo studio I want to use compute field (widget - integer) to calculate difference between two date field
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1185
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
add the error message and code that you have tried along with question
This is the error I got
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/src/odoo/14.0/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: forbidden opcode(s) in 'for record in self:\n from datetime import datetime\n def difference_date(self):\n d1 = datetime.strptime(x_studio_start_date, "%m/%d/%Y")\n d2 = datetime.strptime(x_studio_end_date, "%m/%d/%Y")\n delta = d2 - d1\n record[\'x_studio_number_of_days\'] = delt.days\n': IMPORT_NAME, IMPORT_FROM
This is the error I got:
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/src/odoo/14.0/odoo/http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: forbidden opcode(s) in 'for record in self:\n from datetime import datetime\n def difference_date(self):\n d1 = datetime.strptime(x_studio_start_date, "%m/%d/%Y")\n d2 = datetime.strptime(x_studio_end_date, "%m/%d/%Y")\n delta = d2 - d1\n record[\'x_studio_number_of_days\'] = delt.days\n': IMPORT_NAME, IMPORT_FROM