File tree Expand file tree Collapse file tree
stock_secondary_unit/models Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from . import product_product
55from . import product_template
66from . import stock_move
7+ from . import stock_return_picking
Original file line number Diff line number Diff line change 1+ ##############################################################################
2+ # For copyright and license notices, see __manifest__.py file in module root
3+ # directory
4+ ##############################################################################
5+ from odoo import models , fields
6+
7+
8+ class StockReturnPicking (models .TransientModel ):
9+ _inherit = 'stock.return.picking'
10+
11+ def _create_returns (self ):
12+ # Computes the second quantity for the return picking
13+ new_picking , pick_type_id = super ()._create_returns ()
14+ picking = self .env ['stock.picking' ].browse (new_picking )
15+ for move in picking .move_ids :
16+ if move .product_uom_qty and move .secondary_uom_id :
17+ factor = move .secondary_uom_id .factor or 1.0
18+ move .secondary_uom_qty = move .product_uom_qty / factor
19+ return new_picking , pick_type_id
You can’t perform that action at this time.
0 commit comments