Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045331Openbravo ERP07. Sales managementpublic2020-10-26 15:472020-10-30 12:36
ngarcia 
cberner 
urgentmajoralways
closedfixed 
5
 
PR20Q4PR20Q4 
AugustoMauch
Core
Production - Confirmed Stable
2019-08-30
3.0PR19Q3
No
0045331: 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 => PR20Q4
2020-10-29 11:09hgbotNote Added: 0123998
2020-10-30 12:36hgbotResolutionopen => fixed
2020-10-30 12:36hgbotStatusscheduled => closed
2020-10-30 12:36hgbotNote Added: 0124063
2020-10-30 12:36hgbotFixed in Version => PR20Q4
2020-10-30 12:36hgbotNote Added: 0124064

Notes
(0123998)
hgbot   
2020-10-29 11:09   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/209 [^]
(0124063)
hgbot   
2020-10-30 12:36   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/209 [^]
(0124064)
hgbot   
2020-10-30 12:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: a473143321e3c885cc9b6fff993e66eb0187fbc2
Author: Cristian Berner <cristian.berner@openbravo.com>
Date: 2020-10-29T11:08:48+01:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/a473143321e3c885cc9b6fff993e66eb0187fbc2 [^]

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