From ff232b1e3d58c00a8769ba248bf4bf3295e6583f Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (Acsone)" Date: Mon, 16 Dec 2013 13:50:33 +0100 Subject: [PATCH] Migrate stock_available_immediately to 7.0 --- stock_available_immediately/__init__.py | 2 +- stock_available_immediately/__openerp__.py | 27 ++++++++++---------- stock_available_immediately/product.py | 10 +++----- stock_available_immediately/product_view.xml | 4 +-- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py index 5d740e5ab..46f811108 100755 --- a/stock_available_immediately/__init__.py +++ b/stock_available_immediately/__init__.py @@ -18,4 +18,4 @@ # ############################################################################## -import product +from . import product diff --git a/stock_available_immediately/__openerp__.py b/stock_available_immediately/__openerp__.py index 65c402d98..41cbb52e2 100644 --- a/stock_available_immediately/__openerp__.py +++ b/stock_available_immediately/__openerp__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## +# # # Author: Guewen Baconnier # Copyright 2010-2012 Camptocamp SA @@ -18,24 +18,23 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # -############################################################################## +# { - "name" : "Immediately Usable Stock Quantity", - "version" : "1.0", - "depends" : ["product", "stock", ], - "author" : "Camptocamp", + "name": "Immediately Usable Stock Quantity", + "version": "1.0", + "depends": ["product", "stock", ], + "author": "Camptocamp", "license": "AGPL-3", - "description": """ + "description": """ Compute the immediately usable stock. Immediately usable is computed : Quantity on Hand - Outgoing Stock. """, - "website" : "http://tinyerp.com/module_account.html", - "category" : "Generic Modules/Stock", - "init_xml" : [], - "demo_xml" : [], - "update_xml" : ["product_view.xml", ], - "active": False, - "installable": False + "website": "http://tinyerp.com/module_account.html", + "category": "Generic Modules/Stock", + "data": ["product_view.xml", + ], + "active": False, + "installable": True } diff --git a/stock_available_immediately/product.py b/stock_available_immediately/product.py index 3c7891ba8..51e3b3954 100644 --- a/stock_available_immediately/product.py +++ b/stock_available_immediately/product.py @@ -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" stock field @@ -49,7 +49,7 @@ class ProductImmediatelyUsable(osv.osv): field_names.append('qty_available') 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) if 'immediately_usable_qty' in field_names: @@ -140,5 +140,3 @@ class ProductImmediatelyUsable(osv.osv): help="Quantity of products really available for sale." \ "Computed as: Quantity On Hand - Outgoing."), } - -ProductImmediatelyUsable() diff --git a/stock_available_immediately/product_view.xml b/stock_available_immediately/product_view.xml index 147a05fe3..058da3d14 100644 --- a/stock_available_immediately/product_view.xml +++ b/stock_available_immediately/product_view.xml @@ -12,8 +12,7 @@ product.normal.stock.active.qty.form.inherit product.product - form - + @@ -25,7 +24,6 @@ product_immediately_usable.product_product_tree_view product.product - form