Closed Stolexiy closed 4 months ago
Hello @Stolexiy, thank you for this pull request :-)
As I see, the field has been tagged as many2One
but it's not as it's somehow a many2one_reference
. (see https://github.com/skilld-labs/go-odoo/blob/master/generator/cmd/model.go#L17).
I was thinking maybe it would make sense to have a new type Many2OneReference in this library but look like I decided to manage it as a Many2One, so let's keep it like this for now.
So, it make sense to me to merge it! LGTM
Hello,
This pull request fixes a panic error that occurs when attempting to get an entity with a field of type "many2one_reference" in a model. The "many2one_reference" field typically represents a relationship between the current model and another model in the Odoo database.
The error occurs because the conversion logic expects a slice of interfaces ([]interface{}), but in this case, it's receiving an integer (int64) instead. This fix ensures the conversion handles both scenarios correctly.