RMA/Return not working properly with diferent UOM
Description
Environment
Attachments
Activity

Martin Schönbeck May 9, 2020 at 6:23 PM
triaged by as not reproducible on 7.1z.
Tested with a sold UOM which is smaller than the product UOM and with a sold UOM which is bigger than the product UOM. In both cases the RMA-line allowed only to enter the product UOM, but the price calculated was correct in all cases.
Carlos Ruiz January 29, 2018 at 4:06 PMEdited

Alan Lescano July 4, 2014 at 12:05 PMEdited
I'm not trying to change the way RMA works. But the logic, currently, is not correct. A part of code (mostly) assumes the product UOM and part (minority) of the shipment/invoice/order line UOM. And it should be corrected to work either product UOM or line UOM. Bellow topics explain why I think it's better to use product UOM:
When there is not an option to select a UOM (RMA doesn't allows the selection of one), it should be used the product UOM. This is a concept we can see in other parts of iDempiere. And a company may sell in 6-pack but may accept returns in minimum unit (each).
There is a lot of work in code to work with product UOM. Ex: at present, beforeSave on RMA line (call to checkQty()) allows adjusting qty to max product UOM. But calculated price is using entered UOM. This is a logic mistake. At present, creating RMA/Returns with different UOM, create documents with wrong amounts.

Heng Sin Low July 4, 2014 at 6:07 AM
Shouldn't RMA uses the same UOM ( 6-pack ) as the original sales order and invoice ?

Alan Lescano July 2, 2014 at 6:22 PM
To reproduce:
create & complete new Sales Order; create new line with product elm (ex: qty 5), but select non-default uom, like a 6-pack
create & complete shipment
create RMA, and try both Create Line or create the line manually. Both will retrieve QtyEntered and PriceEntered (wrong), but most of code is already ported to use product uom (which is the correct). Callout already allows you to increase qty to max product uom (in the example, 5x6=30), but price is adjusted wrongly based on 6-pack price.
create Customer Return based on RMA, and Create Line... note that qty is correct (based on product uom) but price is also wrong (6-pack price).
The adjustments in attached patch are basically to correct those issues
When creating RMA/return, there are some problems when UOM of sale/purchase line is different than product default. Problems are related to price and qty values.