|
@ -3,6 +3,8 @@ |
|
|
# Raphaël Reverdy <raphael.reverdy@akretion.com> |
|
|
# Raphaël Reverdy <raphael.reverdy@akretion.com> |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
|
|
|
|
|
|
|
|
import pytz |
|
|
|
|
|
|
|
|
from odoo import api, fields, models |
|
|
from odoo import api, fields, models |
|
|
from odoo.exceptions import UserError |
|
|
from odoo.exceptions import UserError |
|
|
from odoo.tools.translate import _ |
|
|
from odoo.tools.translate import _ |
|
@ -74,7 +76,11 @@ class Base(models.AbstractModel): |
|
|
elif field_type == "date": |
|
|
elif field_type == "date": |
|
|
value = fields.Date.to_date(value).isoformat() |
|
|
value = fields.Date.to_date(value).isoformat() |
|
|
elif field_type == "datetime": |
|
|
elif field_type == "datetime": |
|
|
value = fields.Datetime.to_datetime(value).isoformat() |
|
|
|
|
|
|
|
|
value = ( |
|
|
|
|
|
fields.Datetime.to_datetime(value) |
|
|
|
|
|
.replace(tzinfo=pytz.utc) |
|
|
|
|
|
.isoformat() |
|
|
|
|
|
) |
|
|
res[json_key] = value |
|
|
res[json_key] = value |
|
|
result.append(res) |
|
|
result.append(res) |
|
|
return result |
|
|
return result |