Skip to content

Commit 806674e

Browse files
jcadhocmav-adhoc
authored andcommitted
[FIX]stock_secondary_unit: partial delivery
1 parent 420509c commit 806674e

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

stock_secondary_unit/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
from . import product_product
55
from . import product_template
66
from . import stock_move
7+
from . import stock_picking
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from odoo import models
2+
3+
4+
class StockPicking(models.Model):
5+
_inherit = "stock.picking"
6+
7+
def _create_backorder(self):
8+
res = super(StockPicking, self)._create_backorder()
9+
10+
for original_move in self.move_ids:
11+
corresponding_move = next(
12+
(
13+
move
14+
for move in res.move_ids
15+
if move.product_id == original_move.product_id
16+
),
17+
None,
18+
)
19+
20+
if corresponding_move and corresponding_move.secondary_uom_qty:
21+
corresponding_move._compute_secondary_uom_qty()
22+
else:
23+
continue
24+
return res

0 commit comments

Comments
 (0)