"Start migration to 6.0 [SKIP CI]."
This commit is contained in:
parent
4514727634
commit
959d8decad
8
sale.py
8
sale.py
|
@ -11,7 +11,7 @@ __all__ = ['Sale', 'SaleLine', 'ChangeLineQuantityStart', 'ChangeLineQuantity']
|
|||
|
||||
class Sale(metaclass=PoolMeta):
|
||||
__name__ = 'sale.sale'
|
||||
productions = fields.Function(fields.One2Many('production', None,
|
||||
productions = fields.Function(fields.Many2Many('production', None, None,
|
||||
'Productions'), 'get_productions')
|
||||
|
||||
@classmethod
|
||||
|
@ -40,7 +40,7 @@ class Sale(metaclass=PoolMeta):
|
|||
@classmethod
|
||||
def process(cls, sales):
|
||||
for sale in sales:
|
||||
if sale.state in ('done', 'cancel'):
|
||||
if sale.state in ('done', 'cancelled'):
|
||||
continue
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
sale.create_productions()
|
||||
|
@ -250,7 +250,7 @@ class ChangeLineQuantityStart(metaclass=PoolMeta):
|
|||
produced_quantity = 0
|
||||
productions = self.line.productions if self.line else []
|
||||
for production in productions:
|
||||
if production.state in ('assigned', 'running', 'done', 'cancel'):
|
||||
if production.state in ('assigned', 'running', 'done', 'cancelled'):
|
||||
produced_quantity += Uom.compute_qty(production.uom,
|
||||
production.quantity, self.line.unit)
|
||||
|
||||
|
@ -285,7 +285,7 @@ class ChangeLineQuantity(metaclass=PoolMeta):
|
|||
quantity = self.start.new_quantity
|
||||
|
||||
for production in line.productions:
|
||||
if production.state in ('assigned', 'running', 'done', 'cancel'):
|
||||
if production.state in ('assigned', 'running', 'done', 'cancelled'):
|
||||
quantity -= Uom.compute_qty(production.uom,
|
||||
production.quantity, self.start.line.unit)
|
||||
if quantity < 0:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[tryton]
|
||||
version=5.0.0
|
||||
version=6.0.0
|
||||
depends:
|
||||
production_origin
|
||||
sale
|
||||
|
|
Loading…
Reference in New Issue