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
1=== modified file 'stock_available_immediately/__init__.py'
2--- stock_available_immediately/__init__.py 2012-04-24 08:53:45 +0000
3+++ stock_available_immediately/__init__.py 2014-02-19 11:43:52 +0000
4@@ -18,4 +18,4 @@
5 #
6 ##############################################################################
7
8-import product
9+from . import product
10
11=== modified file 'stock_available_immediately/__openerp__.py'
12--- stock_available_immediately/__openerp__.py 2013-02-13 08:46:41 +0000
13+++ stock_available_immediately/__openerp__.py 2014-02-19 11:43:52 +0000
14@@ -1,5 +1,5 @@
15 # -*- coding: utf-8 -*-
16-##############################################################################
17+#
18 #
19 # Author: Guewen Baconnier
20 # Copyright 2010-2012 Camptocamp SA
21@@ -18,24 +18,23 @@
22 # You should have received a copy of the GNU Affero General Public License
23 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #
25-##############################################################################
26+#
27
28
29 {
30- "name" : "Immediately Usable Stock Quantity",
31- "version" : "1.0",
32- "depends" : ["product", "stock", ],
33- "author" : "Camptocamp",
34+ "name": "Immediately Usable Stock Quantity",
35+ "version": "1.0",
36+ "depends": ["product", "stock", ],
37+ "author": "Camptocamp",
38 "license": "AGPL-3",
39- "description": """
40+ "description": """
41 Compute the immediately usable stock.
42 Immediately usable is computed : Quantity on Hand - Outgoing Stock.
43 """,
44- "website" : "http://tinyerp.com/module_account.html",
45- "category" : "Generic Modules/Stock",
46- "init_xml" : [],
47- "demo_xml" : [],
48- "update_xml" : ["product_view.xml", ],
49- "active": False,
50- "installable": False
51+ "website": "http://tinyerp.com/module_account.html",
52+ "category": "Generic Modules/Stock",
53+ "data": ["product_view.xml",
54+ ],
55+ "active": False,
56+ "installable": True
57 }
58
59=== modified file 'stock_available_immediately/product.py'
60--- stock_available_immediately/product.py 2012-03-14 15:36:38 +0000
61+++ stock_available_immediately/product.py 2014-02-19 11:43:52 +0000
62@@ -19,12 +19,12 @@
63 #
64 ##############################################################################
65
66-import decimal_precision as dp
67-
68-from osv import fields, osv
69-
70-
71-class ProductImmediatelyUsable(osv.osv):
72+from openerp.addons import decimal_precision as dp
73+
74+from openerp.osv import orm, fields
75+
76+
77+class product_immediately_usable(orm.Model):
78 """
79 Inherit Product in order to add an "immediately usable quantity"
80 stock field
81@@ -49,7 +49,7 @@
82 field_names.append('qty_available')
83 field_names.append('outgoing_qty')
84
85- res = super(ProductImmediatelyUsable, self)._product_available(
86+ res = super(product_immediately_usable, self)._product_available(
87 cr, uid, ids, field_names, arg, context)
88
89 if 'immediately_usable_qty' in field_names:
90@@ -140,5 +140,3 @@
91 help="Quantity of products really available for sale." \
92 "Computed as: Quantity On Hand - Outgoing."),
93 }
94-
95-ProductImmediatelyUsable()
96
97=== modified file 'stock_available_immediately/product_view.xml'
98--- stock_available_immediately/product_view.xml 2012-04-24 08:53:45 +0000
99+++ stock_available_immediately/product_view.xml 2014-02-19 11:43:52 +0000
100@@ -12,8 +12,7 @@
101 <record model="ir.ui.view" id="view_normal_stock_active_qty_form">
102 <field name="name">product.normal.stock.active.qty.form.inherit</field>
103 <field name="model">product.product</field>
104- <field name="type">form</field>
105- <field name="inherit_id" ref="stock.view_normal_stock_property_form"/>
106+ <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
107 <field name="arch" type="xml">
108 <field name="virtual_available" position="after">
109 <newline/>
110@@ -25,7 +24,6 @@
111 <record model="ir.ui.view" id="product_product_tree_view">
112 <field name="name">product_immediately_usable.product_product_tree_view</field>
113 <field name="model">product.product</field>
114- <field name="type">form</field>
115 <field name="inherit_id" ref="product.product_product_tree_view"/>
116 <field name="arch" type="xml">
117 <data>

Subscribers

People subscribed via source and target branches