changeset 2:b009a7515720

Use identifier for vat
author Cédric Krier <ced@b2ck.com>
date Sun, 11 Jun 2017 21:43:42 +0200
parents ac6b5cf3a6d3
children e1d3f7a0a7d9
files migration.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/migration.py	Fri May 08 12:20:55 2015 +0200
+++ b/migration.py	Sun Jun 11 21:43:42 2017 +0200
@@ -166,7 +166,9 @@
         party.code = str(partner.id)
         party.active = partner.active
         party.lang = code2lang.get(partner.lang)
-        party.vat_number = partner.vat
+        if partner.vat:
+            identifier = party.identifiers.new(type='eu_VAT')
+            identifier.code = partner.vat
         if partner.website:
             website = party.contact_mechanisms.new(type='website')
             website.value = partner.website