Public release from ruodoo-project: 19.0 - 2026-05-31 21:19:12 UTC
This commit is contained in:
18
mklab_forecast_mrp/models/mrp.py
Normal file
18
mklab_forecast_mrp/models/mrp.py
Normal file
@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class VirtualBom(models.Model):
|
||||
_inherit = 'mrp.bom'
|
||||
|
||||
is_virtual = fields.Boolean(string='Виртуальная (сгенерированная)')
|
||||
|
||||
def bom_available(self, qty=1):
|
||||
"""Проверяет, что все компоненты BOM есть на складе в нужном количестве."""
|
||||
for s in self:
|
||||
for line in s.bom_line_ids:
|
||||
if line.product_id.qty_available < line.product_qty * qty:
|
||||
return False
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user