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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
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