From e9ae0b4906921dad23a9c6c3ce95994d2bfc5a21 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 8 Feb 2012 14:31:45 +0100 Subject: [PATCH 001/186] [IMP] Kanban: renamed button 'New' to 'Create' in order to match list view bzr revid: fme@openerp.com-20120208133145-jvx9u1i3tdvkw250 --- addons/web_kanban/static/src/xml/web_kanban.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_kanban/static/src/xml/web_kanban.xml b/addons/web_kanban/static/src/xml/web_kanban.xml index 3490b7a171f..fb506d6ffa7 100644 --- a/addons/web_kanban/static/src/xml/web_kanban.xml +++ b/addons/web_kanban/static/src/xml/web_kanban.xml @@ -2,7 +2,7 @@
- +
From 301afd4baa4b2cd8ae10f3de3fe525104f993d0a Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Wed, 8 Feb 2012 14:50:10 +0100 Subject: [PATCH 002/186] [REM] hide menutip option from user preference bzr revid: al@openerp.com-20120208135010-u6s6tl1loss9a74u --- openerp/addons/base/base_update.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/base_update.xml b/openerp/addons/base/base_update.xml index aa38561dacd..c5594f76e22 100644 --- a/openerp/addons/base/base_update.xml +++ b/openerp/addons/base/base_update.xml @@ -89,7 +89,7 @@ - + From 9cc531505f7a00083b32a91215dbef3213dc2a02 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 8 Feb 2012 14:56:55 +0100 Subject: [PATCH 003/186] [FIX] formatting of float_time fields lp bug: https://launchpad.net/bugs/928220 fixed bzr revid: xmo@openerp.com-20120208135655-79qnr5tl6admxr1e --- addons/web/static/src/js/formats.js | 7 ++++++- addons/web/static/test/formats.js | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index eb7d6c335ac..d35a28f36b7 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -101,7 +101,12 @@ openerp.web.format_value = function (value, descriptor, value_if_empty) { formatted[0] = openerp.web.insert_thousand_seps(formatted[0]); return formatted.join(l10n.decimal_point); case 'float_time': - return _.str.sprintf("%02d:%02d", + var pattern = '%02d:%02d'; + if (value < 0) { + value = Math.abs(value); + pattern = '-' + pattern; + } + return _.str.sprintf(pattern, Math.floor(value), Math.round((value % 1) * 60)); case 'many2one': diff --git a/addons/web/static/test/formats.js b/addons/web/static/test/formats.js index 640eaaadca7..2e292af41c8 100644 --- a/addons/web/static/test/formats.js +++ b/addons/web/static/test/formats.js @@ -71,6 +71,15 @@ $(document).ready(function () { strictEqual( openerp.web.format_value(0.0085, {type:'float', widget:'float_time'}), '00:01'); + strictEqual( + openerp.web.format_value(-1.0, {type:'float', widget:'float_time'}), + '-01:00'); + strictEqual( + openerp.web.format_value(-0.9853, {type:'float', widget:'float_time'}), + '-00:59'); + strictEqual( + openerp.web.format_value(-0.0085, {type:'float', widget:'float_time'}), + '-00:01'); }); test("format_float", function () { var fl = 12.1234; From 5af49817f451584930b762ad6ccf7b572037fb07 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 8 Feb 2012 14:59:45 +0100 Subject: [PATCH 004/186] [FIX] allow text inside
- +
@@ -44,6 +44,12 @@
+ +
+ +
+
+
There are pending operations that could not be saved into the database, are you sure you want to exit?
@@ -531,30 +537,7 @@
-
-
-
- -
Help
-
-
-
-
- -
Close
-
-
-
-
- -
Client Mode
-
-
-
    -
From 7a1cee1401bf7c5ea97981a69b4f25a0601ba1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 20 Jul 2012 17:24:21 +0200 Subject: [PATCH 020/186] [IMP] point_of_sale: refactored the ean checksum method bzr revid: fva@openerp.com-20120720152421-lfq05r6xkczl1y56 --- addons/product/product.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 3cbff880cf9..c50ad3c27b9 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -30,15 +30,10 @@ from tools.translate import _ def is_pair(x): return not x%2 -def check_ean(eancode): - if not eancode: - return True +def ean_checksum(eancode): + """returns the checksum of an ean string of length 13, returns -1 if the string has the wrong length""" if len(eancode) <> 13: - return False - try: - int(eancode) - except: - return False + return -1 oddsum=0 evensum=0 total=0 @@ -54,10 +49,20 @@ def check_ean(eancode): total=(oddsum * 3) + evensum check = int(10 - math.ceil(total % 10.0)) %10 + return check - if check != int(eancode[-1]): +def check_ean(eancode): + """returns True if eancode is a valid ean13 string, or null""" + if not eancode: + return True + if len(eancode) <> 13: return False - return True + try: + int(eancode) + except: + return False + return ean_checksum(eancode) == int(eancode[-1]) + #---------------------------------------------------------- # UOM #---------------------------------------------------------- From f1fbf44b5c9ae1275c9fb9e6a5c1ef8e337742a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20van=20der=20Essen?= Date: Fri, 20 Jul 2012 19:00:12 +0200 Subject: [PATCH 021/186] [WIP] point_of_sale: barcode validation wizard (wip) bzr revid: fva@openerp.com-20120720170012-eqp81clbpbfsr3hl --- addons/point_of_sale/point_of_sale.py | 38 ++++++++++++------ addons/point_of_sale/point_of_sale_view.xml | 44 +++++++++++++++------ addons/product/product.py | 13 ++++++ 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index ed3fa9c1730..d86d4c3d8ad 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -22,6 +22,7 @@ import pdb import io import openerp import addons +import openerp.addons.product.product import time from datetime import datetime @@ -143,8 +144,6 @@ class pos_config(osv.osv): obj.sequence_id.unlink() return super(pos_config, self).unlink(cr, uid, ids, context=context) -pos_config() - class pos_session(osv.osv): _name = 'pos.session' _order = 'id desc' @@ -425,8 +424,6 @@ class pos_session(osv.osv): 'context' : context, } -pos_session() - class pos_order(osv.osv): _name = "pos.order" _description = "Point of Sale" @@ -1038,8 +1035,6 @@ class pos_order(osv.osv): self.create_account_move(cr, uid, ids, context=context) return True -pos_order() - class account_bank_statement(osv.osv): _inherit = 'account.bank.statement' _columns= { @@ -1138,8 +1133,6 @@ class pos_order_line(osv.osv): }) return super(pos_order_line, self).copy_data(cr, uid, id, default, context=context) -pos_order_line() - class pos_category(osv.osv): _name = 'pos.category' _description = "Point of Sale Category" @@ -1211,12 +1204,24 @@ class pos_category(osv.osv): # 'category_image': _get_default_image, #} -pos_category() - import io, StringIO +class ean_wizard(osv.osv_memory): + _name = 'pos.ean_wizard' + _columns = { + 'ean13_pattern': fields.char('Ean13 Pattern', size=32, required=True, translate=True), + } + def sanitize_ean13(self, cr, uid, ids, context): + for r in self.browse(cr,uid,ids): + ean13 = openerp.addons.product.product.sanitize_ean13(r.ean13_pattern) + m = context.get('active_model') + m_id = context.get('active_id') + self.pool.get(m).write(cr,uid,[m_id],{'ean13':ean13}) + class product_product(osv.osv): _inherit = 'product.product' + + def _get_small_image(self, cr, uid, ids, prop, unknow_none, context=None): result = {} for obj in self.browse(cr, uid, ids, context=context): @@ -1247,7 +1252,16 @@ class product_product(osv.osv): 'to_weight' : False, } -product_product() - + def add_ean13(self, cr, uid, ids, context): + return { + 'name': _('Return Products'), + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'pos.ean_wizard', + 'target' : 'new', + 'view_id': False, + 'context':context, + } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index f3b491116b7..1145189b408 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -618,12 +618,22 @@ form - - - - - - + + + + + + + + + + + + + + +