mirror of
https://github.com/bringout/oca-technical.git
synced 2026-04-22 17:32:11 +02:00
Initial commit: OCA Technical packages (595 packages)
This commit is contained in:
commit
2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import stock_lot
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
# Copyright 2022 Camptocamp SA
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.tools import float_compare
|
||||
|
||||
|
||||
class ProductionLot(models.Model):
|
||||
_inherit = "stock.lot"
|
||||
|
||||
@api.model
|
||||
def get_available_lots_for_pos(self, product_id, company_id):
|
||||
lots = self.sudo().search(
|
||||
[
|
||||
"&",
|
||||
["product_id", "=", product_id],
|
||||
"|",
|
||||
["company_id", "=", company_id],
|
||||
["company_id", "=", False],
|
||||
]
|
||||
)
|
||||
|
||||
lots = lots.filtered(
|
||||
lambda l: float_compare(
|
||||
l.product_qty, 0, precision_digits=l.product_uom_id.rounding
|
||||
)
|
||||
> 0
|
||||
)
|
||||
|
||||
return lots.mapped("name")
|
||||
Loading…
Add table
Add a link
Reference in a new issue