Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045301Openbravo ERP07. Sales managementpublic2020-10-26 15:472021-05-18 13:57
ngarcia 
cberner 
urgentmajoralways
closedfixed 
5
 
PR21Q1 
AugustoMauch
Core
Production - Confirmed Stable
2019-08-30
3.0PR19Q3
No
0045301: Sales Order header can be saved without Invoice Address although it is mandatory
Sales Order header can be saved without Invoice Address although it is mandatory.

Business Partner window also has a mandatory field in a "More Information" field group, it can be saved if empty and More Information is collapsed.
As group admin role:
   Create a customer
   Add a location to it
   Set it as Invoicing Address = 'N'

Create a Sales Order header
Do not expand the More Information section
Set the required fields (except Invoice Address)
Click on Lines tab and check the header is saved and it shouldn't
Open the More Information section
Click on Lines tab
Check the following error is shown:
   One or more fields contain illegal values, check the errors for each field.
This is correct

It is also reproducible in Business Partner window
- Create a new BP
- Open More Information collapsed field group
- Empty "Credit Line Limit" field
- Close More Information field group(collapse it)
- Click on the Customer subtab
- Check that the BP was saved, although the "Credit Line Limit" has invalid information.
Validate also hidden fields.
No tags attached.
depends on backport 0045331PR20Q4 closed cberner Sales Order header can be saved without Invoice Address although it is mandatory 
depends on backport 0045332PR20Q3.2 closed cberner Sales Order header can be saved without Invoice Address although it is mandatory 
depends on backport 0045333PR20Q2.3 closed cberner Sales Order header can be saved without Invoice Address although it is mandatory 
causes defect 0046681 closed cberner If a tab has a field for the id of the entity, it is no longer possible to create a new record in form view 
Issue History
2020-10-26 15:47ngarciaNew Issue
2020-10-26 15:47ngarciaAssigned To => Triage Finance
2020-10-26 15:47ngarciaModules => Core
2020-10-26 15:47ngarciaResolution time => 1605481200
2020-10-26 15:47ngarciaTriggers an Emergency Pack => No
2020-10-26 15:50ngarciaIssue Monitored: networkb
2020-10-26 16:09dmiguelezAssigned ToTriage Finance => platform
2020-10-27 10:45cbernerAssigned Toplatform => cberner
2020-10-27 18:12hgbotNote Added: 0123959
2020-10-28 09:46cbernerReview Assigned To => AugustoMauch
2020-10-29 10:15cbernerNote Added: 0123995
2020-10-29 10:19cbernerResolution time1605481200 => 1567116000
2020-10-29 10:19cbernerRegression level => Production - Confirmed Stable
2020-10-29 10:19cbernerRegression introduced in release => 3.0PR19Q3
2020-10-29 10:19cbernerSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=21832#r21832
2020-10-29 10:19cbernerProposed Solution updated
2020-10-29 10:20cbernerResolution time1567116000 => 1605481200
2020-10-29 10:20cbernerRegression date => 2019-08-30
2020-10-29 10:49cbernerDescription Updatedbug_revision_view_page.php?rev_id=21834#r21834
2020-10-29 10:50cbernerNote Edited: 0123995bug_revision_view_page.php?bugnote_id=0123995#r21836
2020-10-29 10:56cbernerStatusnew => scheduled
2020-10-30 12:36hgbotNote Added: 0124057
2020-10-30 12:36hgbotResolutionopen => fixed
2020-10-30 12:36hgbotStatusscheduled => closed
2020-10-30 12:36hgbotFixed in Version => PR21Q1
2020-10-30 12:36hgbotNote Added: 0124058
2021-05-14 15:09dmitry_mezentsevRelationship addedcauses 0046681
2021-05-18 13:57hgbotNote Added: 0128320
2021-05-18 13:57hgbotNote Added: 0128323
2021-05-18 13:57hgbotNote Added: 0128326
2021-05-18 13:57hgbotNote Added: 0128329

Notes
(0123959)
hgbot   
2020-10-27 18:12   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/204 [^]
(0123995)
cberner   
2020-10-29 10:15   
(edited on: 2020-10-29 10:50)
This issue is considered a regression from user perspective. The issue has always been there, but it was made visible starting from 19Q3 in Business Partner windows, because mandatory fields were moved from the main Field Group to a collapsed field group.

In Sales Order is also reproducible in 19Q2 because this mandatory field was already in "More Information" field group, we keep this issue as a regression in 19Q3, although we're not sure the actual version when Sales Order field "Invoice Address" was moved to the collapsed field group.

(0124057)
hgbot   
2020-10-30 12:36   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/204 [^]
(0124058)
hgbot   
2020-10-30 12:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 74ec2cdad81aba152fc7a704384cc96836dabde9
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-10-30T11:28:14+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/74ec2cdad81aba152fc7a704384cc96836dabde9 [^]

Fixes ISSUE-45301: Record can be saved with missing mandatory field data

If a mandatory field in a collapsed field group had no value or invalid
values, the record could be saved by the auto-save when changing focus
to a child tab.

The approach taken here is to also validate hiddenFields that are not
present because of being in a collapsed field group.

form.validate method can be found in smartclient DynamicForm and it
accepts as first argument a boolean indicating to validate or no hidden
fields, it is now set to true on ob-view-form, fixing this issue.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0128320)
hgbot   
2021-05-18 13:57   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 9ba983cd4aa5aea143ded1d5f48e9a872ba21641
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-05-18T11:54:46+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/9ba983cd4aa5aea143ded1d5f48e9a872ba21641 [^]

Fixes ISSUE-46681: Not possible to create a new record in form view if id is present in tab

This was due to how validation is handled in form, to avoid ISSUE-45301
a validateHiddenFields flag has been set to true to validate all hidden
fields that may be present in the form but under collapsed field groups.
This also checks all hidden fields, for example in this case identifier.
Which on new records is always undefined, until the record is saved and
an id is received.

To fix this, a check is done at validateField level, if the field is hidden and not displayed, validation will be skipped.
An alternative would be to only validate displayed fields at this level,
but this may be more prone to errors.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0128323)
hgbot   
2021-05-18 13:57   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 75dbb51faa05fb06429dfdf960d60405560c744d
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-05-18T09:59:32+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/75dbb51faa05fb06429dfdf960d60405560c744d [^]

Fixes ISSUE-46702: Not possible to create a new record in form view if id is present in tab

This was due to how validation is handled in form, to avoid ISSUE-45301
a validateHiddenFields flag has been set to true to validate all hidden
fields that may be present in the form but under collapsed field groups.
This also checks all hidden fields, for example in this case identifier.
Which on new records is always undefined, until the record is saved and
an id is received.

To fix this, a check is done at validateField level, if the field is hidden and not displayed, validation will be skipped.
An alternative would be to only validate displayed fields at this level,
but this may be more prone to errors.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0128326)
hgbot   
2021-05-18 13:57   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 3f52e5ace10eb872561509df5e6f822d698262d4
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-05-18T10:04:56+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/3f52e5ace10eb872561509df5e6f822d698262d4 [^]

Fixes ISSUE-46685: Not possible to create a new record in form view if id is present in tab

This was due to how validation is handled in form, to avoid ISSUE-45301
a validateHiddenFields flag has been set to true to validate all hidden
fields that may be present in the form but under collapsed field groups.
This also checks all hidden fields, for example in this case identifier.
Which on new records is always undefined, until the record is saved and
an id is received.

To fix this, a check is done at validateField level, if the field is hidden and not displayed, validation will be skipped.
An alternative would be to only validate displayed fields at this level,
but this may be more prone to errors.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
(0128329)
hgbot   
2021-05-18 13:57   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 9ab49a024670d8a4823a686b8f5a3de01a12770c
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2021-05-18T10:50:56+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/9ab49a024670d8a4823a686b8f5a3de01a12770c [^]

Fixes ISSUE-46684: Not possible to create a new record in form view if id is present in tab

This was due to how validation is handled in form, to avoid ISSUE-45301
a validateHiddenFields flag has been set to true to validate all hidden
fields that may be present in the form but under collapsed field groups.
This also checks all hidden fields, for example in this case identifier.
Which on new records is always undefined, until the record is saved and
an id is received.

To fix this, a check is done at validateField level, if the field is hidden and not displayed, validation will be skipped.
An alternative would be to only validate displayed fields at this level,
but this may be more prone to errors.

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