Skip to content

Conversation

@sbejaoui
Copy link
Contributor

This module extends the batch RMA process by adding automatic sale order linking at batch level. It reuses the matching logic provided by the module rma_sale_auto_detect, but allows it to be executed on all RMAs contained inside an rma.batch.

A new batch state Manual Treatment is introduced. If at least one RMA in the batch fails to auto-match, the batch is moved to this state, so the user can review and fix the unmatched RMAs manually.

refs: #473

@sbejaoui sbejaoui force-pushed the 18.0-rma_batch_sale_auto_detect-sbj branch 4 times, most recently from f78d7a7 to d9ba3fb Compare November 3, 2025 13:38
from odoo.addons.rma_sale_auto_detect.tests.common import TestRmaSaleAutoDetectBase


class TestRmaBatchSaleAutoDetect(TestRmaSaleAutoDetectBase):
Copy link
Contributor

Choose a reason for hiding this comment

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

Tests fail, I guess the class must be tagged as post-install

Comment on lines +13 to +18
def _create_rma(self, partner, product, qty, operation):
rma = super()._create_rma(partner, product, qty, operation)
rma.batch_id = self.batch
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if you create a RMA batch for partner 1 but you add RMAs for both partner 1 and partner 2 inside this batch?

I've seen there is a compute on partner_id on rma model, to fill it with the partner of the batch. But what if the link is done in the other way: setting the partner on the RMA first, then adding the RMA to the batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add a constraint to prevent users from mixing rmas from different partners in the same batch

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 in #499

@sbejaoui sbejaoui force-pushed the 18.0-rma_batch_sale_auto_detect-sbj branch 4 times, most recently from ada04d0 to 0331e1e Compare November 3, 2025 13:50
@sbejaoui sbejaoui force-pushed the 18.0-rma_batch_sale_auto_detect-sbj branch 3 times, most recently from 94fb844 to c6808e3 Compare November 13, 2025 14:08
This module extends the batch RMA process by adding automatic sale order
linking at batch level. It reuses the matching logic provided by the module
`rma_sale_auto_detect`, but allows it to be executed on all RMAs contained
inside an `rma.batch`.

A new batch state **Manual Treatment** is introduced.
If at least one RMA in the batch fails to auto-match, the batch is moved to
this state, so the user can review and fix the unmatched RMAs manually.

refs: OCA#473

[IMP] rma_batch_sale_auto_detect: allow user to select product then so in batch view
@sbejaoui sbejaoui force-pushed the 18.0-rma_batch_sale_auto_detect-sbj branch from c6808e3 to 641ae3c Compare November 17, 2025 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants