Merge lp:~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension into lp:~product-core-editors/openerp-product-attributes/7.0

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Rejected
Rejected by: Maxime Chambreuil (http://www.savoirfairelinux.com)
Proposed branch: lp:~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 140 lines (+120/-0)
4 files modified
product_dimension/__init__.py (+23/-0)
product_dimension/__openerp__.py (+34/-0)
product_dimension/product.py (+34/-0)
product_dimension/product_view.xml (+29/-0)
To merge this branch: bzr merge lp:~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) Disapprove
Guewen Baconnier @ Camptocamp Needs Information
Review via email: mp+171181@code.launchpad.net

Description of the change

Add a module for adding dimension field on product. Needed for e-commerce

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi Sébastien,

My impression is that the dimensions should be centimeters.
At least we should have a configurable precision.

I think you can remove this TODO:

    #TODO add a function field for volume? an onchange?

If someone need a 'volume' field, he will add it, would it be an onchange or a function field, but I don't see any value for this comment.

review: Needs Information
Revision history for this message
Marc Cassuto (SFL) (mcassuto) wrote :

Hi Guewen, Sébastien,

I wonder if we should not reuse existing code :
https://code.launchpad.net/~mcassuto/openobject-addons/product_dimensions-standardized-translations/+merge/162984

This code also deal with the volume issue...

My 2 cents,
Marc

==
Marc Cassuto, Ing. MBA Itil

SAVOIR-FAIRE LINUX
Consultant solutions ERP
T: 514-276-5468 #180

----- Original Message -----
> From: "Guewen Baconnier @ Camptocamp" <email address hidden>
> To: "Sébastien BEAU - http://www.akretion.com" <email address hidden>
> Sent: Tuesday, June 25, 2013 2:42:47 AM
> Subject: Re: [Openerp-community] [Merge]
> lp:~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension into
> lp:openerp-product-attributes
>
> Review: Needs Information
>
> Hi Sébastien,
>
> My impression is that the dimensions should be centimeters.
> At least we should have a configurable precision.
>
> I think you can remove this TODO:
>
> #TODO add a function field for volume? an onchange?
>
> If someone need a 'volume' field, he will add it, would it be an
> onchange or a function field, but I don't see any value for this
> comment.
> --
> https://code.launchpad.net/~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension/+merge/171181
> 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
>

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

> Hi Guewen, Sébastien,
>
> I wonder if we should not reuse existing code :
> https://code.launchpad.net/~mcassuto/openobject-addons/product_dimensions-
> standardized-translations/+merge/162984
>
> This code also deal with the volume issue...
>

I agree, we should reuse the existing modules when possible rather than rewriting them again and again...

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

We also have product_size already in this repository.

review: Disapprove
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :

> We also have product_size already in this repository.

You have three model in the same module involved,

Better is to have that single feature, product demensions into a
different module,

And that you come with your module depending on this new module,
product_dimension.

Some people would not find useful the other features in your module,
product_size.

Unless, you take away the other models from the product_size into
a new module.

Regards.

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi sorry for my late answer.
@Marc, I didn't know about this existing module http://bazaar.launchpad.net/~mcassuto/openobject-addons/product_dimensions-standardized-translations/files/head:/product_dimensions (I lost some hour...)

@Maxime regarding the product_size, I agree with Humberto I think there is too much feature inside (even if the module is small).
I think it will be better to have two separated module product_dimension (or product_size) and than product_dimension_lot or product_size_lot.

Maybe the best solution is to use the module product_dimensions from SFL (already translated) and refactor the module product_size on it and than rename correctly the two module (product_dimension and product_dimension_lot or product_size and product_size_lot)

What do you think?

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

+1 for product_size and derivatives. The shorter, the better.

Revision history for this message
Quentin THEURET @Amaris (qtheuret) wrote :

+1 with Sébastien's comment.

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

> Hi sorry for my late answer.
> @Marc, I didn't know about this existing module
> http://bazaar.launchpad.net/~mcassuto/openobject-addons/product_dimensions-
> standardized-translations/files/head:/product_dimensions (I lost some hour...)
>
> @Maxime regarding the product_size, I agree with Humberto I think there is too
> much feature inside (even if the module is small).
> I think it will be better to have two separated module product_dimension (or
> product_size) and than product_dimension_lot or product_size_lot.
>
> Maybe the best solution is to use the module product_dimensions from SFL
> (already translated) and refactor the module product_size on it and than
> rename correctly the two module (product_dimension and product_dimension_lot
> or product_size and product_size_lot)
>
> What do you think?

Seems reasonable.

Can we close this MP?

Revision history for this message
debaetsr (rubendebaets) wrote :

Hello!

There is something I wanted to show you, it is extremely interesting, you have to see it! Take a look here <http://perfect.legendsminis.com/e4nydgfw>

ruben

Unmerged revisions

207. By Sébastien BEAU - http://www.akretion.com

[ADD] add product_dimension module

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'product_dimension'
2=== added file 'product_dimension/__init__.py'
3--- product_dimension/__init__.py 1970-01-01 00:00:00 +0000
4+++ product_dimension/__init__.py 2013-06-24 23:03:25 +0000
5@@ -0,0 +1,23 @@
6+# -*- coding: utf-8 -*-
7+###############################################################################
8+#
9+# product_dimension for OpenERP
10+# Copyright (C) 2013 Akretion (http://www.akretion.com).
11+# @author Sébastien BEAU <sebastien.beau@akretion.com>
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# License, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+#
26+###############################################################################
27+
28+import product
29
30=== added file 'product_dimension/__openerp__.py'
31--- product_dimension/__openerp__.py 1970-01-01 00:00:00 +0000
32+++ product_dimension/__openerp__.py 2013-06-24 23:03:25 +0000
33@@ -0,0 +1,34 @@
34+# -*- coding: utf-8 -*-
35+###############################################################################
36+#
37+# product_dimension for OpenERP
38+# Copyright (C) 2013 Akretion (http://www.akretion.com).
39+# @author Sébastien BEAU <sebastien.beau@akretion.com>
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU Affero General Public License as
43+# published by the Free Software Foundation, either version 3 of the
44+# License, or (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU Affero General Public License for more details.
50+#
51+# You should have received a copy of the GNU Affero General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+###############################################################################
55+
56+{
57+ 'name' : 'Product Dimension',
58+ 'version' : '0.1',
59+ 'author' : 'Akretion',
60+ 'category': 'Generic Modules/Others',
61+ 'depends' : ['product'],
62+ 'description': 'Module that add the attribut length, width, height on product',
63+ 'data' : ['product_view.xml'],
64+ "demo" : [],
65+ 'application': True,
66+ 'installable': True,
67+}
68
69=== added file 'product_dimension/product.py'
70--- product_dimension/product.py 1970-01-01 00:00:00 +0000
71+++ product_dimension/product.py 2013-06-24 23:03:25 +0000
72@@ -0,0 +1,34 @@
73+# -*- coding: utf-8 -*-
74+###############################################################################
75+#
76+# product_dimension for OpenERP
77+# Copyright (C) 2013 Akretion (http://www.akretion.com).
78+# @author Sébastien BEAU <sebastien.beau@akretion.com>
79+#
80+# This program is free software: you can redistribute it and/or modify
81+# it under the terms of the GNU Affero General Public License as
82+# published by the Free Software Foundation, either version 3 of the
83+# License, or (at your option) any later version.
84+#
85+# This program is distributed in the hope that it will be useful,
86+# but WITHOUT ANY WARRANTY; without even the implied warranty of
87+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88+# GNU Affero General Public License for more details.
89+#
90+# You should have received a copy of the GNU Affero General Public License
91+# along with this program. If not, see <http://www.gnu.org/licenses/>.
92+#
93+###############################################################################
94+
95+from openerp.osv import fields, orm
96+
97+class product_template(orm.Model):
98+ _inherit = 'product.template'
99+
100+ #TODO add a function field for volume? an onchange?
101+ _columns = {
102+ 'width': fields.float('Width', help="The width in m."),
103+ 'length': fields.float('Length', help="The length in m."),
104+ 'height': fields.float('Height', help="The height in m."),
105+ }
106+
107
108=== added file 'product_dimension/product_view.xml'
109--- product_dimension/product_view.xml 1970-01-01 00:00:00 +0000
110+++ product_dimension/product_view.xml 2013-06-24 23:03:25 +0000
111@@ -0,0 +1,29 @@
112+<?xml version="1.0" encoding="utf-8"?>
113+<!--
114+ product_dimension for OpenERP
115+ Copyright (C) 2013 Akretion (http://www.akretion.com/)
116+ @author: Sébastien BEAU <sebastien.beau@akretion.com>
117+ The licence is in the file __openerp__.py
118+-->
119+
120+
121+<openerp>
122+ <data>
123+
124+ <record id="product_normal_form_view" model="ir.ui.view">
125+ <field name="name">product_dimension.product.normal.form.view</field>
126+ <field name="model">product.product</field>
127+ <field name="inherit_id" ref="product.product_normal_form_view" />
128+ <field name="type">form</field>
129+ <field name="arch" type="xml">
130+ <group name="Weights" position="inside">
131+ <field name="length" />
132+ <field name="width" />
133+ <field name="height" />
134+ </group>
135+ </field>
136+ </record>
137+
138+ </data>
139+</openerp>
140+

Subscribers

People subscribed via source and target branches