Revert "[DEL] removed references to product.py, not needed anymore, the quant calculations done in product template are fine."

This reverts commit d6dee6f90d.
This commit is contained in:
Lionel Sausin
2015-09-09 14:06:49 +02:00
parent 11a308372e
commit bc25e1395d
2 changed files with 35 additions and 0 deletions

View File

@@ -17,3 +17,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import product

View File

@@ -0,0 +1,33 @@
# -*- 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