mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-27 10:32:01 +02:00
Initial commit: Sale packages
This commit is contained in:
commit
14e3d26998
6469 changed files with 2479670 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
def _create_move_from_pos_order_lines(self, lines):
|
||||
lines_to_unreserve = self.env['pos.order.line']
|
||||
for line in lines:
|
||||
if line.order_id.to_ship:
|
||||
continue
|
||||
if any(wh != line.order_id.config_id.warehouse_id for wh in line.sale_order_line_id.move_ids.location_id.warehouse_id):
|
||||
continue
|
||||
lines_to_unreserve |= line
|
||||
lines_to_unreserve.sale_order_line_id.move_ids.filtered(lambda ml: ml.state not in ['cancel', 'done'])._do_unreserve()
|
||||
return super()._create_move_from_pos_order_lines(lines)
|
||||
Loading…
Add table
Add a link
Reference in a new issue