diff --git a/order_point.py b/order_point.py index cc92bd01a5..7d562101fd 100644 --- a/order_point.py +++ b/order_point.py @@ -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') diff --git a/purchase_request.py b/purchase_request.py index b72f7603bb..97db6c100d 100644 --- a/purchase_request.py +++ b/purchase_request.py @@ -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() diff --git a/shipment.py b/shipment.py index 9ed01965d0..6ef998f4ba 100644 --- a/shipment.py +++ b/shipment.py @@ -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): """