diff options
| author | svs-odoo <svs@odoo.com> | 2019-07-12 13:38:36 +0000 |
|---|---|---|
| committer | svs-odoo <svs@odoo.com> | 2019-07-26 12:22:34 +0000 |
| commit | 70f99448d5198d5582ea3411e694dca10a602286 (patch) | |
| tree | 4eafe7b4bf8e9bc64d761dce3212928ff65df856 /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 2971bf61007a6b93a984d166a4b448af52673362 (diff) | |
[FIX] stock: forbid edition of inventory loss quant
As quant from inventory loss location balances real quantity, it could
be really hazardous to able user to modify it. That said, modify it now
has no effect. So, with this commit, we exit the quant write method in
case of user tries to modify it manually if the quant location is
inventory loss, and we inform the user he can't modify it.
We could set the field as readonly in this case, but it's clearer for
user to inform him/her in case he/she tries to modify the quant than set
the field as readonly and take the risk user don't understand why he/she
can modify some quant and can't modify some other.
It would be preferabler to raise an UserError in the write than do
nothing in the write and return a warning in the onchange, but in case
we raise an error in the write method, user side the field is still in
edit mode and then, every time user clicks somewhere but on Discard, it
will raise the error again and it's not convenient for the user.
Task #2035465
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions
