ForgeFlow / stock-rma

Stock RMA
GNU Affero General Public License v3.0
38 stars 41 forks source link

[17.0][MIG] rma_scrap #514

Open AaronHForgeFlow opened 5 months ago

AaronHForgeFlow commented 5 months ago

Supersedes https://github.com/ForgeFlow/stock-rma/pull/504

Respected original code & history

Reasons for supersede:

Merge 17.0 was broken after merging and reverting by mistake some pull requests: https://github.com/ForgeFlow/stock-rma/pull/483 & https://github.com/ForgeFlow/stock-rma/pull/500

History was incorrect showing merge commits within it. Merge conflicts when trying to manually merge other PRs on top on that one. Unable to see the changes in the migration commit, making hard for the reviewer to review the code

Sorry for the inconvenience.

https://github.com/ForgeFlow

AaronHForgeFlow commented 5 months ago

Tested scrap operations with the scrap completion. LGTM

(I am not reviewing myself, the migration was done in the superseded PR)

AaronHForgeFlow commented 5 months ago

There is only one issue with the rma_scrap view, with some fields not being displayed (I think they can be removed from the view)

image

RLeeOSI commented 2 months ago

@AaronHForgeFlow Found a minor issue with creating a scrap order from the RMA order.

If the product to be scrapped is serial tracked, the scrap form view makes the quantity field readonly. There's an onchange on the product_id field that is supposed to set the quantity to 1 if the product is serial tracked, but it is not triggered. The result is that the quantity is set to 0 and is readonly. Calling the onchange method after creating the scrap order should fix this.

AaronHForgeFlow commented 2 months ago

@RLeeOSI thanks for the notice! I will fix that. Anyway, if you create a PR to my branch I would appreciate it.

AaronHForgeFlow commented 1 month ago

@RLeeOSI I see that in the Scrap order the quantiy is readonly, but it seems that is standard Odoo. When the product is serial tracked then the quantity is readonly.

In the wizard, I can see I can put a different quantity even if the product is serial:

This quantity is propagated to the scrap order and can't be changed: 2024-08-22_14-36

So the solution I think is to force the quantity in the wizard to be 1. Same as Odoo does with manual scrap orders.

AaronHForgeFlow commented 1 month ago

Rebasing just to confirm tests fail and the module needs an amendment.