Problème importation adresses

Bonjour,

J’ai un problème de liaison entre les partner et les adresses, je ne comprends pas pourquoi ces derniers ne se lient pas … C’est-à-dire que les adresses se créent, les partner aussi, mais dans la fiche partner il n’y a pas l’adresse qui est pourtant bien renseignée via son id dans le csv.

Merci pour votre aide

Bonjour, sur quelle version d’axelor? Ca fonctionne sur la 5.0.4 pour moi. La colonne a mettre dans base_partner doit avoir comme en tête “address”
et les lignes suivantes doivent figurer dans le fichier xml de conf:

<bind to="partnerAddressList" search="self.address.importId = :address" if="address != null &amp;&amp; isContact == 'false'">
		    <bind to="address" search="self.importId = :address" update="true" />
		    <bind to="isInvoicingAddr" eval="true" />
		    <bind to="isDeliveryAddr" eval="true" />
		    <bind to="isDefaultAddr" eval="true" />
</bind>

<input file="base_address.csv" separator=";" type="com.axelor.apps.base.db.Address" search="self.importId = :importId" call="com.axelor.csv.script.ImportAddress:importAddress">

Bonjour, lors de l’importation mettre en ligne les fichiers csv dans l’ordre suivant :

1 : Fichier address
2 : Fichier partner
3 : Fichier partner.Address (qui va faire le lien entre la base des partenaires et des adresses)

Ces 3 fichiers sont nécessaires pour que les adresses s’importent correctement. Pour les fichiers bind et csv, il est plus simple de reprendre le modèle fourni par Axelor.

En espérant que cela puisse aider quelqu’un d’autre.

Hi Joel,
For the 3. Partner.Address file. May I know where to obtain it?

I have done step 1 and step 2. But can’t seem to link the 2 together, which is the step 3.

Thanks.

Hello Andrew,
Looks like the file name has to be PartnerAddress without the « . »
Hope this helps!

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.

  1. 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>

  1. Import Partner
    This is as per the demo source, with address which is the above Address importID

  2. 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.

  3. Export Partner
    Create a export like this.
    The purpose is to find out the partner fullname

  4. Export Partner Address
    Create a export like this

When Axelor exports, it uses Title, but when it import, it uses Target Field.

  1. 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.

  1. 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>

  1. 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.

Apology, the Step 6 importID is just a number you assigned. It will be the next incremental number after Step 5 : Export PartnerAddress