Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0019272Openbravo ERPA. Platformpublic2011-12-09 14:002011-12-30 14:02
psarobe 
jonalegriaesarte 
urgentmajoralways
closedfixed 
5
pi 
3.0MP7 
Core
No
0019272: M_attributesetinstance is taking the org from the organization you have logged in
Not sure if it happens in all cases. But the first time you assign an attribute value to a product using the product window it takes the organization from the organization you are logged in
1. Login as Openbravo/openbravo
2. Verify that this are the credentials (very important for the issue):
  2.1 Role: F&B international group admin
  2.2 Organization: F&B US, Inc.
3. Go to Attribute window and click new
  3.1 Organization: *
  3.2 Name: Color
  3.3 Save
4. Move to its child tab. Click new
  4.1 Search key: blue
  4.2 Name: Blue
  4.3 Save
5. Go to Attribute Set window
6. Click new:
  6.1 Organization: *
  6.2 Name: Color
  6.3 Save
7. Move to it child tab and click new
8. Select Color and save
9. Go to Product window and click new:
  9.1 Organization: F&B EspaƱa, S.A (Very important)
  9.2 Search key: sirof
  9.3 Name: Sirof
  9.4 Select attribute Set: Color
  9.5 Click save
  9.6 Click Attribute Set Value: Select Blue and click OK
NOTICE that the system has created a record in the M_ATTRIBUTESETINSTANCE table with ad_org_id='B9C7088AB859483A9B1FB342AC2BE17A' (F&B US, Inc) and this is wrong. It seems the system is not able to know which is the org to use and takes it from the session (remember F&B US, Inc)
  9.7 Click Save
NOTICE the system is not able to save the record because of that giving this error text: "Saving failed. With your current role this action is not allowed."

SOLUTION: The system has to take the organization from the M_ATTRIBUTESET where this attribute belongs
No tags attached.
related to design defect 0019161 new dmiguelez In product window assign only AttributesSet from the same org or parents should be permitted 
blocks defect 0019273 closed AugustoMauch Different criteria when saving records that contains entities that don't belong to the org tree 
Issue History
2011-12-09 14:00psarobeNew Issue
2011-12-09 14:00psarobeAssigned To => mtaal
2011-12-09 14:00psarobeModules => Core
2011-12-09 14:04psarobeRelationship addedblocks 0019273
2011-12-13 15:43mtaalNote Added: 0043823
2011-12-13 15:43mtaalAssigned Tomtaal => eduardo_Argal
2011-12-13 17:52psarobeAssigned Toeduardo_Argal => jonalegriaesarte
2011-12-21 11:39gorkaionRelationship addedrelated to 0019161
2011-12-29 13:38hgbotCheckin
2011-12-29 13:38hgbotNote Added: 0044072
2011-12-29 13:38hgbotStatusnew => resolved
2011-12-29 13:38hgbotResolutionopen => fixed
2011-12-29 13:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bfd4e3288242c0f50c4e4e21f01f12dc7293e065 [^]
2011-12-30 13:44VictorVillarNote Added: 0044081
2011-12-30 13:44VictorVillarStatusresolved => closed
2011-12-30 14:02hudsonbotCheckin
2011-12-30 14:02hudsonbotNote Added: 0044085

Notes
(0043823)
mtaal   
2011-12-13 15:43   
This also happens in the classic code, see this line in the AttributeSetInstance java class:

          AttributeSetInstanceData.insertHeader(conn, this, strInstance, vars.getClient(),
              vars.getOrg(), vars.getUser(), data[0].mAttributesetId, serno, lot, guaranteedate,
              "", locked, lockDescription);

vars.getOrg() is done, which returns the logged in organization.

Testing in the classic window shows that this also occurs in classic mode. I guess it is a problem of the application code in AttributeSetInstance.
(0044072)
hgbot   
2011-12-29 13:38   
Repository: erp/devel/pi
Changeset: bfd4e3288242c0f50c4e4e21f01f12dc7293e065
Author: rafaeldemiguel <rdm <at> openbravo.com>
Date: Wed Dec 21 11:57:33 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bfd4e3288242c0f50c4e4e21f01f12dc7293e065 [^]

Fixed issue 0019272 M_attributesetinstance is taking the org from the organization you have logged in

---
M src/org/openbravo/erpCommon/utility/AttributeSetInstanceValue.java
---
(0044081)
VictorVillar   
2011-12-30 13:44   
Verified
(0044085)
hudsonbot   
2011-12-30 14:02   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/90c08638786e [^]

Maturity status: Test