OCA / rma

Odoo for Return Merchandise Authorization (RMA)
GNU Affero General Public License v3.0
78 stars 206 forks source link

RMA SO wizard quantity default to 0 and show max #406

Open jbaudoux opened 2 months ago

jbaudoux commented 2 months ago

When creating an RMA from an SO, it currently opens a wizard with all lines of the SO with the quantity preset to the SO delivered quantity (in fact returnable delivered quantity).

I have several customers that are managing large SOs and facing an RMA for one or few lines. This requires to delete all extra lines or set the quantity to 0 which is cumbersome. In this case, what would be convenient is to have the quantity by default to 0 and have another column showing the max quantity that can be returned.

I can understand this change of approach may not be convenient to current users. Should this change be implemented in another module like rma_sale_show_max_qty or should this be a configuration option in the base rma_sale module?

chienandalu commented 2 months ago

That's how the portal works by default. Maybe both approaches (backend wizards/portal frontend) may converge...

pedrobaeza commented 2 months ago

What about adding buttons in the wizard to "Select all" and "Unselect all"?

sbejaoui commented 1 month ago

What about adding buttons in the wizard to "Select all" and "Unselect all"?

+1

To combine both ideas, we can add another column, "allowed quantity," which will contain the maximum quantity we can return with two buttons at the top of the tree:

  1. Select all: copy the maximum quantity into the quantity field
  2. Unselect all: set the quantity field to 0 for all lines

We may also need a check to ensure that the quantity is always less than or equal to the maximum quantity.

jbaudoux commented 1 month ago

@sbejaoui Sounds good. I would add a checkbox Select all instead of buttons as we are in a popup. If there is only one line, then it can be active, otherwise I would make it inactive by default. I would then do this change directly in rma_sale