Added migration code for customer_location deletion

This commit is contained in:
Bertrand Chenal committed 2009-01-27 18:13:08 +01:00
1 parent 09ed7c5680
commit 6eff5d07e8
1 file changed
+7
+7
View File
@@ -6,6 +6,7 @@ from trytond.netsvc import LocalService
import datetime
from trytond.report import CompanyReport
from trytond.wizard import Wizard, WizardOSV
from trytond.sql_db import table_handler
STATES = {
'readonly': "state in ('cancel', 'done')",
@@ -500,6 +501,12 @@ class PackingOut(OSV):
]
self._order[0] = ('id', 'DESC')
def _auto_init(self, cursor, module_name):
super(PackingOut, self)._auto_init(cursor, module_name)
th = table_handler(cursor, self._table, self._name, module_name)
if 'customer_location' in th.table:
th.drop_column('customer_location')
def default_state(self, cursor, user, context=None):
return 'draft'