changeset dd86a4a67170 in modules/party:default
details: https://hg.tryton.org/modules/party?cmd=changeset;node=dd86a4a67170
description:
Use correct type for Chinese Resident Identity Card Number
issue9873
review337091003
diffstat:
party.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (31 lines):
diff -r 1cf55fedbd10 -r dd86a4a67170 party.py
--- a/party.py Sat Dec 19 17:08:45 2020 +0100
+++ b/party.py Sat Dec 19 22:41:14 2020 +0100
@@ -336,7 +336,7 @@
('ch_uid', "Swiss Business Identifier"),
('ch_vat', "Swiss VAT Number"),
('cl_rut', "Chilean National Tax Number"),
- ('cn_rit', "Chinese Resident Identity Card Number"),
+ ('cn_ric', "Chinese Resident Identity Card Number"),
('co_nit', "Colombian Identity Code"),
('co_rut', "Colombian Business Tax Number"),
('cr_cpf', "Costa Rica Physical Person ID Number"),
@@ -447,6 +447,7 @@
Party = pool.get('party.party')
cursor = Transaction().connection.cursor()
party = Party.__table__()
+ table = cls.__table__()
super().__register__(module_name)
@@ -474,6 +475,10 @@
party_h.drop_column('vat_number')
party_h.drop_column('vat_country')
+ # Migration from 5.8: Rename cn_rit into cn_ric
+ cursor.execute(*table.update([table.type], ['cn_ric'],
+ where=(table.type == 'cn_rit')))
+
@fields.depends('type', 'code')
def on_change_with_code(self):
if self.type and '_' in self.type: