Files
tryton/modules/sale_shipment_tolerance/stock.py
T

31 lines
877 B
Python
Raw Normal View History

2017-08-28 23:37:42 +02:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, Workflow
2021-12-11 17:58:44 +01:00
from trytond.pool import Pool, PoolMeta
2017-08-28 23:37:42 +02:00
2018-06-26 19:11:54 +02:00
class Move(metaclass=PoolMeta):
2017-08-28 23:37:42 +02:00
__name__ = 'stock.move'
@classmethod
def check_over_shipment(cls, moves):
pool = Pool()
SaleLine = pool.get('sale.line')
for move in moves:
if isinstance(move.origin, SaleLine):
move.origin.check_over_shipment()
@classmethod
@ModelView.button
@Workflow.transition('done')
def do(cls, moves):
2025-04-04 00:45:18 +02:00
super().do(moves)
2017-08-28 23:37:42 +02:00
cls.check_over_shipment(moves)
@classmethod
@ModelView.button
@Workflow.transition('assigned')
def assign(cls, moves):
2025-04-04 00:45:18 +02:00
super().assign(moves)
2017-08-28 23:37:42 +02:00
cls.check_over_shipment(moves)