Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045333Openbravo ERP07. Sales managementpublic2020-10-26 15:472020-10-30 12:36
ngarcia 
cberner 
urgentmajoralways
closedfixed 
5
 
PR20Q2.3PR20Q2.3 
AugustoMauch
Core
Production - Confirmed Stable
2019-08-30
3.0PR19Q3
No
0045333: 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.
blocks defect 0045301 closed cberner Sales Order header can be saved without Invoice Address although it is mandatory 
Issue History
2020-10-29 10:56cbernerTypedefect => backport
2020-10-29 10:56cbernerTarget Version => PR20Q2.3
2020-10-29 10:58hgbotNote Added: 0123996
2020-10-30 12:36hgbotNote Added: 0124059
2020-10-30 12:36hgbotResolutionopen => fixed
2020-10-30 12:36hgbotStatusscheduled => closed
2020-10-30 12:36hgbotFixed in Version => PR20Q2.3
2020-10-30 12:36hgbotNote Added: 0124060

Notes
(0123996)
hgbot   
2020-10-29 10:58   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/207 [^]
(0124059)
hgbot   
2020-10-30 12:36   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/207 [^]
(0124060)
hgbot   
2020-10-30 12:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 8764ec50eed7e6034c758319978b2fdcbffdbcd7
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-10-29T10:57:49+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/8764ec50eed7e6034c758319978b2fdcbffdbcd7 [^]

Fixes ISSUE-45333: 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
---