Skip to content

Commit

Permalink
[FIX]stock_secondary_unit: partial delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadhoc authored and mav-adhoc committed Jan 2, 2025
1 parent 420509c commit 806674e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions stock_secondary_unit/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from . import product_product
from . import product_template
from . import stock_move
from . import stock_picking
24 changes: 24 additions & 0 deletions stock_secondary_unit/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from odoo import models


class StockPicking(models.Model):
_inherit = "stock.picking"

def _create_backorder(self):
res = super(StockPicking, self)._create_backorder()

for original_move in self.move_ids:
corresponding_move = next(
(
move
for move in res.move_ids
if move.product_id == original_move.product_id
),
None,
)

if corresponding_move and corresponding_move.secondary_uom_qty:
corresponding_move._compute_secondary_uom_qty()

Check warning on line 21 in stock_secondary_unit/models/stock_picking.py

View check run for this annotation

Codecov / codecov/patch

stock_secondary_unit/models/stock_picking.py#L21

Added line #L21 was not covered by tests
else:
continue
return res

0 comments on commit 806674e

Please sign in to comment.