Closed bhuisgen closed 2 years ago
I did a small fix into the function convertFromStaticToDynamicValue
in conversion.go
:
func convertFromStaticToDynamicValue(staticValue interface{}) interface{} {
switch sv := staticValue.(type) {
case *Time:
// v = sv.v
v = sv.v.String()
Updates are working now. Maybe a PR in few days :)
Hey @bhuisgen :wave: Thank you for the catch and nice debugging ! If the fix works well for you, that's fine ! But I think the fundamental issue is about a lack of decoupling between the different "time" odoo types: datetime and date, we probably need two different types with their own encoding/decoding logic, I still need to go deeper to be sure, feel free to give your opinion. I'll keep you in touch !
resolved in https://github.com/skilld-labs/go-odoo/commit/96d00b8e69e0e66cfc9dabb77167ca67a13d990f !
As I can see, odoo can receive request with the same format for both date and datetime types. However, those two types are different and not stored the same way in the database, we should handle that correctly.
I planned to work on a future release with:
thanks again for the report, feel free to give your opinion / needs / wishes for this library to improve :D
I have generated my models for odoo v15. Create and read operations are OK, but there is a problem with update operation about datetime fields:
Any suggestion about this ?