mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Without this patch, a user that wasn't able to edit a picking product qty would be able to edit the packaging qty and produce a product qty update (which they shouldn't be able to do). Now, the field is hidden or readonly when the `product_uom_qty` field is too. Also, the inverse method of `product_packaging_qty` was only being triggered when saving. That doesn't fit well with v16, where saving is pseudo-automatic. Thus, the inverse is reused as an onchange. To make it worse, the inverse method had a lot of validations. If they were meaningful, they should have been constraints instead. But they really didn't make any sense because they were testing impossible scenarios. For example, they were testing you didn't update the field when there's no packaging, but that's fixed now with a dynamic readonly attribute; also they were testing that the packaging qty != 0, but there's an upstream sql constraint that forbids that. There was a check that warned about impossible combinations of packages and UoM qtys. Now that everything is properly automated, that scenario is impossible. Thus, the check is removed. Summarizing, the module should be more usable and consistent now. @moduon MT-3694