Skip to content

[19.0] [MIG] sale_cancel_reason#4105

Open
NachoAlesLopez wants to merge 63 commits intoOCA:19.0from
NachoAlesLopez:19.0-mig-sale_cancel_reason-cleaned
Open

[19.0] [MIG] sale_cancel_reason#4105
NachoAlesLopez wants to merge 63 commits intoOCA:19.0from
NachoAlesLopez:19.0-mig-sale_cancel_reason-cleaned

Conversation

@NachoAlesLopez
Copy link
Copy Markdown

No description provided.

Guewen Baconnier and others added 30 commits January 14, 2026 07:59
(../trunk-generic/ rev 29.1.1)
(../trunk-generic/ rev 32.1.1)
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
* [MIG] sale_cancel_reason Migration to 10.0

* Follow coding standard

* Convert test to unittest2
Currently translated at 100.0% (23 of 23 strings)

Translation: sale-workflow-10.0/sale-workflow-10.0-sale_cancel_reason
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-sale_cancel_reason/pt/
Currently translated at 100.0% (23 of 23 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_cancel_reason
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_cancel_reason/de/
Currently translated at 100.0% (23 of 23 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_cancel_reason
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_cancel_reason/zh_CN/
Currently translated at 95.7% (22 of 23 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_cancel_reason
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_cancel_reason/es_CL/
@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch 3 times, most recently from be53939 to b95a32c Compare January 14, 2026 08:04
@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch from b95a32c to 93733e9 Compare January 14, 2026 08:16
Copy link
Copy Markdown

@lfreeke lfreeke left a comment

Choose a reason for hiding this comment

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

👍 (Functional test)

@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot migration sale_cancel_reason

Comment thread sale_cancel_reason/model/sale_order.py Outdated
@@ -16,17 +16,17 @@ class SaleOrder(models.Model):
copy=False,
)

def _show_cancel_wizard(self):
for order in self:
if not order._context.get("disable_cancel_warning"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@NachoAlesLopez You removed this functionality to avoid the wizard ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It appears that the latest version removed the method and context to show the cancel wizard or cancel the order straight away. I've now re-added the condition in the view based on the same context key from version 18.0.

@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch 2 times, most recently from c9a26ad to ca8e716 Compare February 16, 2026 07:04
@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch from ca8e716 to 3134141 Compare February 26, 2026 07:02
Copy link
Copy Markdown

@alexey-pelykh alexey-pelykh 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 the migration, nice clean work overall.

One thing I noticed: wizard/mass_cancel_orders.py is missing the license header (copyright + AGPL-3 notice) that all the other Python files have. Small fix but worth adding for consistency.

Everything else looks good to me -- the disable_cancel_warning context approach for toggling between the native and custom cancel buttons is clean, security ACLs are properly scoped, the action_draft reset of the cancel reason makes sense, and the tests cover the main flows well (single cancel, mass cancel, and draft reset).

@@ -0,0 +1,13 @@
from odoo import fields, models
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing license header -- all other .py files in this module have the Copyright ... / License AGPL-3.0 or later block. Could you add it here as well?

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch from 3134141 to 09e5c57 Compare March 2, 2026 06:52
Copy link
Copy Markdown

@alexey-pelykh alexey-pelykh 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 squashing -- the migration looks clean.

My earlier note still applies: wizard/mass_cancel_orders.py is the only Python file without the license header (copyright + AGPL-3 notice). Not blocking, but would be nice to add for consistency with the rest of the module.

Otherwise everything is solid: manifest, security, views, tests, and the cancel-button toggling via disable_cancel_warning context all look good for 19.0.

@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch from 09e5c57 to 2e33b09 Compare March 9, 2026 10:24
@NachoAlesLopez NachoAlesLopez force-pushed the 19.0-mig-sale_cancel_reason-cleaned branch from 2e33b09 to 3e76d24 Compare March 9, 2026 10:27
Comment on lines +1 to +3
# © 2013 Guewen Baconnier, Camptocamp SA
# © 2022 Landoo Sistemas de Informacion SL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).3
Copy link
Copy Markdown
Author

@NachoAlesLopez NachoAlesLopez Mar 9, 2026

Choose a reason for hiding this comment

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

@alexey-pelykh

Thanks for squashing -- the migration looks clean.

My earlier note still applies: wizard/mass_cancel_orders.py is the only Python file without the license header (copyright + AGPL-3 notice). Not blocking, but would be nice to add for consistency with the rest of the module.

Otherwise everything is solid: manifest, security, views, tests, and the cancel-button toggling via disable_cancel_warning context all look good for 19.0.

Done! I copied the copyright notice from "wizard/sale_order_cancel_wizard.py". Should be fine like this, right?

Copy link
Copy Markdown
Contributor

@BhaveshHeliconia BhaveshHeliconia left a comment

Choose a reason for hiding this comment

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

Functional review LGTM!

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.