diff options
Diffstat (limited to 'addons/barcodes')
| -rw-r--r-- | addons/barcodes/i18n/zh_CN.po | 7 | ||||
| -rw-r--r-- | addons/barcodes/models/__init__.py | 1 | ||||
| -rw-r--r-- | addons/barcodes/models/ir_http.py | 14 | ||||
| -rw-r--r-- | addons/barcodes/static/src/js/barcode_events.js | 3 |
4 files changed, 21 insertions, 4 deletions
diff --git a/addons/barcodes/i18n/zh_CN.po b/addons/barcodes/i18n/zh_CN.po index 593952080e4..b8d23102465 100644 --- a/addons/barcodes/i18n/zh_CN.po +++ b/addons/barcodes/i18n/zh_CN.po @@ -3,16 +3,17 @@ # * barcodes # # Translators: -# Jeffery CHEN <jeffery9@gmail.com>, 2016 +# Jeffery CHEN Fan <jeffery9@gmail.com>, 2016 # 苏州远鼎 <tiexinliu@126.com>, 2016 # liAnGjiA <liangjia@qq.com>, 2017 +# 老窦 北京 <2662059195@qq.com>, 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server 10.saas~18\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-09-20 09:53+0000\n" "PO-Revision-Date: 2017-09-20 09:53+0000\n" -"Last-Translator: liAnGjiA <liangjia@qq.com>, 2017\n" +"Last-Translator: 老窦 北京 <2662059195@qq.com>, 2018\n" "Language-Team: Chinese (China) (https://www.transifex.com/odoo/teams/41243/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -193,7 +194,7 @@ msgstr "编码" #: code:addons/barcodes/static/src/js/barcode_form_view.js:301 #, python-format msgid "Error : Barcode command is undefined" -msgstr "" +msgstr "错误:条码命令未定义" #. module: barcodes #. openerp-web diff --git a/addons/barcodes/models/__init__.py b/addons/barcodes/models/__init__.py index 05b9acf6f97..e3f49cb14ed 100644 --- a/addons/barcodes/models/__init__.py +++ b/addons/barcodes/models/__init__.py @@ -1,3 +1,4 @@ # -*- coding: utf-8 -*- from . import barcodes from . import barcode_events_mixin +from . import ir_http diff --git a/addons/barcodes/models/ir_http.py b/addons/barcodes/models/ir_http.py new file mode 100644 index 00000000000..7ff6aa7c8f2 --- /dev/null +++ b/addons/barcodes/models/ir_http.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models + + +class IrHttp(models.AbstractModel): + _inherit = 'ir.http' + + def session_info(self): + res = super(IrHttp, self).session_info() + res['max_time_between_keys_in_ms'] = int( + self.env['ir.config_parameter'].sudo().get_param('barcode.max_time_between_keys_in_ms', default='55')) + return res diff --git a/addons/barcodes/static/src/js/barcode_events.js b/addons/barcodes/static/src/js/barcode_events.js index f26748ac7b3..e02d3aafdb7 100644 --- a/addons/barcodes/static/src/js/barcode_events.js +++ b/addons/barcodes/static/src/js/barcode_events.js @@ -3,6 +3,7 @@ odoo.define('barcodes.BarcodeEvents', function(require) { var core = require('web.core'); var mixins = require('web.mixins'); +var session = require('web.session'); // For IE >= 9, use this, new CustomEvent(), instead of new Event() @@ -26,7 +27,7 @@ var BarcodeEvents = core.Class.extend(mixins.PropertiesMixin, { suffix: /[\n\r\t]+/, // Keys from a barcode scanner are usually processed as quick as possible, // but some scanners can use an intercharacter delay (we support <= 50 ms) - max_time_between_keys_in_ms: 55, + max_time_between_keys_in_ms: session.max_time_between_keys_in_ms || 55, init: function() { mixins.PropertiesMixin.init.call(this); |
