trytond-edocument_edifact/stock.py

33 lines
1018 B
Python
Raw Normal View History

2018-05-02 13:50:39 +02:00
# The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
2018-05-02 13:50:39 +02:00
2019-02-28 13:56:45 +01:00
class Configuration(metaclass=PoolMeta):
2018-05-02 13:50:39 +02:00
__name__ = 'stock.configuration'
2018-07-24 11:24:26 +02:00
@classmethod
def __register__(cls, module_name):
super().__register__(module_name)
2018-07-24 11:24:26 +02:00
table = cls.__table_handler__(module_name)
for field in ['edocument_sequence', 'EDI_output_path']:
if table.column_exist(field):
table.drop_column(field)
2018-07-24 11:24:26 +02:00
2019-02-28 13:56:45 +01:00
class ConfigurationSequence(metaclass=PoolMeta):
2018-07-24 11:24:26 +02:00
__name__ = 'stock.configuration.sequence'
@classmethod
def __register__(cls, module_name):
table_h = cls.__table_handler__(module_name)
exist = table_h.table_exist(cls._table)
2018-09-25 22:46:26 +02:00
if exist:
exist &= table_h.column_exist('edocument_sequence')
2018-07-24 11:24:26 +02:00
super().__register__(module_name)
2018-07-24 11:24:26 +02:00
if table_h.column_exist('edocument_sequence'):
table_h.drop_column('edocument_sequence')