| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
from odoo import models |
| 5 |
|
| 6 |
|
| 7 |
class StockPicking(models.Model): |
| 8 |
_inherit = 'stock.picking' |
| 9 |
|
| 10 |
def _create_move_from_pos_order_lines(self, lines): |
| 11 |
lines_to_unreserve = self.env['pos.order.line'] |
| 12 |
for line in lines: |
| 13 |
if line.order_id.shipping_date: |
| 14 |
continue |
| 15 |
if any(wh != line.order_id.config_id.warehouse_id for wh in line.sale_order_line_id.move_ids.location_id.warehouse_id): |
| 16 |
continue |
| 17 |
lines_to_unreserve |= line |
| 18 |
lines_to_unreserve.sale_order_line_id.move_ids.filtered(lambda ml: ml.state not in ['cancel', 'done'])._do_unreserve() |
| 19 |
return super()._create_move_from_pos_order_lines(lines) |