-
-
Notifications
You must be signed in to change notification settings - Fork 699
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
[16.0][OU-ADD] account: Migration #4070
Conversation
@@ -6,7 +6,7 @@ Module coverage 15.0 -> 16.0 | |||
+-------------------------------------------------+----------------------+-------------------------------------------------+ | |||
| Module | Status + Extra Information | | |||
+=================================================+======================+=================================================+ | |||
| account | | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial everybody :v
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Todo: a dynamic way to fill anaylytic_distribution
on account.move.line
, sale.order.line
for short is any model that inherit from analytic.mixin
/ocabot migration account Depends on : |
@remytms could you take a look here ? |
This PR haven't ready yet , but still me and my friend welcome all reviews from anybody especially on the |
This comment was marked as duplicate.
This comment was marked as duplicate.
@duong77476. No need to write dependencies message. It will be done automatically by this script. (and the list will be updated regularly). #3979 |
Okay, thanks, just a normal habit of me when a PR need to depend on something, cool tool btw keep it up |
thanks ! |
@legalsylvain Do you have tools that allow to rebase automatically, as many PRs are coming , i always have to do it manually :(( |
You can call If you have write access on the branch of the PR, it should work. Can you try ? |
\ocabot
Not working. |
Sorry @duong77476 you are not allowed to rebase. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
@OCA-git-bot rebase |
/ocabot rebase |
Sorry @ngochung207 you are not allowed to rebase. To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons. If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the |
Thanks @chrisandrewmann . But as you can see someone else has attempted and worked. If you could provide a video , show me your odoo conf as well, i might be able to check it out. Otherwise , i really hard for me though |
Apologies @duong77476 my mistake. |
Thank you very much, let's me know if something wrong or need improvement. |
SET journal_id = aml.journal_id | ||
FROM account_move_line aml | ||
WHERE aml.id = aal.move_line_id | ||
""", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got insert or update on table "account_analytic_line" violates foreign key constraint "account_analytic_line_journal_id_fkey"
on this update.
We should probably drop the foreign key constraint before applying this:
ALTER TABLE account_analytic_line DROP CONSTRAINT IF EXISTS account_analytic_line_journal_id_fkey;
Because that constraints from v15 and earlier relates to analytic journals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another issue I've encountered around here is with analytic lines linked to the Timesheets Journal, which prevent the journal_id foreign key to apply. I've set journal_id to NULL on these records as a workaround. Not sure where the best place to do that is.
@@ -0,0 +1,563 @@ | |||
from openupgradelib import openupgrade | |||
|
|||
_xmlids_renames = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ngochung207 Thanks for your work !
I just tested it and found out that this rename is not done (since not called in migrate function below AFAICT).
You may want to add a openupgrade.rename_xmlids(env.cr, _xmlids_renames)
to enforce it !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, i have postpone the work from this PR, you may want to try at https://github.com/Viindoo/OpenUpgrade , my work has finished there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @duong77476 I manage to fully migrate my database using both your repo and PRs from OCA/OpenUpgrade repo. It is however very difficult to track differences since this PR and your repo contain a lot of things which are related to your instances / modules.
Could you please let me know your plans to complete/cleanup this PR ? I can help if needed !
Best Regards
Hi, |
Thanks, you may want to try at https://github.com/Viindoo/OpenUpgrade instead |
I tried them too but still it didn't work as expected. Also did you come across the same error as mine after migration? And do you think is there any other way possibly I could try to fix this issue please. I am in real need of this fix right now. |
@ahshakir no unfortunately, do you have any custom module beside odoo module ? |
Yes I do and I upgraded them too. Though some modules created new fields in account but nothing sort of doing major change in them And all other modules working fine except for account. |
@ahshakir OK now go to debug mode, check the |
I did not see anything strange. but what I would like to add is |
@duong77476 I wish to test your migration script, but I'm block by the migration of "payment". Do you happen to have a branch somewhere with both of these changes ? As recommended, I already tried to upgrade by using https://github.com/Viindoo/OpenUpgrade But it it's failing the same way. |
What is blocking exactly , show me error on your console log if you have any ? i have tried on a production database and it works fine |
Here the relevant part where the migration is failing. But it's not related to "account" migration. It's the "payment" migration that is failing. Thanks for your help. |
Sorry, it is very complex when running migration all the way up from 11 to 16. I have ran it from 10 to 14 already, i must tell you that is not an easy thing to do. You will have to make sure each migration jump (11 -> 12, 12->13, ...) work smootly |
Please , check your odoo 16 CE addons, why the log said |
The module |
I didn't check thoroughly with everything working smoothly while migrating to every version but I do checked if the invoices were visible properly in every migration and they were there. Only in version 16 they weren't visible at all. ALSO compared the columns in version 15 and 16 of table account.move and didn't find anything different between them. Is there anyone here migrated to 16 and came across something similar to what I found?? |
No, i dont think because of the script, here is the config that i have used to run migration script. I use eclipse as an IDE to run this, of course you will need to make sure both odoo 15 and odoo 16 CE has the latest code |
Maybe try |
account: more analysis on xml account.accouunt: Account type in account template and account - account.move: auto_post - account.move.line: Delete sql_contraints, display_type - account.move.line: Dynamic analytic_distribution fill yeahhh - account.journal: Delete sql_contraints - account.payment: Add field amount_company_currency_signed - account.bank.statement: internal_index, first_line_index, is_complete
method -display_type improvement -remove bank statement fastfill -add account_reconcile_model_line analytic_distribution generate -improve analytic_distribution_model generation from analytic default
Thanks to the Viindoo pioneers on this difficult task. I have performed the following changes and push in this PR (as there are permissions to maintainers granted):
I'm merging as soon as this is green, so finally! 🎉 |
At your service sir 🙉 |
- Don't load non useful noupdate_changes - Precompute account.payment~amount_company_currency_signed for the easy case of same currency. - Preserve old account.move~auto_post column. - Adapt account.account~account_type filling SQL and add a fallback. - Fill properly account.account~include_initial_balance. - No need of fast filling account.analytic.line~journal_id. - Adapt account_analytic_distribution_model generation SQL. - Adapt analytic_distribution SQL filling and make it generic. TT42204
Video test localhost:
https://youtu.be/f1vUk11DpiU