details:   https://code.openbravo.com/erp/devel/pi/rev/9233e24043d1
changeset: 32821:9233e24043d1
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Tue Sep 26 16:23:03 2017 +0200
summary:   fixes issue 36953: Can not create records in Organization window 
sub-tabs

  The check created to prevent the creation of new records in a sub-tab that 
does not show the organization field when the role does not have access to the 
header's org was not taking into account the case where the parent tab is 
showing the Organization entity itself.

  In that case, the parent tab will not have an organization property and as it 
was not being found the logic was hidding the save options in the UI.

  To fix this problem, that check is skipped when the parent tab refers to the 
Organization entity. This can be done safely as in this case, the organization 
field of the records in the child tabs will always have the same value of the 
organization field in the parent tab.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 5e375c7475da -r 9233e24043d1 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Tue Sep 26 15:41:01 2017 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Tue Sep 26 16:23:03 2017 +0200
@@ -3174,7 +3174,7 @@
 
   roleHasWriteAccessToParentRecordOrg: function () {
     var parentRecordOrganization;
-    if (!this.parentView || !this.parentView.viewGrid.getSelectedRecord()) {
+    if (!this.parentView || !this.parentView.viewGrid.getSelectedRecord() || 
this.parentView.entity === 'Organization') {
       return true;
     }
     parentRecordOrganization = 
this.parentView.viewGrid.getSelectedRecord().organization;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to