Remove migration before 3.0
issue6470 review52421002
This commit is contained in:
1 parent
31f55bc859
commit
259e792e65
3 files changed
+1
-40
No files matched your search
+1
-3
@@ -125,10 +125,8 @@ class OrderPoint(ModelSQL, ModelView):
|
||||
def __register__(cls, module_name):
|
||||
cursor = Transaction().connection.cursor()
|
||||
sql_table = cls.__table__()
|
||||
|
||||
# Migration from 2.2
|
||||
table = cls.__table_handler__(module_name)
|
||||
table.drop_constraint('check_min_max_quantity')
|
||||
|
||||
# Migration from 4.2
|
||||
table.drop_constraint('check_max_qty_greater_min_qty')
|
||||
table.not_null_action('min_quantity', 'remove')
|
||||
|
||||
@@ -29,18 +29,6 @@ class PurchaseRequest(metaclass=PoolMeta):
|
||||
'Purchase Request'
|
||||
__name__ = 'purchase.request'
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
cursor = Transaction().connection.cursor()
|
||||
sql_table = cls.__table__()
|
||||
super(PurchaseRequest, cls).__register__(module_name)
|
||||
|
||||
# Migration from 2.0: empty order point origin is -1 instead of 0
|
||||
cursor.execute(*sql_table.update(
|
||||
columns=[sql_table.origin],
|
||||
values=['stock.order_point,-1'],
|
||||
where=sql_table.origin == 'stock.order_point,0'))
|
||||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
origins = super(PurchaseRequest, cls)._get_origin()
|
||||
|
||||
-25
@@ -2,9 +2,6 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
|
||||
from sql import Table
|
||||
from sql.functions import Overlay, Position
|
||||
|
||||
from trytond.model import ModelView, ModelSQL
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
@@ -15,28 +12,6 @@ __all__ = ['ShipmentInternal']
|
||||
class ShipmentInternal(ModelSQL, ModelView):
|
||||
__name__ = 'stock.shipment.internal'
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
cursor = Transaction().connection.cursor()
|
||||
model_data = Table('ir_model_data')
|
||||
model = Table('ir_model')
|
||||
# Migration from 1.2: packing renamed into shipment
|
||||
cursor.execute(*model_data.update(
|
||||
columns=[model_data.fs_id],
|
||||
values=[Overlay(model_data.fs_id, 'shipment',
|
||||
Position('packing', model_data.fs_id),
|
||||
len('packing'))],
|
||||
where=model_data.fs_id.like('%packing%')
|
||||
& (model_data.module == module_name)))
|
||||
cursor.execute(*model.update(
|
||||
columns=[model.model],
|
||||
values=[Overlay(model.model, 'shipment',
|
||||
Position('packing', model.model),
|
||||
len('packing'))],
|
||||
where=model.model.like('%packing%')
|
||||
& (model.module == module_name)))
|
||||
super(ShipmentInternal, cls).__register__(module_name)
|
||||
|
||||
@classmethod
|
||||
def generate_internal_shipment(cls, clean=True):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user