|View Issue Details|
|Type||Category||Severity||Reproducibility||Date Submitted||Last Update|
|defect||[Openbravo ERP] A. Platform||major||always||2019-03-05 16:00||2019-03-08 11:11|
|Priority||normal||Resolution||no change required||Fixed in Version|
|Status||closed||Fix in branch||Fixed in SCM revision|
|OS Version||Database version||Ant version|
|Product Version||SCM revision|
|Review Assigned To||jarmendariz|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
0040321: Create Columns from DB not working fine with views
|Description||It seems the process is not working fine for views and only when called from the UI. However it seems to work when called directly from the database (ad_table_import or ad_table_import0).|
|Steps To Reproduce||Create the following view directly in PostgreSQL:|
CREATE OR REPLACE VIEW c_mytest AS
SELECT l.c_orderline_id c_mytest_id, l.ad_client_id as AD_CLIENT_ID, l.ad_org_id as AD_ORG_ID, l.isactive as ISACTIVE,
l.created as CREATED, l.createdby as CREATEDBY, o.updated as UPDATED, l.updatedby as UPDATEDBY,
o.c_bpartner_id, o.datePromised, o.m_warehouse_id, o.documentno,
l.m_product_id, l.qtyOrdered - l.qtyDelivered as pendingToDeliverQty, l.c_uom_id
FROM C_Order o
JOIN C_OrderLine l on (o.c_order_id = l.c_order_id)
WHERE o.issotrx = 'Y'
AND o.docstatus = 'CO'
Login as System Admin in Openbravo.
Go to Module window and set Core as indevelopment.
In Tables And Columns window enter a new record for the view c_mytest and fill the necessary fields.
Set View flag, unset Deletable Records [NICE TO HAVE: this flag should be automatically unset for views].
Press the Create Columns from DB. An error is raised informing about missing columns.
Now in PG run and write down the output:
select ad_pinstance_id from ad_pinstance order by created desc limit 1;
select ad_table_import0(<previous ad_pinstance_id>) from dual;
Verify the process is completed successfully.
Go back to the Tables and Columns window, search the previously created record.
Verify the Columns are properly inserted.
|Tags||No tags attached.|
I reproduced this issue by creating the View using the "postgres" user instead of "tad". For this reason, the c_mytest view cannot be accesed via backoffice but the column generation procedure works as expected in the console.
To make this work, just execute the following after creating the view:
alter table c_mytest
owner to tad;
|2019-03-05 16:00||vmromanos||New Issue|
|2019-03-05 16:00||vmromanos||Assigned To||=> platform|
|2019-03-05 16:00||vmromanos||Modules||=> Core|
|2019-03-05 16:00||vmromanos||Triggers an Emergency Pack||=> No|
|2019-03-07 13:51||jarmendariz||Assigned To||platform => jarmendariz|
|2019-03-07 13:51||jarmendariz||Status||new => acknowledged|
|2019-03-08 11:01||jarmendariz||Relationship added||related to 0040341|
|2019-03-08 11:02||jarmendariz||Status||acknowledged => scheduled|
|2019-03-08 11:11||jarmendariz||Review Assigned To||=> jarmendariz|
|2019-03-08 11:11||jarmendariz||Note Added: 0110311|
|2019-03-08 11:11||jarmendariz||Status||scheduled => closed|
|2019-03-08 11:11||jarmendariz||Resolution||open => no change required|
|Copyright © 2000 - 2009 MantisBT Group|