1

we are migrating our odoo v13 App to odoo v15. We have a model that is using delegation inheritance to extend a res.partner (_inherits = {"res.partner": "partner_id"}). In res.partner we have an action (act_window) to create a new instance of our model based on the actual res.partner. We are redirecting to a form of our model with context "'default_partner_id': active_id". In the redirected form the fields of the contact (name, email) are prefilled correctly with the data of the contact but the field "partner_id" is empty. When we save the new instance of our model odoo creates also a new res.partner with the same data as the source res.partner.

I don't know what we are doing wrong so I've created a simple view and action with res.users so that anybody can reproduce the issue. I've created an issue on github so that anybody can reproduce it:

https://github.com/odoo/odoo/issues/81508

I've also created a ticket over the odoo support but the answer was:

"... customisation even via a view and XML code is still customisation; this is not covered by traditional Odoo support. (see: https://www.odoo.com/documentation/15.0/services/support/what_can_i_expect.html)"

Does anybody can help us? I don't know if whe are doing something wrong or if odoo isn't working correctly. I think it is odoo but I can't create a szenario without customizings.

Jacob
  • 11
  • 4
  • It shouldn't be done, but have you tried to override `create()` on your model and filling `partner_id` into `vals` right before making the super call? I don't like that solution at all, but maybe that is a workaround for now. – CZoellner Feb 21 '22 at 14:29
  • 1
    Thanks for the idea. I've now implemented a workaround: @api.model def create(self, vals): if not vals.get("partner_id"): vals["partner_id"] = self._context.get("default_partner_id") – Jacob Feb 23 '22 at 07:56

0 Answers0