← Back to team overview

openerp-community team mailing list archive

lp:~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension into lp:openerp-product-attributes

 

Sébastien BEAU - http://www.akretion.com has proposed merging lp:~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension into lp:openerp-product-attributes.

Requested reviews:
  Product Core Editors (product-core-editors)

For more details, see:
https://code.launchpad.net/~sebastien.beau/openerp-product-attributes/openerp-product-attributes-product-dimension/+merge/171181

Add a module for adding dimension field on product. Needed for e-commerce
-- 
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.
=== added directory 'product_dimension'
=== added file 'product_dimension/__init__.py'
--- product_dimension/__init__.py	1970-01-01 00:00:00 +0000
+++ product_dimension/__init__.py	2013-06-24 23:03:25 +0000
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+###############################################################################
+#
+#   product_dimension for OpenERP 
+#   Copyright (C) 2013 Akretion (http://www.akretion.com).
+#   @author Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>
+#
+#   This program is free software: you can redistribute it and/or modify
+#   it under the terms of the GNU Affero General Public License as
+#   published by the Free Software Foundation, either version 3 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU Affero General Public License for more details.
+#
+#   You should have received a copy of the GNU Affero General Public License
+#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+import product

=== added file 'product_dimension/__openerp__.py'
--- product_dimension/__openerp__.py	1970-01-01 00:00:00 +0000
+++ product_dimension/__openerp__.py	2013-06-24 23:03:25 +0000
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+###############################################################################
+#
+#   product_dimension for OpenERP 
+#   Copyright (C) 2013 Akretion (http://www.akretion.com).
+#   @author Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>
+#
+#   This program is free software: you can redistribute it and/or modify
+#   it under the terms of the GNU Affero General Public License as
+#   published by the Free Software Foundation, either version 3 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU Affero General Public License for more details.
+#
+#   You should have received a copy of the GNU Affero General Public License
+#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+{
+    'name' : 'Product Dimension',
+    'version' : '0.1',
+    'author' : 'Akretion',
+    'category': 'Generic Modules/Others',
+    'depends' : ['product'],
+    'description': 'Module that add the attribut length, width, height on product',
+    'data' : ['product_view.xml'],
+    "demo" : [],
+    'application': True,
+    'installable': True,
+}

=== added file 'product_dimension/product.py'
--- product_dimension/product.py	1970-01-01 00:00:00 +0000
+++ product_dimension/product.py	2013-06-24 23:03:25 +0000
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+###############################################################################
+#
+#   product_dimension for OpenERP 
+#   Copyright (C) 2013 Akretion (http://www.akretion.com).
+#   @author Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>
+#
+#   This program is free software: you can redistribute it and/or modify
+#   it under the terms of the GNU Affero General Public License as
+#   published by the Free Software Foundation, either version 3 of the
+#   License, or (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU Affero General Public License for more details.
+#
+#   You should have received a copy of the GNU Affero General Public License
+#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+###############################################################################
+
+from openerp.osv import fields, orm
+
+class product_template(orm.Model):
+    _inherit = 'product.template'
+
+    #TODO add a function field for volume? an onchange?
+    _columns = {
+        'width': fields.float('Width', help="The width in m."),
+        'length': fields.float('Length', help="The length in m."),
+        'height': fields.float('Height', help="The height in m."),
+    }
+

=== added file 'product_dimension/product_view.xml'
--- product_dimension/product_view.xml	1970-01-01 00:00:00 +0000
+++ product_dimension/product_view.xml	2013-06-24 23:03:25 +0000
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  product_dimension for OpenERP
+  Copyright (C) 2013 Akretion (http://www.akretion.com/)
+  @author: Sébastien BEAU <sebastien.beau@xxxxxxxxxxxx>
+  The licence is in the file __openerp__.py
+-->
+
+
+<openerp>
+    <data>
+
+        <record id="product_normal_form_view" model="ir.ui.view">
+            <field name="name">product_dimension.product.normal.form.view</field>
+            <field name="model">product.product</field>
+            <field name="inherit_id" ref="product.product_normal_form_view" />
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <group name="Weights" position="inside">
+                    <field name="length" />
+                    <field name="width" />
+                    <field name="height" />
+                </group>
+            </field>
+        </record>
+
+    </data>
+</openerp>
+


Follow ups