This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _get_returnable_quantities(self, lot=None, package=None): | |
"""Return the `stock.move.line` of `self` still returnable. | |
When computing the quantities to return, this method handles the existing returns, returns | |
of returns, and so on. | |
:param lot: `stock.production.lot` record to filter candidate move lines | |
:param package: `stock.quant.package` record to filter candidate move lines | |
:return: a dict of the quantities of `stock_move` stille returnable, indexed by | |
`stock.production.lot` and `stock.quant.package` | |
:rtype: dict | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quants = env['stock.quant'].search([]) | |
warning = '' | |
for quant in quants: | |
move_lines = env["stock.move.line"].search([ | |
('product_id', '=', quant.product_id.id), | |
('location_id', '=', quant.location_id.id), | |
('lot_id', '=', quant.lot_id.id), | |
('package_id', '=', quant.package_id.id), | |
('owner_id', '=', quant.owner_id.id), |