Migrate stock_available_immediately to 7.0

This commit is contained in:
Laurent Mignon (Acsone)
2013-12-16 13:50:33 +01:00
committed by Víctor Martínez
parent 1132bdf92c
commit ff232b1e3d
4 changed files with 19 additions and 24 deletions

View File

@@ -18,4 +18,4 @@
# #
############################################################################## ##############################################################################
import product from . import product

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## #
# #
# Author: Guewen Baconnier # Author: Guewen Baconnier
# Copyright 2010-2012 Camptocamp SA # Copyright 2010-2012 Camptocamp SA
@@ -18,24 +18,23 @@
# You should have received a copy of the GNU Affero General Public License # 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/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## #
{ {
"name" : "Immediately Usable Stock Quantity", "name": "Immediately Usable Stock Quantity",
"version" : "1.0", "version": "1.0",
"depends" : ["product", "stock", ], "depends": ["product", "stock", ],
"author" : "Camptocamp", "author": "Camptocamp",
"license": "AGPL-3", "license": "AGPL-3",
"description": """ "description": """
Compute the immediately usable stock. Compute the immediately usable stock.
Immediately usable is computed : Quantity on Hand - Outgoing Stock. Immediately usable is computed : Quantity on Hand - Outgoing Stock.
""", """,
"website" : "http://tinyerp.com/module_account.html", "website": "http://tinyerp.com/module_account.html",
"category" : "Generic Modules/Stock", "category": "Generic Modules/Stock",
"init_xml" : [], "data": ["product_view.xml",
"demo_xml" : [], ],
"update_xml" : ["product_view.xml", ], "active": False,
"active": False, "installable": True
"installable": False
} }

View File

@@ -19,12 +19,12 @@
# #
############################################################################## ##############################################################################
import decimal_precision as dp from openerp.addons import decimal_precision as dp
from osv import fields, osv from openerp.osv import orm, fields
class ProductImmediatelyUsable(osv.osv): class product_immediately_usable(orm.Model):
""" """
Inherit Product in order to add an "immediately usable quantity" Inherit Product in order to add an "immediately usable quantity"
stock field stock field
@@ -49,7 +49,7 @@ class ProductImmediatelyUsable(osv.osv):
field_names.append('qty_available') field_names.append('qty_available')
field_names.append('outgoing_qty') field_names.append('outgoing_qty')
res = super(ProductImmediatelyUsable, self)._product_available( res = super(product_immediately_usable, self)._product_available(
cr, uid, ids, field_names, arg, context) cr, uid, ids, field_names, arg, context)
if 'immediately_usable_qty' in field_names: if 'immediately_usable_qty' in field_names:
@@ -140,5 +140,3 @@ class ProductImmediatelyUsable(osv.osv):
help="Quantity of products really available for sale." \ help="Quantity of products really available for sale." \
"Computed as: Quantity On Hand - Outgoing."), "Computed as: Quantity On Hand - Outgoing."),
} }
ProductImmediatelyUsable()

View File

@@ -12,8 +12,7 @@
<record model="ir.ui.view" id="view_normal_stock_active_qty_form"> <record model="ir.ui.view" id="view_normal_stock_active_qty_form">
<field name="name">product.normal.stock.active.qty.form.inherit</field> <field name="name">product.normal.stock.active.qty.form.inherit</field>
<field name="model">product.product</field> <field name="model">product.product</field>
<field name="type">form</field> <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
<field name="inherit_id" ref="stock.view_normal_stock_property_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="virtual_available" position="after"> <field name="virtual_available" position="after">
<newline/> <newline/>
@@ -25,7 +24,6 @@
<record model="ir.ui.view" id="product_product_tree_view"> <record model="ir.ui.view" id="product_product_tree_view">
<field name="name">product_immediately_usable.product_product_tree_view</field> <field name="name">product_immediately_usable.product_product_tree_view</field>
<field name="model">product.product</field> <field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_product_tree_view"/> <field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>