export CoA openbravo via sql

this blog post will share how to export Openbravo chart of account (CoA) using sql query. exporting CoA is helpfull, especially when we need to reconfigure CoA using openbravo user interface, then we need to deploy configured CoA to another openbravo instance.Openbravo require specific CSV format when you upload COA. you can use this sql query to produce a table which is suitable with openbravo requirement.

select ev.value as "SearchKey", ev.name as "Name", ev.description as "Description", ev.accounttype as "Type", 
 ev.accountsign as "Sign", ev.isdoccontrolled as "Document", ev.issummary as "Summary", 
 ev2.value as "Parent", ev.elementlevel as "Level", '' as "Operands"
from c_elementvalue ev
left join ad_treenode tn on tn.node_id=ev.c_elementvalue_id
left join c_elementvalue ev2 on ev2.c_elementvalue_id=tn.parent_id
where ev.ad_client_id='AE56E7FBDE964A198A5CD83CEB9EC51D'

you can chante ad_client_id with your desired client to be exported. this sql query does not include operand (costumized element sub tab inside account tree window). future update on this blog post will explain it.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s