Skip to content

Commit

Permalink
partner_import_helper: improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Aug 21, 2023
1 parent 16cc87e commit d00f3ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions partner_import_helper/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
Partner Import Helper
=====================

This module add methods to help on the import of partners:
This module adds methods to help on the import of partners:

- help to match a country ID from a country name
- help to match title
- help to validate email adresses
- remap street2 to street if street is empty
- help to pre-validate IBANs, VAT, SIREN, SIRET and avoid a raise during
- help to pre-validate IBANs, VAT, SIREN, SIRET and avoid a raise during import
- check that the SIREN/SIRET is consistant with the French VAT number
- show a warning log if the VAT and/or IBAN starts with a country code that is different from the country of the partner (with special case for Greece and Northern Ireland VAT numbers)

If it cannot find the country from the country name by comparing the imported country name with the list of countries in res.country in all the installed languages (the comparaison is made after converting to lower case, removing spaces and accents), it will ask `ChatGPT <https://chat.openai.com/>`_ to tell him the ISO country code corresponding to that country name. To make it work, you need to have an OpenAI API key.
If it cannot find the country from the country name by comparing the imported country name with the list of countries in res.country in all the installed languages (the comparaison is made after converting to lower case and removing spaces and accents), it will ask `ChatGPT <https://chat.openai.com/>`_ to tell him the ISO country code corresponding to that country name. To make it work, you need to have an OpenAI API key.

Configuration
=============
Expand Down Expand Up @@ -47,13 +47,13 @@ Here is some sample code:
return action # show import logs to the user
In the sample code above, vals is the dict that will be passed to create(), with few differences:
In the sample code above, ``vals`` is the dictionary that will be passed to ``create()``, with few differences:

- it must contain a **'line'** key to indicate the Excel/CSV import ref in logs, which will be removed before calling *create()*,
- it must contain a **'line'** key to indicate the Excel/CSV import ref in logs, which will be removed before calling ``create()``,
- it can contain a **'country_name'** key with the name of the country, that will be replaced by the native **'country_id'** key
- it can contain a **'title_code'** key with possible values 'madam', 'miss', 'mister', 'doctor' or 'prof' that will be replaced by the native **'title'** key
- it can contain an **'iban'** key, that will be replaced by **'bank_ids': [(0, 0, {'acc_number': xxx})]** if the IBAN is valid
- along with the 'iban' key, it can contain a **'bic'** key and a **'bank_name'** key that will be replaced by **'bank_ids': [(0, 0, {'acc_number': xxxx, 'bank_id': bank_id})]**. The bank will be created on the fly if the BIC is not already present in the Odoo database, unless *create_bank=False* is passed as argument of the method *_import_create()*.
- along with the 'iban' key, it can contain a **'bic'** key and a **'bank_name'** key that will be replaced by **'bank_ids': [(0, 0, {'acc_number': xxxx, 'bank_id': bank_id})]**. The bank will be created on the fly if the BIC is not already present in the Odoo database, unless ``create_bank=False`` is passed as argument of the method ``_import_create()``.

Author
======
Expand Down

0 comments on commit d00f3ec

Please sign in to comment.