Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021229Openbravo ERPA. Platformpublic2012-07-27 10:232012-09-03 13:21
mirurita 
mtaal 
immediatemajoralways
closedfixed 
20Community Appliance
 
3.0MP153.0MP15 
AugustoMauch
Core
No
0021229: Nested tabs built based on a hierarchycal structure of a same table does not work.
Using the following table as example, where a project can define which is the parent (c_project_parent_id), the idea is to define a two level tab window.

Both tabs are related to the same table = c_project
- c_project_parent_id is defined as link to parent column and search reference.

When you create a record on the lines it updates the parent record instead of creating a new one.

Furthermore, you get an infinity loop on FormInitializationComponent line 1077
setSessionValues(parentRecord, parentTab);

Other problems or strange thing is that the @Project.id@ session variable is null.
If you check on Chrome Developers tools the request when saving a Contract record on the parent tab the @Project.id@ value is null. (see attached screenshot)
But if you do the same in Multiphase Project (linked to same table, c_project) the @Project.id@ contains the uuid of the created project.


CREATE TABLE c_project
(
  c_project_id character varying(32) NOT NULL,
  ad_client_id character varying(32) NOT NULL,
  ad_org_id character varying(32) NOT NULL,
  isactive character(1) NOT NULL DEFAULT 'Y'::bpchar,
  created timestamp without time zone NOT NULL DEFAULT now(),
  createdby character varying(32) NOT NULL,
  updated timestamp without time zone NOT NULL DEFAULT now(),
  updatedby character varying(32) NOT NULL,
  "name" character varying(60) NOT NULL, -- --OBTG:NVARCHAR--
  c_project_parent_id character varying(32),
  CONSTRAINT c_project_key PRIMARY KEY (c_project_id),
  CONSTRAINT c_project_parent FOREIGN KEY (c_project_parent_id)
      REFERENCES c_project (c_project_id)
)
Scenario I
1) Prepare an workspace the following pi branch
 with https://code.openbravo.com/erp/devel/pi-contract [^]
2) Go to "Contract" window
3) Create a header record:
  + Name: parent
  + Search Key: parent
4) Go to Lines tab and create a child record
  + Name: child
  + Search Key: child
5) Click on Save button and realize how the parent recorg gets updated with child information.

Scenario II
When you fix the first problem, please check the filtering on Lines it's working.


1) Go to "Contract" window
2) Create a header record:
  + Name: parent
  + Search Key: parent
3) Go to Lines tab and create a child record
  + Name: child
  + Search Key: child
4) Create a header record:
  + Name: parent2
  + Search Key: parent2
5) Go to Lines tab and create a child record
  + Name: child2
  + Search Key: child2
6) Move to Contract tab and select "parent2" record, you should only see the child2 in Lines tab.
No tags attached.
png Contract parent child error.png (71,979) 2012-07-27 10:23
https://issues.openbravo.com/file_download.php?file_id=5476&type=bug
png

png @Project.id@ value is null.png (144,527) 2012-07-27 10:24
https://issues.openbravo.com/file_download.php?file_id=5477&type=bug
png

diff 21229.diff (888) 2012-08-29 16:50
https://issues.openbravo.com/file_download.php?file_id=5538&type=bug
Issue History
2012-07-27 10:23miruritaNew Issue
2012-07-27 10:23miruritaAssigned To => iperdomo
2012-07-27 10:23miruritaFile Added: Contract parent child error.png
2012-07-27 10:23miruritaModules => Core
2012-07-27 10:24miruritaFile Added: @Project.id@ value is null.png
2012-07-27 13:39iperdomoAssigned Toiperdomo => alostale
2012-07-27 15:21miruritaNote Added: 0050951
2012-07-27 15:21miruritaTarget Versionpi => 3.0MP14
2012-07-30 09:33AugustoMauchTarget Version3.0MP14 => 3.0MP15
2012-08-06 09:06miruritaPriorityurgent => immediate
2012-08-07 09:40AugustoMauchAssigned Toalostale => AugustoMauch
2012-08-07 11:53hgbotCheckin
2012-08-07 11:53hgbotNote Added: 0051138
2012-08-07 11:53hgbotStatusnew => resolved
2012-08-07 11:53hgbotResolutionopen => fixed
2012-08-07 11:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/189304df4f4c2b6d245adcd5815ade55fa604562 [^]
2012-08-07 12:36miruritaNote Added: 0051140
2012-08-07 12:36miruritaStatusresolved => new
2012-08-07 12:36miruritaResolutionfixed => open
2012-08-07 13:24AugustoMauchAssigned ToAugustoMauch => mtaal
2012-08-21 10:03AugustoMauchClosed by => marvintm
2012-08-21 10:06hgbotCheckin
2012-08-21 10:06hgbotNote Added: 0051418
2012-08-21 10:06hgbotStatusnew => resolved
2012-08-21 10:06hgbotResolutionopen => fixed
2012-08-21 10:06hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/189304df4f4c2b6d245adcd5815ade55fa604562 [^] => http://code.openbravo.com/erp/devel/pi/rev/978a3dc1d8c35872ca8158eceb750b512eb7decf [^]
2012-08-29 14:03miruritaNote Added: 0051631
2012-08-29 14:03miruritaStatusresolved => new
2012-08-29 14:03miruritaResolutionfixed => open
2012-08-29 16:50mtaalFile Added: 21229.diff
2012-08-29 16:52mtaalNote Added: 0051639
2012-08-29 17:56miruritaNote Added: 0051647
2012-08-29 18:00hgbotCheckin
2012-08-29 18:00hgbotNote Added: 0051648
2012-08-29 18:00hgbotStatusnew => resolved
2012-08-29 18:00hgbotResolutionopen => fixed
2012-08-29 18:00hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/978a3dc1d8c35872ca8158eceb750b512eb7decf [^] => http://code.openbravo.com/erp/devel/pi/rev/3ef959ea86a725daf82f8bfb3d6588845280bc0e [^]
2012-09-01 01:03hudsonbotCheckin
2012-09-01 01:03hudsonbotNote Added: 0051739
2012-09-03 13:21AugustoMauchClosed bymarvintm => AugustoMauch
2012-09-03 13:21AugustoMauchNote Added: 0051768
2012-09-03 13:21AugustoMauchStatusresolved => closed
2012-09-03 13:21AugustoMauchFixed in Version => 3.0MP15

Notes
(0050951)
mirurita   
2012-07-27 15:21   
This fix is very important for Contract Management project.
(0051138)
hgbot   
2012-08-07 11:53   
Repository: erp/devel/pi
Changeset: 189304df4f4c2b6d245adcd5815ade55fa604562
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Aug 07 11:52:39 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/189304df4f4c2b6d245adcd5815ade55fa604562 [^]

Fixes issue 21229: Parent property of tabs has been fixed

It was not possible to create new records in child tabs whose table was the same as its parent tab. This had not been a problem so far because all these tabs
were read only or single row, and in both cases it was not possible to add a new record.

The bug was located in the getParentProperty method of the OBViewTab class. Now it is taken into account the UIPattern of the tab, so if the tab is not read o
nly nor single row, it will be possible to add new lines.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewTab.java
---
(0051140)
mirurita   
2012-08-07 12:36   
When deleting any 'Line' record you get the following error:
Error
deleted object would be re-saved by cascade (remove deleted object from associations): [Project#5C4EBA0A73844C6FB218B1A3D82C6F2F]
(0051418)
hgbot   
2012-08-21 10:06   
Repository: erp/devel/pi
Changeset: 978a3dc1d8c35872ca8158eceb750b512eb7decf
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Aug 21 10:05:02 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/978a3dc1d8c35872ca8158eceb750b512eb7decf [^]

Fixes issue 21229: Child records can be deleted

If the child tab belongs to the same table than its parent tab, it was not possible to delete records from the child tab. This has been fixed by deleting the record in a separate transaction.

---
M modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
---
(0051631)
mirurita   
2012-08-29 14:03   
it is working if you select only one line.

but if you do a multiple selection it fails with the same error
deleted object would be re-saved by cascade (remove deleted object from associations): [Project#4AD53AC688CD407389CD9DEEE90482AB]
(0051639)
mtaal   
2012-08-29 16:52   
Hi Mikel,
I uploaded a new diff, can you retry it with this diff?

gr. Martin
(0051647)
mirurita   
2012-08-29 17:56   
Hi Martin,

Tested and working. I'm able to delete multiple contract lines.

Mikel.
(0051648)
hgbot   
2012-08-29 18:00   
Repository: erp/devel/pi
Changeset: 3ef959ea86a725daf82f8bfb3d6588845280bc0e
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Aug 29 18:00:12 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3ef959ea86a725daf82f8bfb3d6588845280bc0e [^]

Fixes issue 21229 Nested tabs built based on a hierarchycal structure of a same table does not work.
Also do flush/clear when deleting multiple records

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/MultipleDeleteActionHandler.java
---
(0051739)
hudsonbot   
2012-09-01 01:03   
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/05b3ea484705 [^]

Maturity status: Test
(0051768)
AugustoMauch   
2012-09-03 13:21   
Code reviewed and verified in pi@288baadd3b3c