default value create when init client avoid packout/packin by duplicate value


2pack use UU column or id column to lookup record for insert/update.

i saw 2 case it's hard to over when export from one client and import to other client
1. default record like product standard, tax standard, business partner standard.
2. init record like doc type

for case 1, can rename to default value at export client or import client, or just filter out it.

for case 2, can't filter out. Rename make messy up. so can't export/import document like payment, invoice,...

maybe solution is:
define a table at system level (table id, column map, value map).
on this table define record will matching special.
example (123, "Name", "AP Invoice")
mean table C_DocType record have name = "AP Invoice" will use name to lookup record.




Hiep Lq
November 22, 2017, 11:05 AM

this change to handle default value of default record, so i think it should maintain global because it's same for every 2pack.
it also can add customize record to handle other case, on that case, implement can use a separate 2pack or also pack with main 2pack.
so ít's ok to change name to "2Pack Reference Lookup"

Carlos Ruiz
December 6, 2017, 3:33 PM

I think 2pack was not designed as the tool to move data from different environments and different tenants.

Mostly is intended to move things where everybody shares the same UUID - similar scenario can be seen if you have several developers creating the same element in different databases.

We expanded 2pack to be able to replicate data from a seed tenant to other tenants - within the same environment - this is the intention of ad_package_uuid_map

But, IMHO this scenario sounds more to be managed via CSV import files, and I wonder if 2pack is an overkill for this.

Hiep Lq
December 6, 2017, 3:54 PM

my purpose to import master data when create a new client.
it for test or client template. 2pack is strong than csv on this zone, it easy to define relation data.

for some kind of data like product, business partner can bypass by don't use standard item.
but for document type can't use this way.

Carlos Ruiz
December 6, 2017, 3:56 PM

I think in your case you can do ad_package_uuid_map work - but would need to do some pre-process to fill the ad_package_uuid_map table with the source UUID from your source database and the target UUID from your new created tenant.

That could be done automatically in some post-process of Initial Client Setup

Hiep Lq
December 7, 2017, 12:36 AM

you'r correct, need a sql scrip to maintain UUID matching. thanks




Hiep Lq


Tested By