Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0046681Openbravo ERPA. Platformpublic2021-05-14 13:402021-05-18 13:57
marvintm 
cberner 
immediatemajoralways
closedfixed 
5
 
PR21Q3 
Core
Production - QA Approved
2020-10-27
PR21Q1
https://gitlab.com/openbravo/product/openbravo/-/commit/74ec2cdad81aba152fc7a704384cc96836dabde9 [^]
No
0046681: 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
For Application Dictionary generated windows, 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.

An example of this can be found in the "Coupons on the Fly" module.
- Log in https://livebuilds.openbravo.com/retail_modules_pgsql_pi/, [^] using "White valley group admin" role
- Create a discount in "Discounts and promotion" window of type "Variable Amount Coupons". Make sure to check the flags "Uses coupon codes" and "Is OTF coupon"
- Go to "OTF Coupons generation rules".
- Create a new record in form view. Check the "Is variable coupon" flag. Fill all remaining mandatory fields (select the previously created discount as discount).
- Realise that you cannot save the record, because the following error is shown:

Error
Saving failed. One or more fields contain illegal values, check the errors for each field.

If the definition of the window is changed, and the field for the id is removed, then the record can be saved correctly.
No tags attached.
depends on backport 0046684PR21Q2.1 closed cberner Openbravo ERP 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 
depends on backport 0046685PR21Q1.2 closed cberner Openbravo ERP 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 
depends on backport 0046702PR20Q4.4 closed cberner Openbravo ERP 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 
depends on backport 0046703TAP closed cberner POS2 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 
caused by defect 0045301 closed cberner Openbravo ERP Sales Order header can be saved without Invoice Address although it is mandatory 
related to defect 0046680 closed platform POS2 [21Q2] [Restaurants] An error is shown when trying to add a Product to a menu in the Backoffice 
Issue History
2021-05-14 13:40marvintmNew Issue
2021-05-14 13:40marvintmAssigned To => platform
2021-05-14 13:40marvintmModules => Core
2021-05-14 13:40marvintmTriggers an Emergency Pack => No
2021-05-14 13:53marvintmRelationship addedrelated to 0046680
2021-05-14 14:54cbernerRegression date => 2020-10-27
2021-05-14 14:54cbernerRegression introduced in release => PR21Q1
2021-05-14 14:54cbernerRegression introduced by commit => https://gitlab.com/openbravo/product/openbravo/-/commit/74ec2cdad81aba152fc7a704384cc96836dabde9 [^]
2021-05-14 15:00cbernerAssigned Toplatform => cberner
2021-05-14 15:03cbernerStatusnew => scheduled
2021-05-14 15:09dmitry_mezentsevRelationship addedcaused by 0045301
2021-05-17 07:19alostaleRegression level => Production - QA Approved
2021-05-17 07:19alostalePrioritynormal => immediate
2021-05-17 12:02hgbotNote Added: 0128206
2021-05-18 09:52cbernerStatusscheduled => acknowledged
2021-05-18 09:52cbernerStatusacknowledged => scheduled
2021-05-18 09:54cbernerRelationship addeddepends on 0046703
2021-05-18 13:57hgbotResolutionopen => fixed
2021-05-18 13:57hgbotStatusscheduled => closed
2021-05-18 13:57hgbotNote Added: 0128321
2021-05-18 13:57hgbotFixed in Version => PR21Q3
2021-05-18 13:57hgbotNote Added: 0128322

Notes
(0128206)
hgbot   
2021-05-17 12:02   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/365 [^]
(0128321)
hgbot   
2021-05-18 13:57   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/365 [^]
(0128322)
hgbot   
2021-05-18 13:57   
Directly closing issue as related merge request is already approved.

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
---