Skip to content

[IMP] rma: configurable workflow #417

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

Merged
merged 8 commits into from
Jun 2, 2025

Conversation

sbejaoui
Copy link
Contributor

@sbejaoui sbejaoui commented Aug 15, 2024

As explained in #413, having a configurable RMA process helps cover more use cases by allowing the configuration of when the three main actions (reception, delivery, and refund) occur.

This PR adds configuration fields to the RMA operation, which allow managing the visibility of these actions in the RMA form. It also adds the possibility to automatically trigger these actions upon RMA confirmation or reception.

To minimize the impact on current users of this module, default values were set for these settings to maintain the existing workflow unchanged. After making these changes, there was no need to adjust the existing unit tests.

fixes: #413

cc/ @pedrobaeza , @jbaudoux , @lmignon , @rousseldenis

@OCA-git-bot
Copy link
Contributor

Hi @chienandalu, @pedrobaeza,
some modules you are maintaining are being modified, check this out!

@sbejaoui sbejaoui marked this pull request as draft August 15, 2024 11:22
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch 2 times, most recently from 6fcef2e to 387d02c Compare August 16, 2024 10:22
@sbejaoui sbejaoui marked this pull request as ready for review August 18, 2024 17:38
@rousseldenis rousseldenis added this to the 16.0 milestone Aug 19, 2024
)

# Replace fields, used when the delivery is created automatically
replace_warehouse_id = fields.Many2one(
Copy link
Member

Choose a reason for hiding this comment

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

The computation of these fields will mean an overhead on existing installations. Why they are needed? This seems a new feature that is not linked with the configurable workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the operation, if the user selects 'Automatic Delivery' and 'Different Return Product,' the workflow will trigger the replacement action. Since the replacement action requires user input, the replacement information should be filled in the RMA at the time of its creation.

The computed fields for the replacement warehouse and replacement product UoM are intended to provide default values. A migration script can be added to create these columns, ensuring that their computation does not trigger on existing RMAs.

image

Copy link
Member

@pedrobaeza pedrobaeza Aug 24, 2024

Choose a reason for hiding this comment

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

Please add the post_init_hook/migration script thus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

@sbejaoui sbejaoui Aug 29, 2024

Choose a reason for hiding this comment

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

@pedrobaeza ,

@jbaudoux pointed out that replacing a product with a different one can be handled by processing an RMA reception with a refund and then creating a normal sale. I will remove this part I added to the workflow.

Another use case reported by the customer is receiving a different product than the one ordered. In this case, we need to receive a product that is not listed on the sale order and then redeliver the originally ordered product.

I am considering adding a new field, 'product to return,' which will be used if the operation has 'return a different product' set to True.
In this case, the reception will involve the different product. Otherwise, the standard behavior will apply, and the product_id will be used for both reception and delivery.

What are your thoughts on this?

@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from 387d02c to 221d30d Compare August 28, 2024 09:29
@sbejaoui sbejaoui requested a review from pedrobaeza August 28, 2024 09:29
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch 9 times, most recently from 02b9604 to 5261de6 Compare August 29, 2024 13:49
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch 2 times, most recently from 4f00835 to 9737b31 Compare September 3, 2024 10:19
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch 2 times, most recently from a3d5c26 to 0712bb6 Compare September 20, 2024 11:40
Copy link

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Code review

@OCA-git-bot
Copy link
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). 🤖

Copy link

github-actions bot commented Jun 1, 2025

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 1, 2025
@rousseldenis rousseldenis removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 2, 2025
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from 1d5bce5 to 8079bb8 Compare June 2, 2025 09:43
@rousseldenis
Copy link

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-417-by-rousseldenis-bump-major, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 38249de into OCA:16.0 Jun 2, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 0b00997. 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.

RMA : configurable workflow
5 participants