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
لقد تم الإبلاغ عن هذا السؤال
1719
أدوات العرض
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل
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