Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Many2one references from former module to new core #309

Open
rousseldenis opened this issue Oct 28, 2022 · 7 comments
Open

Move Many2one references from former module to new core #309

rousseldenis opened this issue Oct 28, 2022 · 7 comments

Comments

@rousseldenis
Copy link
Contributor

Case:

  • A model (A) is defined in a custom module

  • Some models have Many2one references to that model A.

  • I want to move records of model A to new model in core Odoo (some INSERTs)

  • Move the Many2one references to point to the new inserted records (different ids).

I could not find a helper here to do such things. Do you have an idea ?

@StefanRijnhart @hbrunn @pedrobaeza

@rousseldenis
Copy link
Contributor Author

@pedrobaeza
Copy link
Member

There's no such helper, as this is not a usual case AFAIK, and may be handled different depending on the feature. It's weird that you can simply replace one by the other. I don't have any case in mind like this in OpenUpgrade core addons.

@rousseldenis
Copy link
Contributor Author

There's no such helper, as this is not a usual case AFAIK, and may be handled different depending on the feature. It's weird that you can simply replace one by the other. I don't have any case in mind like this in OpenUpgrade core addons.

That's because Odoo is improving based on OCA work 😄

@pedrobaeza
Copy link
Member

Hehe. But we do a model and table renaming (and possibly field renaming) instead of insert queries, so no different IDs.

@rousseldenis
Copy link
Contributor Author

Hehe. But we do a model and table renaming (and possibly field renaming) instead of insert queries, so no different IDs.

That's not so trivial as records may exists in base module

@pedrobaeza
Copy link
Member

Yeah, I remember such case with issues converted to tasks in v11 and we handle them manually. I think it's difficult to get to something reusable in a function, but if you want to try....

@rousseldenis
Copy link
Contributor Author

Yeah, I remember such case with issues converted to tasks in v11 and we handle them manually. I think it's difficult to get to something reusable in a function, but if you want to try....

I will for sure as soon I get complete solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants