clinic/netforce_clinic/migrations/import_acc.py

23 lines
587 B
Python
Raw Normal View History

from netforce.model import get_model
from netforce import migration
class Migration(migration.Migration):
2015-02-12 08:52:35 +00:00
_name="import.acc"
_version="2.10.0"
def migrate(self):
cbv_id=24
cbv=get_model("conv.bal").browse(cbv_id)
cbv.write({
2015-02-12 08:52:35 +00:00
'file': 'tb.csv',
})
2015-02-12 08:52:35 +00:00
print("import acc file (step 1) running ...")
cbv.write({
2015-02-12 08:52:35 +00:00
'file': 'ar.csv',
})
2015-02-12 08:52:35 +00:00
print("import sale file (step 2)running ...")
get_model("conv.bal").import_sale_file([cbv.id],context={})
return True
Migration.register()