28 lines
787 B
Python
28 lines
787 B
Python
from datetime import datetime
|
|
|
|
from netforce.model import get_model
|
|
from netforce import migration
|
|
from netforce.access import set_active_user, get_active_user, set_active_company, get_active_company
|
|
|
|
class Migration(migration.Migration):
|
|
_name="clinic.hd.case"
|
|
_version="2.11.0"
|
|
|
|
def migrate(self):
|
|
user_id=get_active_user()
|
|
company_id=get_active_company()
|
|
set_active_company(1)
|
|
set_active_user(1)
|
|
for hdcase in get_model("clinic.hd.case").search_browse([]):
|
|
note=hdcase.note or ''
|
|
note='%s '%note
|
|
vals={
|
|
'note': note,
|
|
}
|
|
hdcase.write(vals)
|
|
set_active_company(company_id)
|
|
set_active_user(user_id)
|
|
return True
|
|
|
|
Migration.register()
|