Traceback generated when trying to pass a datetime object into a function tag in xml. <function name="action_name" model="model_name" eval="datetime.date.today"/> Used to fail. With this commit now one can pass time, datetime, timedelta, relativedelta, version, ref, pytz in function tag in xml Task-id: 1772614 Closes odoo/odoo#29212 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com> Co-authored-by: Dhaval Limbuwala <dli@odoo.com>
17 lines
339 B
Python
17 lines
339 B
Python
from odoo import api, models
|
|
|
|
class TestModel(models.Model):
|
|
_name = 'test_convert.test_model'
|
|
|
|
@api.model
|
|
def action_test_date(self, today_date):
|
|
return True
|
|
|
|
@api.model
|
|
def action_test_time(self, cur_time):
|
|
return True
|
|
|
|
@api.model
|
|
def action_test_timezone(self, timezone):
|
|
return True
|