Files
stock-logistics-warehouse/stock_available_immediately/product.py
gfcapalbo eb245e0ab9 [FIX] corrected calculation of immediately_usable_qty on product.product and
product.template, now takes in account variants and correctly displays value.
[FLAKE8]

Removing duplicate modules and moving README.rst into __unported__
2021-02-18 12:18:52 +01:00

34 lines
1.4 KiB
Python

# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2010-2012 Camptocamp SA
# Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models
class Product(models.Model):
"""Subtract incoming qty from immediately_usable_qty"""
_inherit = 'product.product'
def _immediately_usable_qty(self):
"""Ignore the incoming goods in the quantity available to promise"""
super(Product, self)._immediately_usable_qty()
for product in self:
product.immediately_usable_qty -= product.incoming_qty