Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX]stock_secondary_unit: partial delivery #2224

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
19 changes: 19 additions & 0 deletions stock_secondary_unit/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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:
if corresponding_move.secondary_uom_qty:
corresponding_move._compute_secondary_uom_qty()

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

View check run for this annotation

Codecov / codecov/patch

stock_secondary_unit/models/stock_picking.py#L14

Added line #L14 was not covered by tests
else:
continue

return res

Loading