Cannot import a product exported with 2pack export button

Description

Hi, I tried exporting a product from demo instance and importing it into my local instance.

Found three issues:

1 - The import fails because it tries to insert the M_Product_Acct record exported, but when creating the product on MProduct.afterSave that record is automatically created, so it throws a non-unique exception and fails - note the auto-created record ends with a different UUID than the created one, and possibly with different accounting configuration in case it was modified

2 - To overcome that I deleted the M_Product_Acct from the xml and tried again, this time the import failed because MCost was not able to find the product.
There is a problem in MCost.beforeSave if the product and the cost are created within the same transaction, because is trying to look for the product out of trx and it cannot find it, the following patch fixed this issue:

3 - But after that it raised same problem as (1) but with M_Cost table, the M_Cost table is auto-created on MProduct.beforeSave and it cannot be inserted here - same as (1) the cost has different UUID and it can end in a different cost than the intended (in this case it sounds fine as it requires an initial cost of zero)

Regards,

Carlos Ruiz

Environment

None

Assignee

Unassigned

Reporter

Carlos Ruiz

Tested By

None

Components

Affects versions

Priority

Minor
Configure