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
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1709
Lượt xem
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký
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