Use new TableHandler
This commit is contained in:
1 parent
6878288764
commit
1b80bfd95b
1 file changed
+6
-7
+6
-7
@@ -3,12 +3,12 @@
|
||||
"Purchase"
|
||||
|
||||
from trytond.osv import fields, OSV
|
||||
from decimal import Decimal
|
||||
import datetime
|
||||
from trytond.netsvc import LocalService
|
||||
from trytond.report import CompanyReport
|
||||
from trytond.wizard import Wizard, WizardOSV
|
||||
from trytond.sql_db import table_handler
|
||||
from trytond.backend import TableHandler
|
||||
from decimal import Decimal
|
||||
import datetime
|
||||
|
||||
_STATES = {
|
||||
'readonly': "state != 'draft'",
|
||||
@@ -834,14 +834,13 @@ class PurchaseLine(OSV):
|
||||
|
||||
def init(self, cursor, module_name):
|
||||
super(PurchaseLine, self).init(cursor, module_name)
|
||||
table = table_handler(cursor, self._table, self._name, module_name)
|
||||
table = TableHandler(cursor, self._table, self._name, module_name)
|
||||
|
||||
# Migration from 1.0 comment change into note
|
||||
if 'comment' in table.table:
|
||||
if table.column_exist('comment'):
|
||||
cursor.execute('UPDATE "' + self._table + '" ' \
|
||||
'SET note = comment')
|
||||
cursor.execute('ALTER TABLE "' + self._table + '" ' \
|
||||
'DROP COLUMN comment')
|
||||
table.drop_column('comment', exception=True)
|
||||
|
||||
def default_type(self, cursor, user, context=None):
|
||||
return 'line'
|
||||
|
||||
Reference in new issue
Block a user