Files
odoo_source/addons/procurement_jit/sale.py
T
Joren Van Onder 6e931e4e3c [IMP] stock: simplify stock.picking states
Remove 'partially_available'. This particular state is now also
represented by the 'assigned' state.
2017-09-20 15:08:30 +02:00

20 lines
684 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, models
class SaleOrderLine(models.Model):
_inherit = "sale.order.line"
@api.multi
def _action_launch_procurement_rule(self):
res = super(SaleOrderLine, self)._action_launch_procurement_rule()
orders = list(set(x.order_id for x in self))
for order in orders:
reassign = order.picking_ids.filtered(lambda x: x.state=='confirmed' or (x.state in ['waiting', 'assigned'] and not x.printed))
if reassign:
reassign.do_unreserve()
reassign.action_assign()
return res