← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/stock-logistic-barcode/7.0-fix_1330459-sge+afe into lp:stock-logistic-barcode

 

Alexandre Fayolle - camptocamp has proposed merging lp:~camptocamp/stock-logistic-barcode/7.0-fix_1330459-sge+afe into lp:stock-logistic-barcode.

Requested reviews:
  Sébastien Gendre - Open-Net (sge-8)
  Stock and Logistic Core Editors (stock-logistic-core-editors)
Related bugs:
  Bug #1330459 in Stock And Logistic Bar Code: "Bar-code generation ignore the height value"
  https://bugs.launchpad.net/stock-logistic-barcode/+bug/1330459

For more details, see:
https://code.launchpad.net/~camptocamp/stock-logistic-barcode/7.0-fix_1330459-sge+afe/+merge/223866

Rename hight to heigh

Integrate and enhance Sébastien Gendre's fix, add a migration script.
-- 
https://code.launchpad.net/~camptocamp/stock-logistic-barcode/7.0-fix_1330459-sge+afe/+merge/223866
Your team Stock and Logistic Core Editors is requested to review the proposed merge of lp:~camptocamp/stock-logistic-barcode/7.0-fix_1330459-sge+afe into lp:stock-logistic-barcode.
=== modified file 'tr_barcode/__openerp__.py'
--- tr_barcode/__openerp__.py	2014-04-08 12:03:02 +0000
+++ tr_barcode/__openerp__.py	2014-06-20 07:40:31 +0000
@@ -21,7 +21,7 @@
 
 {
     'name': 'TR Barcode',
-    'version': '1.1.1',
+    'version': '1.1.4',
     'category': 'Warehouse Management',
     'description': """
 

=== added directory 'tr_barcode/migrations'
=== added directory 'tr_barcode/migrations/1.1.4'
=== added file 'tr_barcode/migrations/1.1.4/pre-migrate.py'
--- tr_barcode/migrations/1.1.4/pre-migrate.py	1970-01-01 00:00:00 +0000
+++ tr_barcode/migrations/1.1.4/pre-migrate.py	2014-06-20 07:40:31 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+#/#############################################################################
+#
+#    Author: Alexandre Fayolle <alexandre.fayolle@xxxxxxxxxxxxxx>
+#    Copyright (C) 2014 Camptocamp.
+#
+#    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/>.
+#
+#/#############################################################################
+
+def migrate(cr, version):
+    if version:
+        cr.execute('ALTER TABLE tr_barcode RENAME COLUMN hight TO height')

=== modified file 'tr_barcode/tr_barcode.py'
--- tr_barcode/tr_barcode.py	2014-04-08 12:03:02 +0000
+++ tr_barcode/tr_barcode.py	2014-06-20 07:40:31 +0000
@@ -64,19 +64,22 @@
         'image': fields.binary('Data'),
         'width':fields.integer("Width",
                 help="Leave Blank or 0(ZERO) for default size"),
-        'hight':fields.integer("Hight",
+        'height':fields.integer("Height",
                 help="Leave Blank or 0(ZERO) for default size"),
         'hr_form':fields.boolean("Human Readable",
                 help="To genrate Barcode In Human readable form"),
         'barcode_type':fields.selection(_get_code, 'Type'),
     }
 
-    def get_image(self, value, width, hight, hr, code='QR'):
+    def get_image(self, value, width, height, hr, code='QR'):
         """ genrating image for barcode """
         options = {}
-        if width:options['width'] = width
-        if hight:options['hight'] = hight
-        if hr:options['humanReadable'] = hr
+        if width:
+            options['width'] = width
+        if height:
+            options['height'] = height
+        if hr:
+            options['humanReadable'] = hr
         options['quiet'] = False
         options['barWidth'] = 2
 #        options['isoScale'] = 1
@@ -108,7 +111,7 @@
         for self_obj in self.browse(cr, uid, ids, context=context):
             image = self.get_image(self_obj.code,
                         code=self_obj.barcode_type or 'qrcode',
-                        width=self_obj.width, hight=self_obj.hight,
+                        width=self_obj.width, height=self_obj.height,
                         hr=self_obj.hr_form)
             self.write(cr, uid, self_obj.id,
                 {'image':image},context=context)

=== modified file 'tr_barcode/tr_barcode_view.xml'
--- tr_barcode/tr_barcode_view.xml	2013-02-18 09:27:15 +0000
+++ tr_barcode/tr_barcode_view.xml	2014-06-20 07:40:31 +0000
@@ -10,7 +10,7 @@
                     <field name="res_id" select="1" readonly="1"/>
                     <field name="barcode_type" required="1"/>
                     <field name="width"/>
-                    <field name="hight"/>
+                    <field name="height"/>
                     <field name="hr_form"/>
                     <newline/>
                     <button name="generate_image" string="Generate Barcode Image" type="object" icon="gtk-go-forward" colspan="2"/>

=== modified file 'tr_barcode/wizard/tr_barcode_wizard.py'
--- tr_barcode/wizard/tr_barcode_wizard.py	2014-02-28 09:20:57 +0000
+++ tr_barcode/wizard/tr_barcode_wizard.py	2014-06-20 07:40:31 +0000
@@ -53,7 +53,7 @@
         'barcode':fields.char('Barcode',size=256),
         'width':fields.integer("Width",
                 help="Leave Blank or 0(ZERO) for default size"),
-        'hight':fields.integer("Hight",
+        'height':fields.integer("Height",
                 help="Leave Blank or 0(ZERO) for default size"),
         'hr_form':fields.boolean("Human Readable",
                 help="To genrate Barcode In Human readable form"),
@@ -98,7 +98,7 @@
                 'code':self_obj.barcode,
                 'barcode_type':self_obj.barcode_type,
                 'width':self_obj.width,
-                'hight':self_obj.hight,
+                'height':self_obj.height,
                 'hr_form':self_obj.hr_form,
                 'res_model':context.get('src_model',False) or \
                             context['active_model'],

=== modified file 'tr_barcode_config/barcode/barcode_osv.py'
--- tr_barcode_config/barcode/barcode_osv.py	2014-03-13 10:10:32 +0000
+++ tr_barcode_config/barcode/barcode_osv.py	2014-06-20 07:40:31 +0000
@@ -38,7 +38,7 @@
                 'code': vals.get(barcode_config.field.name, False),
                 'barcode_type': barcode_config.barcode_type,
                 'width': barcode_config.width,
-                'hight': barcode_config.height,
+                'height': barcode_config.height,
                 'hr_form': barcode_config.hr_form,
             }
             if not barcode_vals['code']:
@@ -81,7 +81,7 @@
                 'res_id': id,
                 'barcode_type': barcode_config.barcode_type,
                 'width': barcode_config.width,
-                'hight': barcode_config.height,
+                'height': barcode_config.height,
                 'hr_form': barcode_config.hr_form,
             }
             if not barcode_vals.get('code', False):