diff options
Diffstat (limited to 'addons/web')
| -rw-r--r-- | addons/web/i18n/zh_CN.po | 101 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/fields/special_fields.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_column.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/less/webclient.less | 50 | ||||
| -rw-r--r-- | addons/web/static/tests/fields/basic_fields_tests.js | 4 | ||||
| -rw-r--r-- | addons/web/static/tests/fields/relational_fields_tests.js | 87 |
8 files changed, 174 insertions, 75 deletions
diff --git a/addons/web/i18n/zh_CN.po b/addons/web/i18n/zh_CN.po index b9f131801ae..4a4ac82e4ff 100644 --- a/addons/web/i18n/zh_CN.po +++ b/addons/web/i18n/zh_CN.po @@ -4,8 +4,8 @@ # # Translators: # Jeffery CHEN Fan <jeffery9@gmail.com>, 2016 -# Martin Trigaux <mat@odoo.com>, 2016 -# fausthuang <faust_huang@hotmail.com>, 2016 +# Martin Trigaux, 2016 +# fausthuang, 2016 # Gary Wei <Gary.wei@elico-corp.com>, 2016 # Talway <9010446@qq.com>, 2016 # xiaobin wu <bd5dml@gmail.com>, 2016 @@ -18,13 +18,14 @@ # 菜小蛇 <lttlsnk@gmail.com>, 2016 # 苏州远鼎 <tiexinliu@126.com>, 2017 # 卓忆科技 <zhanghao@jointd.com>, 2017 +# 山西清水欧度(QQ:54773801) <54773801@qq.com>, 2018 msgid "" msgstr "" "Project-Id-Version: Odoo Server saas~11.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-12-13 14:37+0000\n" "PO-Revision-Date: 2017-12-13 14:37+0000\n" -"Last-Translator: 卓忆科技 <zhanghao@jointd.com>, 2017\n" +"Last-Translator: 山西清水欧度(QQ:54773801) <54773801@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" @@ -51,7 +52,7 @@ msgstr " [我]" #: code:addons/web/static/src/js/chrome/search_filters.js:226 #, python-format msgid " and " -msgstr "" +msgstr " 与" #. module: web #. openerp-web @@ -154,6 +155,9 @@ msgid "" " <body class=\"ie9\">\n" " <![endif]-->" msgstr "" +"<!—[if lt IE 10]>\n" +" <body class=“ie9”>\n" +" <![endif]—>" #. module: web #: model:ir.ui.view,arch_db:web.minimal_layout @@ -200,7 +204,7 @@ msgstr "'%s' 不是正确的整数" #: code:addons/web/static/src/js/fields/field_utils.js:483 #, python-format msgid "'%s' is not a correct monetary field" -msgstr "" +msgstr "‘%s’ 不是正确的货币字段" #. module: web #. openerp-web @@ -228,7 +232,7 @@ msgstr "(无标签)" #: code:addons/web/static/src/js/fields/field_utils.js:239 #, python-format msgid "1 record" -msgstr "" +msgstr "1条记录" #. module: web #: model:ir.ui.view,arch_db:web.menu_secondary @@ -247,21 +251,21 @@ msgstr "<span>Odoo</span>" msgid "" "A popup window with your report was blocked. You may need to change your " "browser settings to allow popup windows for this page." -msgstr "" +msgstr "你的报告弹出窗口被封锁了。您可能需要更改浏览器设置,以允许此页的弹出窗口。" #. module: web #. openerp-web #: code:addons/web/static/src/xml/base.xml:589 #, python-format msgid "ALL" -msgstr "" +msgstr "所有" #. module: web #. openerp-web #: code:addons/web/static/src/xml/base.xml:590 #, python-format msgid "ANY" -msgstr "" +msgstr "任何" #. module: web #. openerp-web @@ -452,7 +456,7 @@ msgstr "发生了错误" msgid "" "An unknown CORS error occured. The error probably originates from a " "JavaScript file served from a different origin." -msgstr "" +msgstr "发生未知的CORS错误。 该错误可能来自不同来源的JavaScript文件。" #. module: web #. openerp-web @@ -548,7 +552,7 @@ msgstr "柱状图" msgid "" "Binary fields can not be exported to Excel unless their content is " "base64-encoded. That does not seem to be the case for %s." -msgstr "" +msgstr "二进制字段不能导出到Excel,除非他们的内容是Base64编码。这似乎不适用于 %s。" #. module: web #. openerp-web @@ -1229,6 +1233,9 @@ msgid "" "\n" "Tip: try to flip axis, filter further or reduce the number of measures." msgstr "" +"为了兼容Excel,如果列数超过256,则不能导出数据。\n" +"\n" +"提示:尝试翻转轴,进一步过滤或减少测量次数。" #. module: web #. openerp-web @@ -1290,7 +1297,7 @@ msgstr "" #: code:addons/web/static/src/js/core/dialog.js:250 #, python-format msgid "I am sure about this." -msgstr "" +msgstr "我确信这一点。" #. module: web #. openerp-web @@ -1335,7 +1342,7 @@ msgstr "无效的数据" msgid "" "Invalid database name. Only alphanumerical characters, underscore, hyphen " "and dot are allowed." -msgstr "" +msgstr "数据库名称无效。只允许字母数字字符,下划线,连字符和点。" #. module: web #. openerp-web @@ -1364,7 +1371,7 @@ msgstr "非法的模式" #: code:addons/web/static/src/js/widgets/debug_manager.js:208 #, python-format msgid "JS Mobile Tests" -msgstr "" +msgstr "JS移动端测试" #. module: web #. openerp-web @@ -1471,7 +1478,7 @@ msgstr "M2O搜索字段目前不支持多个默认值" #. module: web #: model:ir.ui.view,arch_db:web.external_layout_boxed msgid "Mail:" -msgstr "" +msgstr "Mail:" #. module: web #: model:ir.ui.view,arch_db:web.login_layout @@ -1498,14 +1505,14 @@ msgstr "匹配" #: code:addons/web/static/src/xml/base.xml:603 #, python-format msgid "Match records with" -msgstr "" +msgstr "配记录" #. module: web #. openerp-web #: code:addons/web/static/src/xml/base.xml:601 #, python-format msgid "Match records with the following rule:" -msgstr "" +msgstr "根据以下规则匹配记录:" #. module: web #. openerp-web @@ -1612,7 +1619,7 @@ msgstr "我的Odoo.com帐号" #: code:addons/web/static/src/xml/base.xml:591 #, python-format msgid "NONE" -msgstr "" +msgstr "无" #. module: web #. openerp-web @@ -1835,7 +1842,7 @@ msgstr "仅整型数值是合法的。" #, python-format msgid "" "Only employee can access this database. Please contact the administrator." -msgstr "" +msgstr "只有员工才能访问这个数据库。请与管理员联系。" #. module: web #. openerp-web @@ -1941,7 +1948,7 @@ msgstr "透视表" #: code:addons/web/static/src/js/views/list/list_renderer.js:327 #, python-format msgid "Please click on the \"save\" button first" -msgstr "" +msgstr "请先点击“保存”按钮" #. module: web #. openerp-web @@ -1993,7 +2000,7 @@ msgstr "" #, python-format msgid "" "Please use the copy button to report the error to your support service." -msgstr "" +msgstr "请使用复制按钮将错误报告给您的支持服务。" #. module: web #: model:ir.ui.view,arch_db:web.menu_secondary @@ -2112,7 +2119,7 @@ msgstr "恢复记录" #: code:addons/web/static/src/xml/base.xml:223 #, python-format msgid "Run JS Mobile Tests" -msgstr "" +msgstr "运行JS 移动端测试" #. module: web #. openerp-web @@ -2380,7 +2387,7 @@ msgstr "" #: code:addons/web/static/src/js/widgets/switch_company_menu.js:44 #, python-format msgid "Tap on the list to change company" -msgstr "" +msgstr "点击列表更改公司" #. module: web #. openerp-web @@ -2401,7 +2408,7 @@ msgstr "电话:" #: code:addons/web/static/src/js/widgets/domain_selector.js:567 #, python-format msgid "The domain you entered is not properly formed" -msgstr "" +msgstr "您输入的域格式不正确。" #. module: web #. openerp-web @@ -2410,7 +2417,7 @@ msgstr "" msgid "" "The field chain is not valid. Did you maybe use a non-existing field name or" " followed a non-relational field?" -msgstr "" +msgstr "字段链无效。 你可能使用了一个不存在的字段名称,或者跟着一个非关系的字段?" #. module: web #. openerp-web @@ -2446,7 +2453,7 @@ msgstr "你提供的原密码是错误的,密码没有改变" msgid "" "The record has been modified, your changes will be discarded. Do you want to" " proceed?" -msgstr "" +msgstr "记录已被修改,您的更改将被丢弃。你想继续吗?" #. module: web #. openerp-web @@ -2470,7 +2477,7 @@ msgstr "字段类型 '%s' 必须是一个关联到 'ir.attachment'模型的 man msgid "" "There are too many rows (%s rows, limit: 65535) to export as Excel 97-2003 " "(.xls) format. Consider splitting the export." -msgstr "" +msgstr "有太多行 (%s行, 限制: 65535) 导出为 Excel 97-2003 (. xls) 格式。考虑拆分导出。" #. module: web #. openerp-web @@ -2484,7 +2491,7 @@ msgstr "上传文件时发生了问题" #: code:addons/web/static/src/js/widgets/domain_selector.js:459 #, python-format msgid "This domain is not supported." -msgstr "" +msgstr "此域不受支持" #. module: web #. openerp-web @@ -2725,17 +2732,17 @@ msgstr "警告" #. module: web #: model:ir.ui.view,arch_db:web.benchmark_suite msgid "Web Benchmarks" -msgstr "" +msgstr "Web 基准" #. module: web #: model:ir.ui.view,arch_db:web.qunit_mobile_suite msgid "Web Mobile Tests" -msgstr "" +msgstr "Web 移动端测试" #. module: web #: model:ir.ui.view,arch_db:web.qunit_suite msgid "Web Tests" -msgstr "" +msgstr "Web 测试" #. module: web #: model:ir.ui.view,arch_db:web.external_layout_boxed @@ -2826,7 +2833,7 @@ msgstr "正要创建新的 %s,确认它真的不存在吗?" #: code:addons/web/static/src/js/widgets/model_field_selector.js:455 #, python-format msgid "You cannot follow relations for this field chain construction" -msgstr "" +msgstr "无法跟踪此字段链结构的关系。" #. module: web #: code:addons/web/controllers/main.py:787 @@ -2885,13 +2892,15 @@ msgid "" "shown in html.<br><br><a href=\"http://wkhtmltopdf.org/\" " "target=\"_blank\">wkhtmltopdf.org</a>" msgstr "" +"你安装的 Wkhtmltopdf 似乎坏了。该报告将以 html 格式显示。<br> <br> <a " +"href=“http://wkhtmltopdf.org/“ target=“_blank”> wkhtmltopdf.org </a>" #. module: web #. openerp-web #: code:addons/web/static/src/js/views/kanban/kanban_record.js:199 #, python-format msgid "[No widget %s]" -msgstr "" +msgstr "[没有小部件 %s]" #. module: web #. openerp-web @@ -2945,7 +2954,7 @@ msgstr "base" #: code:addons/web/static/src/js/widgets/domain_selector.js:28 #, python-format msgid "child of" -msgstr "" +msgstr "子类" #. module: web #. openerp-web @@ -3005,14 +3014,14 @@ msgstr "是" #: code:addons/web/static/src/js/chrome/search_filters.js:183 #, python-format msgid "is after" -msgstr "" +msgstr "在之后" #. module: web #. openerp-web #: code:addons/web/static/src/js/chrome/search_filters.js:184 #, python-format msgid "is before" -msgstr "" +msgstr "在之前" #. module: web #. openerp-web @@ -3092,7 +3101,7 @@ msgstr "为真" #: code:addons/web/static/src/js/core/utils.js:111 #, python-format msgid "kMGTPE" -msgstr "" +msgstr "kMGTPE" #. module: web #. openerp-web @@ -3123,7 +3132,7 @@ msgstr "少于及等于" #: code:addons/web/static/src/xml/base.xml:686 #, python-format msgid "not" -msgstr "" +msgstr "不是" #. module: web #. openerp-web @@ -3144,35 +3153,35 @@ msgstr "不是一个有效的数字" #: code:addons/web/static/src/js/widgets/domain_selector.js:24 #, python-format msgid "not contains" -msgstr "" +msgstr "不包含" #. module: web #. openerp-web #: code:addons/web/static/src/js/widgets/domain_selector.js:26 #, python-format msgid "not in" -msgstr "" +msgstr "不在" #. module: web #. openerp-web #: code:addons/web/static/src/js/widgets/domain_selector.js:658 #, python-format msgid "not set (false)" -msgstr "" +msgstr "未设置 (否)" #. module: web #. openerp-web #: code:addons/web/static/src/xml/base.xml:605 #, python-format msgid "of the following rules:" -msgstr "" +msgstr "以下规则:" #. module: web #. openerp-web #: code:addons/web/static/src/xml/base.xml:620 #, python-format msgid "of:" -msgstr "" +msgstr "的:" #. module: web #. openerp-web @@ -3187,7 +3196,7 @@ msgstr "或" #: code:addons/web/static/src/js/widgets/domain_selector.js:29 #, python-format msgid "parent of" -msgstr "" +msgstr "父类" #. module: web #. openerp-web @@ -3208,11 +3217,11 @@ msgstr "剩余)" #: code:addons/web/static/src/xml/base.xml:686 #, python-format msgid "set" -msgstr "" +msgstr "设置" #. module: web #. openerp-web #: code:addons/web/static/src/js/widgets/domain_selector.js:658 #, python-format msgid "set (true)" -msgstr "" +msgstr "设置(真)" diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index c9375c2d4b9..75aa1acd164 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -1082,6 +1082,7 @@ var UrlWidget = InputField.extend({ _renderReadonly: function () { this.$el.text(this.attrs.text || this.value) .addClass('o_form_uri o_text_overflow') + .attr('target', '_blank') .attr('href', this.value); } }); diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 1ee40bfccdb..eba8dc90704 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -1105,6 +1105,7 @@ var FieldX2Many = AbstractField.extend({ * @param {OdooEvent} event */ _onResequence: function (event) { + event.stopPropagation(); var self = this; this.trigger_up('freeze_order', {id: this.value.id}); var rowIDs = event.data.rowIDs.slice(); diff --git a/addons/web/static/src/js/fields/special_fields.js b/addons/web/static/src/js/fields/special_fields.js index 19db97fe985..6bd5d03ac69 100644 --- a/addons/web/static/src/js/fields/special_fields.js +++ b/addons/web/static/src/js/fields/special_fields.js @@ -20,7 +20,8 @@ var FieldTimezoneMismatch = FieldSelection.extend({ * @override */ start: function () { - this._datetime = setInterval(this._renderDateTimeTimezone.bind(this), 1000); + var interval = navigator.platform.toUpperCase().indexOf('MAC') >= 0 ? 60000 : 1000; + this._datetime = setInterval(this._renderDateTimeTimezone.bind(this), interval); return this._super.apply(this, arguments); }, /** diff --git a/addons/web/static/src/js/views/kanban/kanban_column.js b/addons/web/static/src/js/views/kanban/kanban_column.js index 038e7f53d30..e66601816c2 100644 --- a/addons/web/static/src/js/views/kanban/kanban_column.js +++ b/addons/web/static/src/js/views/kanban/kanban_column.js @@ -102,7 +102,7 @@ var KanbanColumn = Widget.extend({ // should find a way to use the touch events to make sortable work. this.$el.sortable({ connectWith: '.o_kanban_group', - containment: this.draggable ? '.o_kanban_view' : 'parent', + containment: this.draggable ? false : 'parent', revert: 0, delay: 0, items: '> .o_kanban_record:not(.o_updating)', diff --git a/addons/web/static/src/less/webclient.less b/addons/web/static/src/less/webclient.less index 1ad894de3de..af76b82faba 100644 --- a/addons/web/static/src/less/webclient.less +++ b/addons/web/static/src/less/webclient.less @@ -80,39 +80,37 @@ div.o_boolean_toggle { width: 32px !important; height: 18px; - & > label { - & > input { + > input { display: none; } - & > .slider { + .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #a0a0a0; + border-radius: 24px; + + &:before { position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: #a0a0a0; - border-radius: 24px; - - &:before { - position: absolute; - content: ""; - height: 12px; - width: 12px; - left: 3px; - bottom: 3px; - background-color: white; - border-radius: 50%; - } + content: ""; + height: 12px; + width: 12px; + left: 3px; + bottom: 3px; + background-color: white; + border-radius: 50%; } + } - & > input:checked + .slider { - background-color: @odoo-brand-optional; + > input:checked + .slider { + background-color: @odoo-brand-optional; - &:before { - .translate(14px; 0px); - } + &:before { + .translate(14px; 0px); } } } diff --git a/addons/web/static/tests/fields/basic_fields_tests.js b/addons/web/static/tests/fields/basic_fields_tests.js index 44f00d1d7f9..8488076b3f0 100644 --- a/addons/web/static/tests/fields/basic_fields_tests.js +++ b/addons/web/static/tests/fields/basic_fields_tests.js @@ -1111,7 +1111,7 @@ QUnit.module('basic_fields', { QUnit.module('UrlWidget'); QUnit.test('url widget in form view', function (assert) { - assert.expect(8); + assert.expect(9); var form = createView({ View: FormView, @@ -1131,6 +1131,8 @@ QUnit.module('basic_fields', { "should have a anchor with correct classes"); assert.strictEqual(form.$('a.o_form_uri.o_field_widget.o_text_overflow').attr('href'), 'yop', "should have proper href link"); + assert.strictEqual(form.$('a.o_form_uri.o_field_widget.o_text_overflow').attr('target'), '_blank', + "should have target attribute set to _blank"); assert.strictEqual(form.$('a.o_form_uri.o_field_widget.o_text_overflow').text(), 'yop', "the value should be displayed properly"); diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index b30f70757e0..beb47c2a22d 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -1321,6 +1321,93 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.test('X2Many sequence list in modal', function (assert) { + assert.expect(5); + + this.data.partner.fields.sequence = {string: 'Sequence', type: 'integer'}; + this.data.partner.records[0].sequence = 1; + this.data.partner.records[1].sequence = 2; + this.data.partner.onchanges = { + sequence: function (obj) { + if (obj.id === 2) { + obj.sequence = 1; + assert.step('onchange sequence'); + } + }, + }; + + this.data.product.fields.turtle_ids = {string: 'Turtles', type: 'one2many', relation: 'turtle'}; + this.data.product.records[0].turtle_ids = [1]; + + this.data.turtle.fields.partner_types_ids = {string: "Partner", type: "one2many", relation: 'partner'}; + this.data.turtle.fields.type_id = {string: "Partner Type", type: "many2one", relation: 'partner_type'}; + + this.data.partner_type.fields.partner_ids = {string: "Partner", type: "one2many", relation: 'partner'}; + this.data.partner_type.records[0].partner_ids = [1,2]; + + testUtils.createAsyncView({ + View: FormView, + model: 'product', + data: this.data, + arch: '<form>' + + '<field name="name"/>' + + '<field name="turtle_ids" widget="one2many_list">' + + '<tree string="Turtles" editable="bottom">' + + '<field name="type_id"/>' + + '</tree>' + + '</field>' + + '</form>', + archs: { + 'partner_type,false,form': '<form><field name="partner_ids"/></form>', + 'partner,false,list': '<tree string="Vendors">' + + '<field name="display_name"/>' + + '<field name="sequence" widget="handle"/>' + + '</tree>', + }, + res_id: 37, + mockRPC: function (route, args) { + if (route === '/web/dataset/call_kw/product/read') { + return $.when([{id: 37, name: 'xphone', display_name: 'leonardo', turtle_ids: [1]}]); + } + if (route === '/web/dataset/call_kw/turtle/read') { + return $.when([{id: 1, type_id: [12, 'gold']}]); + } + if (route === '/web/dataset/call_kw/partner_type/get_formview_id') { + return $.when(false) + } + if (route === '/web/dataset/call_kw/partner_type/read') { + return $.when([{id: 12, partner_ids: [1,2], display_name: 'gold'}]) + } + if (route === '/web/dataset/call_kw/partner_type/write') { + assert.step('partner_type write'); + } + return this._super.apply(this, arguments); + }, + }).then(function(form) { + form.$buttons.find('.o_form_button_edit').click(); + form.$('.o_data_cell').click(); + form.$('.o_external_button').click(); + + var $modal = $('.modal-dialog'); + assert.equal($modal.length, 1, + 'There should be 1 modal opened'); + + var $handles = $modal.find('.ui-sortable-handle'); + assert.equal($handles.length, 2, + 'There should be 2 sequence handlers'); + + testUtils.dragAndDrop($handles.eq(1), $modal.find('tbody tr').first()); + + // Saving the modal and then the original model + $modal.find('.modal-footer .btn-primary').click(); + form.$buttons.find('.o_form_button_save').click(); + + assert.verifySteps(['onchange sequence', 'partner_type write']); + + form.destroy(); + }); + }); + QUnit.test('autocompletion in a many2one, in form view with a domain', function (assert) { assert.expect(1); |
