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

record ID is ignored on bot.create #2

Open
SEP-Lipchanskis opened this issue May 30, 2023 · 1 comment
Open

record ID is ignored on bot.create #2

SEP-Lipchanskis opened this issue May 30, 2023 · 1 comment
Assignees

Comments

@SEP-Lipchanskis
Copy link

In the process of migration there is a lot of references between modules based on record id's, so when migrating a database, the ID should be kept the same. In my case I have to migrate only the active records, so the ID's are not consecutive and didn`t start from 1, and I can't find the way to create records with particular ID's

on bot.update(the_id=634, the_obj={"name": "Jane Doe"}) it throws Record does not exist...
on bot2.create it ignores ID field and creates new records with next consecutive IDs

the only way is to create over 600 records, then update the necessary records, then delete hundreds of unnecessary records.

Is there a better solution?

@cagatayuresin cagatayuresin self-assigned this Aug 29, 2023
@cagatayuresin
Copy link
Owner

First of all, I should say that I don't have good SQL knowledge to give a good answer to your question.

There is something like this in databases. For example, if your last record's ID is 5, if you delete this record and add another record, your new record's ID will be 6. Registration number 5 will not be opened again.

While transferring data between Odoos of the same version is not without major problems, migrations for version upgrade (especially from 15 to 16) cause headaches due to data changes made in many interrelated base tables of Odoo.

However, it is not possible to migrate easily with this wrapper or via XMLRPC. First of all, the base changes need to be well mapped. So, a special script must be created for migration. That's why Odoo Community is releasing Migration Tool a few months after a new version is released.

You can see this discussion from 15 to 16 at the link below.
https://www.odoo.com/en_EN/forum/yardim-1/odoo-15-to-odoo-16-migration-using-openupgrade-213907

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

No branches or pull requests

2 participants