Merge lp:~acsone-openerp/stock-logistic-warehouse/7.0-port-stock_available_immediately into lp:stock-logistic-warehouse

Proposed by Laurent Mignon (Acsone)
Status: Merged
Merged at revision: 34
Proposed branch: lp:~acsone-openerp/stock-logistic-warehouse/7.0-port-stock_available_immediately
Merge into: lp:stock-logistic-warehouse
Diff against target: 117 lines (+22/-27)
4 files modified
stock_available_immediately/__init__.py (+1/-1)
stock_available_immediately/__openerp__.py (+13/-14)
stock_available_immediately/product.py (+7/-9)
stock_available_immediately/product_view.xml (+1/-3)
To merge this branch: bzr merge lp:~acsone-openerp/stock-logistic-warehouse/7.0-port-stock_available_immediately
Reviewer Review Type Date Requested Status
Romain Deheele - Camptocamp (community) code review and test Approve
Guewen Baconnier @ Camptocamp code review Approve
Alexandre Fayolle - camptocamp code review, test. Approve
Review via email: mp+202857@code.launchpad.net

Description of the change

7.0 compliant

To post a comment you must log in.
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Shouldn't class names use StudlyCaps ?

Revision history for this message
Laurent Mignon (Acsone) (lmi) wrote :

> Shouldn't class names use StudlyCaps ?
it's just because in openerp, class names are uppercase with underscrore.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Nice, thanks for the port.

Some deprecated things are still there.

"product_immediately_usable()" Can be removed

<field name="type">.+</field> in views too.

+ "init_xml": [],
+ "demo_xml": [],
+ "update_xml": ["product_view.xml", ],
can be replaced by
  "data": ["product_view.xml",
           ]

36. By Laurent Mignon (Acsone)

remove remaining deprecated things

Revision history for this message
Laurent Mignon (Acsone) (lmi) wrote :

Guewen,

Thanks for the review.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM, and works fine.

review: Approve (code review, test.)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM
Thanks for the changes

review: Approve (code review)
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

Hello Laurent,

LGTM
Just micro things:
in __init__.py, we could use relative import : from . import product
in product.py, we could use : from openerp.addons import decimal_precision as dp

Thanks,

Romain

37. By Laurent Mignon (Acsone)

Use relative import in __init__.py and complte module path for others import

Revision history for this message
Laurent Mignon (Acsone) (lmi) wrote :

Hi Romain

Thanks for the tips. The changes are done.

lmi

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

Thanks Laurent,

Romain

review: Approve (code review and test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock_available_immediately/__init__.py'
--- stock_available_immediately/__init__.py 2012-04-24 08:53:45 +0000
+++ stock_available_immediately/__init__.py 2014-02-19 11:43:52 +0000
@@ -18,4 +18,4 @@
18#18#
19##############################################################################19##############################################################################
2020
21import product21from . import product
2222
=== modified file 'stock_available_immediately/__openerp__.py'
--- stock_available_immediately/__openerp__.py 2013-02-13 08:46:41 +0000
+++ stock_available_immediately/__openerp__.py 2014-02-19 11:43:52 +0000
@@ -1,5 +1,5 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2##############################################################################2#
3#3#
4# Author: Guewen Baconnier4# Author: Guewen Baconnier
5# Copyright 2010-2012 Camptocamp SA5# Copyright 2010-2012 Camptocamp SA
@@ -18,24 +18,23 @@
18# You should have received a copy of the GNU Affero General Public License18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#20#
21##############################################################################21#
2222
2323
24{24{
25 "name" : "Immediately Usable Stock Quantity",25 "name": "Immediately Usable Stock Quantity",
26 "version" : "1.0",26 "version": "1.0",
27 "depends" : ["product", "stock", ],27 "depends": ["product", "stock", ],
28 "author" : "Camptocamp",28 "author": "Camptocamp",
29 "license": "AGPL-3",29 "license": "AGPL-3",
30 "description": """30 "description": """
31Compute the immediately usable stock.31Compute the immediately usable stock.
32Immediately usable is computed : Quantity on Hand - Outgoing Stock.32Immediately usable is computed : Quantity on Hand - Outgoing Stock.
33""",33""",
34 "website" : "http://tinyerp.com/module_account.html",34 "website": "http://tinyerp.com/module_account.html",
35 "category" : "Generic Modules/Stock",35 "category": "Generic Modules/Stock",
36 "init_xml" : [],36 "data": ["product_view.xml",
37 "demo_xml" : [],37 ],
38 "update_xml" : ["product_view.xml", ],38 "active": False,
39 "active": False,39 "installable": True
40 "installable": False
41}40}
4241
=== modified file 'stock_available_immediately/product.py'
--- stock_available_immediately/product.py 2012-03-14 15:36:38 +0000
+++ stock_available_immediately/product.py 2014-02-19 11:43:52 +0000
@@ -19,12 +19,12 @@
19#19#
20##############################################################################20##############################################################################
2121
22import decimal_precision as dp22from openerp.addons import decimal_precision as dp
2323
24from osv import fields, osv24from openerp.osv import orm, fields
2525
2626
27class ProductImmediatelyUsable(osv.osv):27class product_immediately_usable(orm.Model):
28 """28 """
29 Inherit Product in order to add an "immediately usable quantity"29 Inherit Product in order to add an "immediately usable quantity"
30 stock field30 stock field
@@ -49,7 +49,7 @@
49 field_names.append('qty_available')49 field_names.append('qty_available')
50 field_names.append('outgoing_qty')50 field_names.append('outgoing_qty')
5151
52 res = super(ProductImmediatelyUsable, self)._product_available(52 res = super(product_immediately_usable, self)._product_available(
53 cr, uid, ids, field_names, arg, context)53 cr, uid, ids, field_names, arg, context)
5454
55 if 'immediately_usable_qty' in field_names:55 if 'immediately_usable_qty' in field_names:
@@ -140,5 +140,3 @@
140 help="Quantity of products really available for sale." \140 help="Quantity of products really available for sale." \
141 "Computed as: Quantity On Hand - Outgoing."),141 "Computed as: Quantity On Hand - Outgoing."),
142 }142 }
143
144ProductImmediatelyUsable()
145143
=== modified file 'stock_available_immediately/product_view.xml'
--- stock_available_immediately/product_view.xml 2012-04-24 08:53:45 +0000
+++ stock_available_immediately/product_view.xml 2014-02-19 11:43:52 +0000
@@ -12,8 +12,7 @@
12 <record model="ir.ui.view" id="view_normal_stock_active_qty_form">12 <record model="ir.ui.view" id="view_normal_stock_active_qty_form">
13 <field name="name">product.normal.stock.active.qty.form.inherit</field>13 <field name="name">product.normal.stock.active.qty.form.inherit</field>
14 <field name="model">product.product</field>14 <field name="model">product.product</field>
15 <field name="type">form</field>15 <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
16 <field name="inherit_id" ref="stock.view_normal_stock_property_form"/>
17 <field name="arch" type="xml">16 <field name="arch" type="xml">
18 <field name="virtual_available" position="after">17 <field name="virtual_available" position="after">
19 <newline/>18 <newline/>
@@ -25,7 +24,6 @@
25 <record model="ir.ui.view" id="product_product_tree_view">24 <record model="ir.ui.view" id="product_product_tree_view">
26 <field name="name">product_immediately_usable.product_product_tree_view</field>25 <field name="name">product_immediately_usable.product_product_tree_view</field>
27 <field name="model">product.product</field>26 <field name="model">product.product</field>
28 <field name="type">form</field>
29 <field name="inherit_id" ref="product.product_product_tree_view"/>27 <field name="inherit_id" ref="product.product_product_tree_view"/>
30 <field name="arch" type="xml">28 <field name="arch" type="xml">
31 <data>29 <data>

Subscribers

People subscribed via source and target branches