-
-
Notifications
You must be signed in to change notification settings - Fork 63
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][MIG] sale_coupon_order_line_link: Migration to version 16.0 #151
[16.0][MIG] sale_coupon_order_line_link: Migration to version 16.0 #151
Conversation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-promotion-13.0/sale-promotion-13.0-website_sale_coupon_page Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-13-0/sale-promotion-13-0-website_sale_coupon_page/
This way, you can put richer text with multi-lines as description. TT33564
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-promotion-15.0/sale-promotion-15.0-website_sale_coupon_page Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-15-0/sale-promotion-15-0-website_sale_coupon_page/
…+ Migration to 16.0 TT44378
Currently translated at 100.0% (15 of 15 strings) Translation: sale-promotion-14.0/sale-promotion-14.0-sale_coupon_order_line_link Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-14-0/sale-promotion-14-0-sale_coupon_order_line_link/it/
If a third module adds an extra discount scope, we should: - Allow integration returning always at least an empty object - Allow compatibility by inheritance hooking into the method that defines the scoped lines. TT36131
In some cases the `recompute_coupon_lines` method could lead to miss the previously created links. We want to ensure those links at the end of such method. TT40205
Currently translated at 100.0% (15 of 15 strings) Translation: sale-promotion-15.0/sale-promotion-15.0-sale_coupon_order_line_link Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-15-0/sale-promotion-15-0-sale_coupon_order_line_link/it/
Currently translated at 100.0% (15 of 15 strings) Translation: sale-promotion-15.0/sale-promotion-15.0-sale_coupon_order_line_link Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-15-0/sale-promotion-15-0-sale_coupon_order_line_link/it/
Currently translated at 100.0% (15 of 15 strings) Translation: sale-promotion-15.0/sale-promotion-15.0-sale_coupon_order_line_link Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-15-0/sale-promotion-15-0-sale_coupon_order_line_link/it/
Currently translated at 100.0% (15 of 15 strings) Translation: sale-promotion-15.0/sale-promotion-15.0-sale_coupon_order_line_link Translate-URL: https://translation.odoo-community.org/projects/sale-promotion-15-0/sale-promotion-15-0-sale_coupon_order_line_link/it/
b4cfcfd
to
4527b89
Compare
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.
Yes, the rename would be correct IMO.
Some remarks:
<group name="promo_info" string="Promotions"> | ||
<field | ||
<!-- <field |
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.
🤔
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.
This view needs to be revised because the fields have changed and may need to be added to the sale.order model to display them.
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.
These fields no longer exist in the sale.order model nor have they been renamed, I would have to add them to the model to get the promotion/coupon applied and in the case that a coupon is generated also add a field to display those generated coupons. I don't know if this is necessary to complete the functionality of the module or if this would be a parallel functionality.
4527b89
to
0e58cb0
Compare
0e58cb0
to
b8929e6
Compare
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.
Add the migration script
2229958
to
4f462f9
Compare
def _fill_reward_id_field(env): | ||
for line in env["sale.order.line"].filtered("loyalty_program_id"): | ||
line.reward_id = env["reward.program"].search( | ||
[["program_id", "=", line.loyalty_program_id.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.
Better do this in pre and with sql for performance and to avoid to trigger ORM operations
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 doubted whether such a field will already exist in pre
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.
It probably won't. You should try to pre-create the column:
ALTER TABLE sale_order_line
ADD COLUMN IF NOT EXISTS reward_id INTEGER;
…_link + Migration to version 16.0 TT44349
4f462f9
to
061e5a5
Compare
Continued in #152 |
cc @Tecnativa TT44349
TODO: Renamed to sale_loyalty_order_line_link and script for migration
Please @chienandalu can you check it? If it is correct I rename it