Delete stock moves from components when applying amendment
issue11355 review386301002
This commit is contained in:
1 parent
75c8539199
commit
16e6db2fdd
3 files changed
+26
No files matched your search
@@ -33,6 +33,7 @@ def register():
|
||||
sale.HandleShipmentException,
|
||||
module='product_kit', type_='wizard', depends=['sale'])
|
||||
Pool.register(
|
||||
sale.Amendment,
|
||||
sale.AmendmentLine,
|
||||
module='product_kit', type_='model', depends=['sale_amendment'])
|
||||
Pool.register(
|
||||
@@ -48,5 +49,6 @@ def register():
|
||||
purchase.HandleShipmentException,
|
||||
module='product_kit', type_='wizard', depends=['purchase'])
|
||||
Pool.register(
|
||||
purchase.Amendment,
|
||||
purchase.AmendmentLine,
|
||||
module='product_kit', type_='model', depends=['purchase_amendment'])
|
||||
+12
@@ -143,5 +143,17 @@ class HandleShipmentException(
|
||||
__name__ = 'purchase.handle.shipment.exception'
|
||||
|
||||
|
||||
class Amendment(metaclass=PoolMeta):
|
||||
__name__ = 'purchase.amendment'
|
||||
|
||||
@classmethod
|
||||
def _stock_moves(cls, line):
|
||||
yield from super()._stock_moves(line)
|
||||
for component in line.components:
|
||||
for move in component.moves:
|
||||
if move.state == 'draft':
|
||||
yield move
|
||||
|
||||
|
||||
class AmendmentLine(AmendmentLineMixin, metaclass=PoolMeta):
|
||||
__name__ = 'purchase.amendment.line'
|
||||
@@ -158,5 +158,17 @@ class HandleShipmentException(
|
||||
__name__ = 'sale.handle.shipment.exception'
|
||||
|
||||
|
||||
class Amendment(metaclass=PoolMeta):
|
||||
__name__ = 'sale.amendment'
|
||||
|
||||
@classmethod
|
||||
def _stock_moves(cls, line):
|
||||
yield from super()._stock_moves(line)
|
||||
for component in line.components:
|
||||
for move in component.moves:
|
||||
if move.state == 'draft':
|
||||
yield move
|
||||
|
||||
|
||||
class AmendmentLine(AmendmentLineMixin, metaclass=PoolMeta):
|
||||
__name__ = 'sale.amendment.line'
|
||||
Reference in new issue
Block a user