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

[IMP] rma: configurable workflow #417

Open
wants to merge 7 commits into
base: 16.0
Choose a base branch
from

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?

rma/models/rma.py Show resolved Hide resolved
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from 387d02c to 221d30d Compare August 28, 2024 09:29
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch 6 times, most recently from 38c8100 to e912c52 Compare August 29, 2024 13:34
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from 5261de6 to 4f00835 Compare September 3, 2024 09:52
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from 4f00835 to 9737b31 Compare September 3, 2024 10:19
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from ad6b471 to a3d5c26 Compare September 20, 2024 09:56
@sbejaoui sbejaoui force-pushed the 16.0-rma_configurable_workflow branch from a3d5c26 to 0712bb6 Compare September 20, 2024 11:40
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