mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
Make stock_available_mrp compatible with other modules like stock_available_immediately
This commit is contained in:
committed by
Víctor Martínez
parent
779c73a3ae
commit
047485dbbb
@@ -2,4 +2,3 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import product_product
|
||||
from . import product_template
|
||||
|
||||
@@ -109,6 +109,7 @@ class ProductProduct(models.Model):
|
||||
|
||||
bom_id = product.bom_id
|
||||
potential_qty = (bom_id.product_qty * components_potential_qty)
|
||||
potential_qty = potential_qty > 0.0 and potential_qty or 0.0
|
||||
|
||||
# We want to respect the rounding factor of the potential_qty
|
||||
# Rounding down as we want to be pesimistic.
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Copyright 2014 Numérigraphe SARL
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
@api.multi
|
||||
def _compute_available_quantities_dict(self):
|
||||
res = super(ProductTemplate, self)._compute_available_quantities_dict()
|
||||
for template in self.filtered('bom_ids'):
|
||||
res[template.id]['immediately_usable_qty'] =\
|
||||
template.virtual_available + res[template.id]['potential_qty']
|
||||
return res
|
||||
@@ -3,3 +3,4 @@
|
||||
* many thanks to Graeme Gellatly for his advice and code review
|
||||
* Laurent Mignon <laurent.mignon@acsone.eu>
|
||||
* Cédric Pigeon <cedric.pigeon@acsone.eu>
|
||||
* Florian da Costa <florian.dacosta@akretion.com>
|
||||
|
||||
Reference in New Issue
Block a user