-
-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by LoisRForgeFlow
- Loading branch information
Showing
4 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2023 Michael Tietz (MT Software) <[email protected]> | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo import models | ||
|
||
|
||
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
# To be able to get the outgoing and incoming qty by the restrict_lot_id | ||
# the odoo standard method _compute_quantities_dict is hookable | ||
# therefore the domain is already here changed | ||
def _get_domain_locations(self): | ||
res = super()._get_domain_locations() | ||
lot_id = self.env.context.get("lot_id") | ||
if not lot_id: | ||
return res | ||
|
||
domain_quant_loc, domain_move_in_loc, domain_move_out_loc = res | ||
lot_domain = [("restrict_lot_id", "=", lot_id)] | ||
domain_move_in_loc += lot_domain | ||
domain_move_out_loc += lot_domain | ||
return domain_quant_loc, domain_move_in_loc, domain_move_out_loc |
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