Hi Joel,
Thanks and I have figured out the workflow, which I share here. Maybe the steps are not correct but works for me. Took 3 days to understand this plus your guide.
- Import Address
Header as follows, mostly in L4 onwards
Config xml is
<?xml version="1.0" encoding="UTF-8"?>
<csv-inputs xmlns=« http://axelor.com/xml/ns/data-import »
xmlns:xsi=« http://www.w3.org/2001/XMLSchema-instance »
xsi:schemaLocation=« http://axelor.com/xml/ns/data-import http://axelor.com/xml/ns/data-import/data-import_5.4.xsd »>
<input file="(yourfile).csv" separator=";" type=« com.axelor.apps.base.db.Address »
search=« self.importId = :importId » call=« com.axelor.csv.script.ImportAddress:importAddress »>
</csv-inputs>
-
Import Partner
This is as per the demo source, with address which is the above Address importID
-
Export Address
Go to Application Config-> Technical maintenance → Advanced Export
Create a export with this.
The purpose is to find out the mainaddress full name.
I notice that this is not a datafield as the script uses concat function.
-
Export Partner
Create a export like this.
The purpose is to find out the partner fullname
-
Export Partner Address
Create a export like this
When Axelor exports, it uses Title, but when it import, it uses Target Field.
- Modify the Partner Address into Target fields
I prefer this, unless you want to use the binding function in xml.
This is what I used to import
The importID is the Partner import ID (step 4)
The partner.fullname is the name from the Partner file (step 4)
The address fullname is from step 3.
- Create import.xml
I create this, and removed the « updating=true ». This creates the entry in com.axelor.apps.base.db.PartnerAddress
<?xml version="1.0" encoding="UTF-8"?>
<csv-inputs xmlns=« http://axelor.com/xml/ns/data-import »
xmlns:xsi=« http://www.w3.org/2001/XMLSchema-instance »
xsi:schemaLocation=« http://axelor.com/xml/ns/data-import http://axelor.com/xml/ns/data-import/data-import_5.4.xsd »>
<input file="(yourfile).csv" separator=";" type=« com.axelor.apps.base.db.PartnerAddress »
search=« self.importId = :importId »/>
</csv-inputs>
- Import in the PartnerAddress.
To verify, you can export PartnerAddress in step 5.
And should see the new entry.
Though in my edition, I edit the partner file to include
- Company String
- Acccounting
- Main Address
As i realize the default partner file do not import those above fields.
Hope it helps. Thanks.