Skip to Content
Menu
This question has been flagged
1185 Views

Im using Odoo studio I want to use compute field (widget - integer) to calculate difference between two date field

Avatar
Discard

add the error message and code that you have tried along with question

Author

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

Author
Dear Niyas;


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


On Jul 4, 2021, at 7:50 PM, Niyas Raphy <niyasraphyk@gmail.com> wrote:



add the error message and code that you have tried along with question

Sent by Odoo S.A. using Odoo.