Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0048385Openbravo ERP00. Application dictionarypublic2022-01-12 10:372022-01-12 11:33
AugustoMauch 
AugustoMauch 
highmajoralways
closedfixed 
5
pi 
PR22Q1PR22Q1 
Core
No
0048385: Error translating a discount and promotion
Error translating a discount and promotion after editing in grid view

Previous fix done in this issue was backed out because it broke CI: https://issues.openbravo.com/view.php?id=48153 [^]
-Go to discount and promotions
-Create a translation in form view
-Go to grid view
-Edit and remove the language
-Press save --> you will see red rectangle with the error
-Press Edit
-You will see Albanian as selected
-Press save

The error appears again

You need to select manually the lang to avoid the error
No tags attached.
Issue History
2022-01-12 10:37AugustoMauchNew Issue
2022-01-12 10:37AugustoMauchAssigned To => AugustoMauch
2022-01-12 10:37AugustoMauchModules => Core
2022-01-12 10:37AugustoMauchTriggers an Emergency Pack => No
2022-01-12 10:37AugustoMauchIssue generated from0048354
2022-01-12 10:42hgbotNote Added: 0134250
2022-01-12 11:33hgbotResolutionopen => fixed
2022-01-12 11:33hgbotStatusnew => closed
2022-01-12 11:33hgbotFixed in Version => PR22Q1
2022-01-12 11:33hgbotNote Added: 0134255
2022-01-12 11:33hgbotNote Added: 0134256

Notes
(0134250)
hgbot   
2022-01-12 10:42   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/498 [^]
(0134255)
hgbot   
2022-01-12 11:33   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/498 [^]
(0134256)
hgbot   
2022-01-12 11:33   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 73b902184bf16de5b7379bfc13c53d86a36d9d53
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 12-01-2022 10:42:15
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/73b902184bf16de5b7379bfc13c53d86a36d9d53 [^]

Fixes ISSUE-48385: Validating error cleared when no mandatory fields are empty

To reproduce the issue, the user had to:
- create a record, filling in all mandatory fields
- empty one of the mandatory fields and save, an expected validation error was raised
- edit the line in grid view, mandatory field is given a default value (the FIC does it), but
after trying to save the validation error does not go away and the new value is not saved

The problem was that even though the FIC was providing a valid default value for the empty
mandatory field, the save process was not trying to save the record because it mistakingly
thought that the edit form had not been changed. To fix this, when processing the FIC return the
setHasChanged function is invoked if the FIC has provided a not-null value for a field that used
to be empty.

Change only needs to be done on grid view, because:
- in form view the problem is not reproducible
- if done in form view, UI will detect changes that are not real (i.e. fields that are visible in form view but not in grid view being filled in by the FIC)

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---