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

[16.0][OU-ADD] sale: migration #4004

Closed
wants to merge 100 commits into from

Conversation

hoangtiendung070797
Copy link
Contributor

Migration module

@legalsylvain
Copy link
Contributor

legalsylvain commented Jul 3, 2023

/ocabot migration sale

Could you take a look on the red CI ?

Depends on :

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Jul 3, 2023
@hoangtiendung070797 hoangtiendung070797 force-pushed the v16_mig_sale branch 3 times, most recently from b1c8341 to 3570e55 Compare July 3, 2023 10:14
Copy link
Contributor

@remytms remytms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this job. Some remarks. I may be wrong on some of them.

@hoangtiendung070797
Copy link
Contributor Author

@remytms Thanks for your help. I will check it again

Copy link
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here are some changes needed to be able to run the migration. i did not look into all changes.

@hoangtiendung070797 hoangtiendung070797 force-pushed the v16_mig_sale branch 2 times, most recently from 37e9a76 to 64c15de Compare July 7, 2023 01:52
Copy link
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this great work! here are some needed changes.

Comment on lines 28 to 29
sale / sale.order.line / analytic_distribution_stored_char (char): NEW isfunction: function, stored
# NOTHINGH TO DO: handle by ORM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a new computed field (analytic_distribution) coming from the analytic.mixin model. its compute function is _compute_analytic_distribution(). a fast precomputation could be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huguesdk analytic_distribution_stored_char fields is not found in source code. Can you show me where it is located?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This the reason why we need the new analysis file because sometime it cause us some confusion
BTW, for the field analytic_distribution_stored_char which is in my lates analysis file it is analytic_distribution, i have created a dynamic method at https://github.com/OCA/OpenUpgrade/pull/4070/files#diff-90f733d1f5eba9ea514de973136064df20f321c35c019951653200d2c0e582d3R501-R515.
Please make a test with this situation then let me know it is working ok then i will decide to have it in the openupgrade_160

openupgrade_scripts/scripts/sale/16.0.1.2/pre-migration.py Outdated Show resolved Hide resolved
openupgrade_scripts/scripts/sale/16.0.1.2/pre-migration.py Outdated Show resolved Hide resolved
@hoangtiendung070797
Copy link
Contributor Author

@huguesdk Thanks bro. I have learned more things from you lately 👍 . I will check it again

royle-vietnam and others added 5 commits July 13, 2023 11:32
* [MISC] apriori: add section for Viindoo

* [MISC] apriori: add project section for Viindoo

---------

Co-authored-by: Tran Truong Son <truongson290893@gmail.com>
NgoHoangHung and others added 15 commits July 15, 2023 15:00
* [OU-ADD] website_profile: Nothing to do

* Update docsource/modules150-160.rst

---------

Co-authored-by: Roy Le <43790414+royleviindoo@users.noreply.github.com>
* [OU-ADD] account_edi_ubl: Nothing to do

* Update modules150-160.rst

---------

Co-authored-by: Roy Le <43790414+royleviindoo@users.noreply.github.com>
* [OU-ADD] account_sale_timesheet: Nothing to do

* Update modules150-160.rst

---------

Co-authored-by: Roy Le <43790414+royleviindoo@users.noreply.github.com>
* [OU-ADD] stock: migration

* imp

---------

Co-authored-by: Roy Le <roy.le@viindoo.com>
"viin_website_image_optimization_disable": "viin_web_editor",
@royle-vietnam royle-vietnam force-pushed the v16_mig_sale branch 3 times, most recently from 51135ab to 55d01dd Compare July 19, 2023 10:33
@legalsylvain
Copy link
Contributor

Hi @hoangtiendung070797 looks like your PR requires a rebase.
Thanks !

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you finishing this @hoangtiendung070797 ?

ir.actions.server: sale.model_sale_order_action_share (noupdate switched)
# DONE: pre-migration: noupdate switched to 0

NEW ir.config_parameter: sale.default_invoice_email_template (noupdate)
Copy link
Contributor

@remi-filament remi-filament Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @hoangtiendung070797 thanks for your work on this PR !
Actually this one is not new, it was already existing in v15.0 here : https://github.com/odoo/odoo/blob/7d90bce4c90cb77f2268332a5f1225cd884ac674/addons/sale/models/res_config_settings.py#L59-L65 (except it was not loaded from data but directly in Python model).

Obviously when migrating I get the following errors :

2023-10-12 12:15:55,539 65829 INFO lf_20231011_v16mig odoo.modules.loading: loading sale/data/sale_data.xml 
2023-10-12 12:15:55,556 65829 ERROR lf_20231011_v16mig odoo.sql_db: bad query: INSERT INTO "ir_config_parameter" ("create_date", "create_uid", "key", "value", "write_date", "write_uid") VALUES ('2023-10-12 12:15:52.952317', 1, 'sale.default_invoice_email_template', '11', '2023-10-12 12:15:52.952317', 1) RETURNING "id"
ERROR: duplicate key value violates unique constraint "ir_config_parameter_key_uniq"
DETAIL:  Key (key)=(sale.default_invoice_email_template) already exists.

You should probably add a XML id on that parameter in pre_migration using openupgrade.add_xmlid() function (https://github.com/OCA/openupgradelib/blob/d0aee908031876a95dc36c7a9a2c847186155aa2/openupgradelib/openupgrade.py#L1288)

@marielejeune
Copy link
Contributor

Hi @hoangtiendung070797 , do you plan to rebase and finish this PR? We'll need it for our migration script. Thanks.

@duong77476-viindoo
Copy link
Contributor

Hi @hoangtiendung070797 , do you plan to rebase and finish this PR? We'll need it for our migration script. Thanks.

Hi , im in charge now, i will create a new PR

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

Successfully merging this pull request may close these issues.