diff --git a/netforce_clinic/migrations/reset_hdcase_number.py b/netforce_clinic/migrations/reset_hdcase_number.py index 0ff6366..971e832 100644 --- a/netforce_clinic/migrations/reset_hdcase_number.py +++ b/netforce_clinic/migrations/reset_hdcase_number.py @@ -18,9 +18,9 @@ class Migration(migration.Migration): ] for hdcase in get_model("clinic.hd.case").search_browse(dom): nums=hdcase.number.split("-") - if len(nums)==3 and len(nums[2])==6: - run=nums[2] - number='-'.join([nums[0],nums[1]+run[0:2],run[2:]]) + if len(nums)==3 and len(nums[1])==4: + run=nums[1] + number='-'.join([nums[0],run[0:2],run[2:],nums[2]]) print('XXX', hdcase.number, ' --> ', number) hdcase.write({ 'number': number,