migration prefix
parent
a6de84a6bf
commit
b9264098d3
|
@ -7,8 +7,25 @@ class Migration(migration.Migration):
|
||||||
|
|
||||||
def migrate(self):
|
def migrate(self):
|
||||||
res=get_model("clinic.setting").search([])
|
res=get_model("clinic.setting").search([])
|
||||||
if res:
|
if not res:
|
||||||
return
|
|
||||||
get_model("clinic.setting").create({})
|
get_model("clinic.setting").create({})
|
||||||
|
|
||||||
|
seq_names=[
|
||||||
|
('HDC-','Clinic HD Case'),
|
||||||
|
('VS-', 'Clinic Visit'),
|
||||||
|
('PT-', 'Clinic Patient'),
|
||||||
|
('DT-', 'Clinic Doctor'),
|
||||||
|
('NS-', 'Clinic Nurse'),
|
||||||
|
]
|
||||||
|
for prefix, seq_name in seq_names:
|
||||||
|
seq_ids=get_model('sequence').search([['name','=',seq_name]])
|
||||||
|
if not seq_ids:
|
||||||
|
get_model("sequence").create({
|
||||||
|
'prefix': prefix,
|
||||||
|
'name': seq_name,
|
||||||
|
'type': 'other',
|
||||||
|
})
|
||||||
|
print("create seq %s successfully " % seq_name)
|
||||||
|
return
|
||||||
|
|
||||||
Migration.register()
|
Migration.register()
|
||||||
|
|
Loading…
Reference in New Issue