Skip to content

[16.0][IMP] sale_order_line_cancel: Allow to decrease product_uom_qty on line cancel#3757

Merged
OCA-git-bot merged 1 commit intoOCA:16.0from
mt-software-de:16-sale_order_line_cancel-decrease-product_uom_qty
Jul 9, 2025
Merged

[16.0][IMP] sale_order_line_cancel: Allow to decrease product_uom_qty on line cancel#3757
OCA-git-bot merged 1 commit intoOCA:16.0from
mt-software-de:16-sale_order_line_cancel-decrease-product_uom_qty

Conversation

@mt-software-de
Copy link
Copy Markdown
Contributor

@mt-software-de mt-software-de commented Jun 13, 2025

This PR adds a new setting field to allow to decrease the order line qty product_uom_qty instead of increasing product_qty_canceled.

cc @jbaudoux @lmignon @rousseldenis

Comment thread sale_order_line_cancel/models/sale_order_line.py Outdated
Copy link
Copy Markdown
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

What is the use case ?

The idea was to keep the ordered quantity and show how much is delivered and how much is canceled.
Changing the ordered quantity will make the paid amount bigger than the order amount if you have a payment transaction attached to the SO.

Comment thread sale_order_line_cancel/views/res_config_settings_views.xml Outdated
Comment thread sale_order_line_cancel/models/res_company.py Outdated
Comment thread sale_order_line_cancel/models/res_company.py Outdated
@mt-software-de mt-software-de force-pushed the 16-sale_order_line_cancel-decrease-product_uom_qty branch 2 times, most recently from 33b4bfe to 9c776c2 Compare June 14, 2025 16:51
@mt-software-de
Copy link
Copy Markdown
Contributor Author

What is the use case ?

The idea was to keep the ordered quantity and show how much is delivered and how much is canceled. Changing the ordered quantity will make the paid amount bigger than the order amount if you have a payment transaction attached to the SO.

The purpose was to achieve a change of the order amount to be able to send out an updated version of the confirmation. Maybe it would be nice to still track which amount was canceled.

@mt-software-de mt-software-de force-pushed the 16-sale_order_line_cancel-decrease-product_uom_qty branch 2 times, most recently from 494be01 to ab3a64d Compare June 14, 2025 17:16
@rousseldenis rousseldenis added this to the 16.0 milestone Jun 30, 2025
@mt-software-de mt-software-de force-pushed the 16-sale_order_line_cancel-decrease-product_uom_qty branch 3 times, most recently from 80aaf60 to 809f3ce Compare July 2, 2025 13:13
@mt-software-de
Copy link
Copy Markdown
Contributor Author

What is the use case ?
The idea was to keep the ordered quantity and show how much is delivered and how much is canceled. Changing the ordered quantity will make the paid amount bigger than the order amount if you have a payment transaction attached to the SO.

The purpose was to achieve a change of the order amount to be able to send out an updated version of the confirmation. Maybe it would be nice to still track which amount was canceled.

I now extended it, the canceled qty is still saved and the line's quantity will be decreased.

Copy link
Copy Markdown
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

I think you are generating an unwanted return move

Comment thread sale_order_line_cancel/models/sale_order_line.py Outdated
Comment thread sale_order_line_cancel/tests/test_sale_order_line_cancel.py
Copy link
Copy Markdown
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Would still be good to extend the test to check there are no return move generated

@mt-software-de mt-software-de force-pushed the 16-sale_order_line_cancel-decrease-product_uom_qty branch 4 times, most recently from c5ddad0 to 017a09d Compare July 3, 2025 23:14
@mt-software-de mt-software-de force-pushed the 16-sale_order_line_cancel-decrease-product_uom_qty branch from 017a09d to 9eaa13d Compare July 7, 2025 07:07
@mt-software-de
Copy link
Copy Markdown
Contributor Author

@lmignon Could you update your review, this would be now ready for merging.

@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). 🤖

@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot merge minor

@OCA-git-bot
Copy link
Copy Markdown
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-3757-by-rousseldenis-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 85c6d09 into OCA:16.0 Jul 9, 2025
13 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 7569221. Thanks a lot for contributing to OCA. ❤️

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.

6 participants