Merge lp:~vauxoo/openerp-product-attributes/7.0-prod_vol_weight-dev-humbertoarocha into lp:~product-core-editors/openerp-product-attributes/7.0

Proposed by hbto [Vauxoo] http://www.vauxoo.com on 2013-10-08
Status: Work in progress
Proposed branch: lp:~vauxoo/openerp-product-attributes/7.0-prod_vol_weight-dev-humbertoarocha
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 200 lines (+155/-0)
5 files modified
product_volumetric_weight/__init__.py (+25/-0)
product_volumetric_weight/__openerp__.py (+50/-0)
product_volumetric_weight/model/__init__.py (+26/-0)
product_volumetric_weight/model/product.py (+37/-0)
product_volumetric_weight/view/product_view.xml (+17/-0)
To merge this branch: bzr merge lp:~vauxoo/openerp-product-attributes/7.0-prod_vol_weight-dev-humbertoarocha
Reviewer Review Type Date Requested Status
Laetitia Gangloff (Acsone) (community) Resubmit on 2014-07-09
Maxime Chambreuil (http://www.savoirfairelinux.com) code review 2013-10-08 Needs Fixing on 2013-12-27
Stefan Rijnhart (Opener) Needs Fixing on 2013-10-09
Guewen Baconnier @ Camptocamp 2013-10-08 Pending
Nhomar - Vauxoo 2013-10-08 Pending
Review via email: mp+189956@code.launchpad.net

Description of the change

Hello Comm Guys,

We want to submit the following module,
product_volumentric_weight, to your review,

be aware that we want to added new features
to this module in the near future but these
have been keep away from this submission due to the
fact that there are still some agreements to be reached
in the following discussion in this merge proposal.

https://code.launchpad.net/~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension/+merge/171181

In the meantime the field that bears in this module
is a plain float, later it will evolve into functional float.

Best Regards.

To post a comment you must log in.

Thanks Humberto.

Minor fixes:

l30,31: Can you use "from . import" ?
l79: Can you fix indentation ?
l121: Can you use "from . import" ?
l155, datetime, as a standard Python library, should be imported before OpenERP-specific ones.
l161,162: Can you fix indentation ?

Can you add the translation file and remove the wizard and workflow directories ? I guess they will be used later with the new features.

review: Needs Fixing

model and views are generally in the module directory, not in sub-directories.

IMHO, there is no need for them with such a small module.

l.76: only need to depend on product, which depends on base itself.
l.158: please use orm.Model

Shouldn't some kind of UOM be used for this? What I read from Wikipedia, common UOMS are cm3/kg, kg/m3, in3/lb, lb/ft3.
 Without UOM, the amount is meaningless.

About having model files and views in separate directories, I find this a useful convention, no matter how small the module contents are.

review: Needs Fixing
Daniel Reis (dreis-pt) wrote :

Personally I find sub-directories cumbersome and only really useful on larger modules (my 2 cents).

David BEAL (ak) (davidbeal) wrote :

> Personally I find sub-directories cumbersome and only really useful on larger
> modules (my 2 cents).

+1

Given the vagueness of the criterium 'larger modules', we might as well leave it out of the review then.

> model and views are generally in the module directory, not in sub-directories.
>
> IMHO, there is no need for them with such a small module.

Hey Guys,

Regarding large / small module, with at vauxoo are sticking to a standard,
no matter how large or small a module is, we, vauxoo, always can find easily
what we are looking for, due to the fact it is more cumbersome, look for
something into account module in openobject-addons than in addons-vauxoo.

So I will kindly disregard your suggestion Daniel Reis.

> l79: Can you fix indentation ?
> l155, datetime, as a standard Python library, should be imported before
> OpenERP-specific ones.

to be uploaded, already DONE

> l30,31: Can you use "from . import" ?
> l121: Can you use "from . import" ?
> l161,162: Can you fix indentation ?

Can you kindly show me an example, Please

> Can you add the translation file and remove the wizard and workflow
> directories ? I guess they will be used later with the new features.

these are to be done

> l79: Can you fix indentation ?
> l155, datetime, as a standard Python library, should be imported before
> OpenERP-specific ones.

to be uploaded, already DONE

> l30,31: Can you use "from . import" ?
> l121: Can you use "from . import" ?
> l161,162: Can you fix indentation ?

Can you kindly show me an example, Please

> Can you add the translation file and remove the wizard and workflow
> directories ? I guess they will be used later with the new features.

these are to be done

216. By hbto [Vauxoo] http://www.vauxoo.com on 2013-10-10

[FIX][product_volumetric_weight] Minor changes

217. By hbto [Vauxoo] http://www.vauxoo.com on 2013-10-10

[FIX][product_volumetric_weight] Less dependencies

Hi, I'd still be interested in a response to my comment about UOM.

@hbto

Here are what the lines should be :
l30: from . import model
l122: from . import product

l43 to l45: Can you move those lines in the module description ?

To answer Stefan, can you add the UOM in the help of the field (l162) ?

review: Needs Fixing (code review)
Daniel Reis (dreis-pt) wrote :

I personally tried but had trouble with the " from . import" formula: if the addons dir is a symlink and the module dir is another symlink, the import failed.

DR

No dia 27/12/2013, às 19:04, "Maxime Chambreuil \(http://www.savoirfairelinux.com\)" <email address hidden> escreveu:

> Review: Needs Fixing code review
>
> @hbto
>
> Here are what the lines should be :
> l30: from . import model
> l122: from . import product
>
> l43 to l45: Can you move those lines in the module description ?
>
> To answer Stefan, can you add the UOM in the help of the field (l162) ?
> --
> https://code.launchpad.net/~vauxoo/openerp-product-attributes/7.0-prod_vol_weight-dev-humbertoarocha/+merge/189956
> Your team OpenERP Community is subscribed to branch lp:openerp-product-attributes.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openerp-community
> More help : https://help.launchpad.net/ListHelp

This project is now hosted on https://github.com/OCA/product-attribute. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Resubmit

Unmerged revisions

217. By hbto [Vauxoo] http://www.vauxoo.com on 2013-10-10

[FIX][product_volumetric_weight] Less dependencies

216. By hbto [Vauxoo] http://www.vauxoo.com on 2013-10-10

[FIX][product_volumetric_weight] Minor changes

215. By hbto [Vauxoo] http://www.vauxoo.com on 2013-10-08

[IMP][product_volumetric_weight] Added module which will let set a volumetric
weight to the product.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'product_volumetric_weight'
2=== added file 'product_volumetric_weight/__init__.py'
3--- product_volumetric_weight/__init__.py 1970-01-01 00:00:00 +0000
4+++ product_volumetric_weight/__init__.py 2013-10-10 20:49:25 +0000
5@@ -0,0 +1,25 @@
6+#!/usr/bin/python
7+# -*- encoding: utf-8 -*-
8+###############################################################################
9+# Module Writen to OpenERP, Open Source Management Solution
10+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
11+# All Rights Reserved
12+############# Credits #########################################################
13+# Coded by: Yanina Aular <yani@vauxoo.com>
14+# Planified by: Humberto Arocha <hbto@vauxoo.com>
15+# Audited by: Humberto Arocha <hbto@vauxoo.com>
16+###############################################################################
17+# This program is free software: you can redistribute it and/or modify
18+# it under the terms of the GNU Affero General Public License as published
19+# by the Free Software Foundation, either version 3 of the License, or
20+# (at your option) any later version.
21+#
22+# This program is distributed in the hope that it will be useful,
23+# but WITHOUT ANY WARRANTY; without even the implied warranty of
24+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+# GNU Affero General Public License for more details.
26+#
27+# You should have received a copy of the GNU Affero General Public License
28+# along with this program. If not, see <http://www.gnu.org/licenses/>.
29+###############################################################################
30+import model
31
32=== added file 'product_volumetric_weight/__openerp__.py'
33--- product_volumetric_weight/__openerp__.py 1970-01-01 00:00:00 +0000
34+++ product_volumetric_weight/__openerp__.py 2013-10-10 20:49:25 +0000
35@@ -0,0 +1,50 @@
36+#!/usr/bin/python
37+# -*- encoding: utf-8 -*-
38+###############################################################################
39+# Module Writen to OpenERP, Open Source Management Solution
40+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
41+# All Rights Reserved
42+############# Credits #########################################################
43+# Coded by: Yanina Aular <yani@vauxoo.com>
44+# Planified by: Humberto Arocha <hbto@vauxoo.com>
45+# Audited by: Humberto Arocha <hbto@vauxoo.com>
46+###############################################################################
47+# This program is free software: you can redistribute it and/or modify
48+# it under the terms of the GNU Affero General Public License as published
49+# by the Free Software Foundation, either version 3 of the License, or
50+# (at your option) any later version.
51+#
52+# This program is distributed in the hope that it will be useful,
53+# but WITHOUT ANY WARRANTY; without even the implied warranty of
54+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55+# GNU Affero General Public License for more details.
56+#
57+# You should have received a copy of the GNU Affero General Public License
58+# along with this program. If not, see <http://www.gnu.org/licenses/>.
59+###############################################################################
60+
61+{
62+ 'name': 'Product Volumetric',
63+ 'version': '1.0',
64+ 'author': 'Vauxoo',
65+ 'website': 'http://www.vauxoo.com/',
66+ 'category': 'product',
67+ 'summary' : 'Added field volumetric weight to the product',
68+ 'description': '''
69+Product Dimensions
70+==================
71+
72+With this module, field volumetric weight is added to model product.
73+
74+''',
75+ 'depends': [
76+ 'product',
77+ ],
78+ 'data': [
79+ 'view/product_view.xml',
80+ ],
81+ 'demo': [],
82+ 'test': [],
83+ 'active': False,
84+ 'installable': True,
85+}
86
87=== added directory 'product_volumetric_weight/data'
88=== added directory 'product_volumetric_weight/demo'
89=== added directory 'product_volumetric_weight/doc'
90=== added directory 'product_volumetric_weight/doc/images'
91=== added directory 'product_volumetric_weight/i18n'
92=== added directory 'product_volumetric_weight/model'
93=== added file 'product_volumetric_weight/model/__init__.py'
94--- product_volumetric_weight/model/__init__.py 1970-01-01 00:00:00 +0000
95+++ product_volumetric_weight/model/__init__.py 2013-10-10 20:49:25 +0000
96@@ -0,0 +1,26 @@
97+#!/usr/bin/python
98+# -*- encoding: utf-8 -*-
99+###############################################################################
100+# Module Writen to OpenERP, Open Source Management Solution
101+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
102+# All Rights Reserved
103+############# Credits #########################################################
104+# Coded by: Yanina Aular <yani@vauxoo.com>
105+# Planified by: Humberto Arocha <hbto@vauxoo.com>
106+# Audited by: Humberto Arocha <hbto@vauxoo.com>
107+###############################################################################
108+# This program is free software: you can redistribute it and/or modify
109+# it under the terms of the GNU Affero General Public License as published
110+# by the Free Software Foundation, either version 3 of the License, or
111+# (at your option) any later version.
112+#
113+# This program is distributed in the hope that it will be useful,
114+# but WITHOUT ANY WARRANTY; without even the implied warranty of
115+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
116+# GNU Affero General Public License for more details.
117+#
118+# You should have received a copy of the GNU Affero General Public License
119+# along with this program. If not, see <http://www.gnu.org/licenses/>.
120+###############################################################################
121+
122+import product
123
124=== added file 'product_volumetric_weight/model/product.py'
125--- product_volumetric_weight/model/product.py 1970-01-01 00:00:00 +0000
126+++ product_volumetric_weight/model/product.py 2013-10-10 20:49:25 +0000
127@@ -0,0 +1,37 @@
128+#!/usr/bin/python
129+# -*- encoding: utf-8 -*-
130+###############################################################################
131+# Module Writen to OpenERP, Open Source Management Solution
132+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
133+# All Rights Reserved
134+############# Credits #########################################################
135+# Coded by: Yanina Aular <yani@vauxoo.com>
136+# Planified by: Humberto Arocha <hbto@vauxoo.com>
137+# Audited by: Humberto Arocha <hbto@vauxoo.com>
138+###############################################################################
139+# This program is free software: you can redistribute it and/or modify
140+# it under the terms of the GNU Affero General Public License as published
141+# by the Free Software Foundation, either version 3 of the License, or
142+# (at your option) any later version.
143+#
144+# This program is distributed in the hope that it will be useful,
145+# but WITHOUT ANY WARRANTY; without even the implied warranty of
146+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
147+# GNU Affero General Public License for more details.
148+#
149+# You should have received a copy of the GNU Affero General Public License
150+# along with this program. If not, see <http://www.gnu.org/licenses/>.
151+###############################################################################
152+
153+import datetime
154+from openerp.osv import fields, osv
155+from openerp.tools.translate import _
156+from openerp import tools
157+
158+
159+class product_product(osv.Model):
160+ _inherit = 'product.product'
161+ _columns = {
162+ 'volumetric_weight': fields.float('Volumetric Weight', help='Volumetric Weight per Unit'),
163+ }
164+
165
166=== added directory 'product_volumetric_weight/report'
167=== added directory 'product_volumetric_weight/security'
168=== added directory 'product_volumetric_weight/static'
169=== added directory 'product_volumetric_weight/static/description'
170=== added file 'product_volumetric_weight/static/description/index.html'
171=== added directory 'product_volumetric_weight/static/src'
172=== added directory 'product_volumetric_weight/static/src/css'
173=== added directory 'product_volumetric_weight/static/src/img'
174=== added file 'product_volumetric_weight/static/src/img/icon.png'
175Binary files product_volumetric_weight/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and product_volumetric_weight/static/src/img/icon.png 2013-10-10 20:49:25 +0000 differ
176=== added directory 'product_volumetric_weight/static/src/js'
177=== added directory 'product_volumetric_weight/static/src/xml'
178=== added directory 'product_volumetric_weight/test'
179=== added directory 'product_volumetric_weight/view'
180=== added file 'product_volumetric_weight/view/product_view.xml'
181--- product_volumetric_weight/view/product_view.xml 1970-01-01 00:00:00 +0000
182+++ product_volumetric_weight/view/product_view.xml 2013-10-10 20:49:25 +0000
183@@ -0,0 +1,17 @@
184+<?xml version="1.0" encoding="utf-8"?>
185+<openerp>
186+ <data>
187+ <record id="product_volumetric_form_view" model="ir.ui.view">
188+ <field name="name">product.product</field>
189+ <field name="model">product.product</field>
190+ <field name="inherit_id" ref="product.product_normal_form_view"/>
191+ <field name="arch" type="xml">
192+ <xpath expr="//page[@string='Information']" position="inside">
193+ <group string="Dimensions of Unit">
194+ <field name="volumetric_weight"/>
195+ </group>
196+ </xpath>
197+ </field>
198+ </record>
199+ </data>
200+</openerp>

Subscribers

People subscribed via source and target branches