diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-05-26 17:34:04 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-05-28 14:27:38 +0200 |
| commit | fe2b5f35a40ca8df662130608b0f89427a196362 (patch) | |
| tree | 0c7773f0599f3b1e6dbb869104fad0b04869b269 /addons/web/static/src | |
| parent | d4d8a2eae31e7a6a45029b84603e055300e3be36 (diff) | |
| parent | bf1e99964cdbc374f8a0c4cec1b338bf7c7c2930 (diff) | |
[MERGE] forward port of branch saas-6 up to bf1e999
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/css/base.css | 20 | ||||
| -rw-r--r-- | addons/web/static/src/css/base.sass | 13 | ||||
| -rw-r--r-- | addons/web/static/src/js/action_manager.js | 3 | ||||
| -rw-r--r-- | addons/web/static/src/js/framework/crash_manager.js | 15 | ||||
| -rw-r--r-- | addons/web/static/src/js/tour.js | 8 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/form_view.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/form_widgets.js | 10 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/graph_widget.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/pivot_view.js | 13 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/search_filters.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/search_inputs.js | 14 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/search_view.js | 9 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/sidebar.js | 1 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/user_menu.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 10 |
15 files changed, 102 insertions, 23 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 805790930e2..81a1460b0bd 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -52,6 +52,7 @@ box-shadow: 0 0 1px black; left: 50%; transform: translate(-50%, 0); + -webkit-filter: blur(0); } .oe_notification { @@ -3048,6 +3049,12 @@ body.oe_single_form .oe_single_form_container { @media print { body { height: auto !important; + overflow: visible !important; + } + + tr, td { + page-break-inside: avoid; + page-break-after: auto; } .openerp#announcement_bar_table { @@ -3057,6 +3064,13 @@ body.oe_single_form .oe_single_form_container { .openerp { text-shadow: none; } + .openerp.openerp_webclient_container { + display: block; + height: auto !important; + } + .openerp .oe-view-manager { + display: block; + } .openerp .oe_application, .openerp .oe_view_manager_wrapper { height: auto !important; } @@ -3082,6 +3096,9 @@ body.oe_single_form .oe_single_form_container { .openerp .oe_notebook > li.ui-tabs-selected { display: block; } + .openerp .oe_application { + width: auto; + } .openerp .oe_application .oe_form_sheet, .openerp .oe_application .oe_form_sheetbg { border: 0px !important; box-shadow: 0px 0px 0px; @@ -3099,6 +3116,9 @@ body.oe_single_form .oe_single_form_container { .openerp .openerp div.oe_mail_wall { overflow: hidden !important; } + .openerp .oe-view-manager .oe-view-manager-content { + overflow: visible; + } .openerp.openerp_webclient_container { overflow: visible; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index d848bbe6fc0..1f7a0c1560f 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -161,6 +161,7 @@ $sheet-padding: 16px box-shadow: 0 0 1px black left: 50% transform: translate(-50%, 0) + -webkit-filter: blur(0) .oe_notification z-index: 1600 @@ -2520,9 +2521,18 @@ body.oe_single_form @media print body height: auto !important + overflow: visible !important + tr, td + page-break-inside: avoid + page-break-after: auto .openerp#announcement_bar_table display: none .openerp + &.openerp_webclient_container + display: block + height: auto !important + .oe-view-manager + display: block .oe_application, .oe_view_manager_wrapper height: auto !important .oe_application > div > .oe_view_manager > .oe_view_manager_wrapper > div > .oe_view_manager_body @@ -2550,6 +2560,7 @@ body.oe_single_form box-shadow: 0px 0px 0px .oe_list overflow-x: visible + width: auto .oe-control-panel, .oe-o2m-control-panel border: 0px !important box-shadow: 0px 0px 0px @@ -2558,6 +2569,8 @@ body.oe_single_form background: none .openerp div.oe_mail_wall overflow: hidden !important + .oe-view-manager .oe-view-manager-content + overflow: visible .openerp.openerp_webclient_container overflow: visible // }}} diff --git a/addons/web/static/src/js/action_manager.js b/addons/web/static/src/js/action_manager.js index 7b9cfa9cbf8..6700932b4bc 100644 --- a/addons/web/static/src/js/action_manager.js +++ b/addons/web/static/src/js/action_manager.js @@ -507,7 +507,8 @@ var ActionManager = Widget.extend({ pager : (!popup || !form) && !inline, display_title : !popup, headless: (popup || inline) && form, - search_disable_custom_filters: action.context && action.context.search_disable_custom_filters + search_disable_custom_filters: action.context && action.context.search_disable_custom_filters, + default_view: action.context && action.context.params && action.context.params.view_type, }); } diff --git a/addons/web/static/src/js/framework/crash_manager.js b/addons/web/static/src/js/framework/crash_manager.js index 01fef03267b..303cd66a4a3 100644 --- a/addons/web/static/src/js/framework/crash_manager.js +++ b/addons/web/static/src/js/framework/crash_manager.js @@ -36,19 +36,24 @@ var CrashManager = core.Class.extend({ this.active = false; }, rpc_error: function(error) { + var self = this; if (!this.active) { return; } + if (this.$indicator){ + return; + } if (error.code == -32098) { $.blockUI({ message: '' , overlayCSS: {'z-index': 9999, backgroundColor: '#FFFFFF', opacity: 0.0, cursor: 'wait'}}); - var $indicator = $('<div class="oe_indicator">' + _t("Trying to reconnect... ") + '<i class="fa fa-refresh"></i></div>'); - $indicator.prependTo("body"); + this.$indicator = $('<div class="oe_indicator">' + _t("Trying to reconnect... ") + '<i class="fa fa-refresh"></i></div>'); + this.$indicator.prependTo("body"); var timeinterval = setInterval(function(){ ajax.jsonRpc('/web/webclient/version_info').then(function() { clearInterval(timeinterval); - $indicator.html(_t("You are back online")); - $indicator.delay(2000).fadeOut('slow',function(){ - $indicator.remove(); + self.$indicator.html(_t("You are back online")); + self.$indicator.delay(2000).fadeOut('slow',function(){ + $(this).remove(); + self.$indicator.remove(); }); $.unblockUI(); }); diff --git a/addons/web/static/src/js/tour.js b/addons/web/static/src/js/tour.js index ea64a55f22c..234b681f7d2 100644 --- a/addons/web/static/src/js/tour.js +++ b/addons/web/static/src/js/tour.js @@ -76,6 +76,7 @@ var localStorage = window.localStorage; var Tour = { tours: {}, defaultDelay: 50, + autoRunning: true, retryRunningDelay: 1000, errorDelay: 5000, state: null, @@ -378,6 +379,7 @@ var Tour = { }, logError: function (step, message, all) { var state = Tour.getState(); + console.log(state.tour.steps.slice()); message += '\ntour: ' + state.id + (step ? '\nstep: ' + step.id + ": '" + (step._title || step.title) + "'" : '' ) + (all ? '\nhref: ' + window.location.href : '' ) @@ -711,7 +713,11 @@ var Tour = { ///////////////////////////////////////////////// -$(document).ready(Tour.running); +$(document).ready(function () { + if (Tour.autoRunning) { + Tour.running(); + }; +}); return Tour; diff --git a/addons/web/static/src/js/views/form_view.js b/addons/web/static/src/js/views/form_view.js index aa06074401f..df570967f94 100644 --- a/addons/web/static/src/js/views/form_view.js +++ b/addons/web/static/src/js/views/form_view.js @@ -637,7 +637,7 @@ var FormView = View.extend(common.FieldManagerMixin, { // If field is not defined in the view, just ignore it if (field) { var value_ = values[f]; - if (field.get_value() != value_) { + if (field.get_value() !== value_) { field._inhibit_on_change_flag = true; field.set_value(value_); field._inhibit_on_change_flag = false; diff --git a/addons/web/static/src/js/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js index b23bff4cc84..ee04f8376b4 100644 --- a/addons/web/static/src/js/views/form_widgets.js +++ b/addons/web/static/src/js/views/form_widgets.js @@ -1230,9 +1230,11 @@ var FieldBinary = common.AbstractField.extend(common.ReinitializeFieldMixin, { set_filename: function(value) { var filename = this.node.attrs.filename; if (filename) { - var tmp = {}; - tmp[filename] = value; - this.field_manager.set_values(tmp); + var field = this.field_manager.fields[filename]; + if (field) { + field.set_value(value); + field._dirty_flag = true; + } } }, on_clear: function() { @@ -1279,10 +1281,10 @@ var FieldBinaryFile = FieldBinary.extend({ }, on_file_uploaded_and_valid: function(size, name, content_type, file_base64) { this.binary_value = true; + this.set_filename(name); this.internal_set_value(file_base64); var show_value = name + " (" + utils.human_size(size) + ")"; this.$el.find('input').eq(0).val(show_value); - this.set_filename(name); }, on_clear: function() { this._super.apply(this, arguments); diff --git a/addons/web/static/src/js/views/graph_widget.js b/addons/web/static/src/js/views/graph_widget.js index 1e712b5af79..3f8a7566d97 100644 --- a/addons/web/static/src/js/views/graph_widget.js +++ b/addons/web/static/src/js/views/graph_widget.js @@ -168,6 +168,7 @@ return Widget.extend({ // rotateLabels: 40, showControls: (this.groupbys.length > 1) }); + chart.yAxis.tickFormat(function(d) { return openerp.web.format_value(d, { type : 'float' });}); chart(svg); this.to_remove = chart.update; diff --git a/addons/web/static/src/js/views/pivot_view.js b/addons/web/static/src/js/views/pivot_view.js index 1b55895d847..22b74ecbf15 100644 --- a/addons/web/static/src/js/views/pivot_view.js +++ b/addons/web/static/src/js/views/pivot_view.js @@ -60,6 +60,8 @@ var PivotView = View.extend({ this.last_header_selected = null; this.sorted_column = {}; + + this.numbering = {}; }, willStart: function () { var self = this; @@ -490,13 +492,22 @@ var PivotView = View.extend({ }, sanitize_value: function (value, field) { if (value === false) return _t("Undefined"); - if (value instanceof Array) return value[1]; + if (value instanceof Array) return this.get_numbered_value(value, field); if (field && this.fields[field] && (this.fields[field].type === 'selection')) { var selected = _.where(this.fields[field].selection, {0: value})[0]; return selected ? selected[1] : value; } return value; }, + get_numbered_value: function(value, field) { + var id= value[0]; + var name= value[1] + this.numbering[field] = this.numbering[field] || {}; + this.numbering[field][name] = this.numbering[field][name] || {}; + var numbers = this.numbering[field][name]; + numbers[id] = numbers[id] || _.size(numbers) + 1; + return name + (numbers[id] > 1 ? " (" + numbers[id] + ")" : ""); + }, make_header: function (data_pt, root, i, j, parent_header) { var attrs = data_pt.attributes, value = attrs.value, diff --git a/addons/web/static/src/js/views/search_filters.js b/addons/web/static/src/js/views/search_filters.js index 0409fa90a0d..506ddecd805 100644 --- a/addons/web/static/src/js/views/search_filters.js +++ b/addons/web/static/src/js/views/search_filters.js @@ -244,6 +244,10 @@ ExtendedSearchProposition.Float = ExtendedSearchProposition.Field.extend({ {value: "∃", text: _lt("is set")}, {value: "∄", text: _lt("is not set")} ], + init: function (parent) { + this._super(parent); + this.decimal_point = _t.database.parameters.decimal_point; + }, toString: function () { return this.$el.val(); }, diff --git a/addons/web/static/src/js/views/search_inputs.js b/addons/web/static/src/js/views/search_inputs.js index 16f95340dd6..4127b020970 100644 --- a/addons/web/static/src/js/views/search_inputs.js +++ b/addons/web/static/src/js/views/search_inputs.js @@ -22,6 +22,7 @@ var Input = Widget.extend( /** @lends instance.web.search.Input# */{ */ init: function (parent) { this._super(parent); + this.searchview = parent; this.load_attrs({}); }, /** @@ -406,9 +407,17 @@ var ManyToOneField = CharField.extend({ // FIXME: "concurrent" searches (multiple requests, mis-ordered responses) var context = pyeval.eval( 'contexts', [this.searchview.dataset.get_context()]); + var args = this.attrs.domain; + if (typeof args === 'string') { + try { + args = pyeval.eval('domain', args); + } catch(e) { + args = []; + } + } return this.model.call('name_search', [], { name: needle, - args: (typeof this.attrs.domain === 'string') ? [] : this.attrs.domain, + args: args, limit: 8, context: context }).then(function (results) { @@ -433,7 +442,8 @@ var ManyToOneField = CharField.extend({ // to handle this as if it were a single value. value = value[0]; } - return this.model.call('name_get', [value]).then(function (names) { + var context = pyeval.eval('contexts', [this.searchview.dataset.get_context()]); + return this.model.call('name_get', [value], {context: context}).then(function (names) { if (_(names).isEmpty()) { return null; } return facet_from(self, names[0]); }); diff --git a/addons/web/static/src/js/views/search_view.js b/addons/web/static/src/js/views/search_view.js index 1dd1b217951..3511bbca01c 100644 --- a/addons/web/static/src/js/views/search_view.js +++ b/addons/web/static/src/js/views/search_view.js @@ -888,14 +888,15 @@ return Widget.extend({ }, expand: function () { var self = this; - this.current_result.expand(this.get_search_string()).then(function (results) { + var current_result = this.current_result; + current_result.expand(this.get_search_string()).then(function (results) { (results || [{label: '(no result)'}]).reverse().forEach(function (result) { result.indent = true; var $li = self.make_list_item(result); - self.current_result.$el.after($li); + current_result.$el.after($li); }); - self.current_result.expanded = true; - self.current_result.$el.find('span.oe-expand').html('▼'); + current_result.expanded = true; + current_result.$el.find('span.oe-expand').html('▼'); }); }, fold: function () { diff --git a/addons/web/static/src/js/widgets/sidebar.js b/addons/web/static/src/js/widgets/sidebar.js index e0bdcd3f57c..5dc6c147f39 100644 --- a/addons/web/static/src/js/widgets/sidebar.js +++ b/addons/web/static/src/js/widgets/sidebar.js @@ -16,6 +16,7 @@ var Sidebar = Widget.extend({ init: function(parent) { var self = this; this._super(parent); + this.view = this.getParent(); this.sections = [ { 'name' : 'print', 'label' : _t('Print'), }, { 'name' : 'other', 'label' : _t('More'), } diff --git a/addons/web/static/src/js/widgets/user_menu.js b/addons/web/static/src/js/widgets/user_menu.js index fa5ea2bbdf7..dba1704c719 100644 --- a/addons/web/static/src/js/widgets/user_menu.js +++ b/addons/web/static/src/js/widgets/user_menu.js @@ -87,7 +87,7 @@ var SystrayMenu = Widget.extend({ framework.redirect('https://accounts.odoo.com/oauth2/auth?'+$.param(params)); }).fail(function(result, ev){ ev.preventDefault(); - framework.redirect('https://accounts.odoo.com/web'); + framework.redirect('https://accounts.odoo.com/account'); }); } }, diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 7bc79aec9ea..f8f3c7191f3 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -609,12 +609,12 @@ </t> <a class="oe_file_attachment" t-att-title="item.title or ''" t-att-data-section="section.name" t-att-data-index="item_index" t-att-href="item.url"> <t t-raw="item.label"/> - <span t-if="section.name == 'files' and !item.callback" class="oe_sidebar_delete_item" t-att-data-id="item.id" title="Delete this attachment"> + <span t-if="widget.view.is_action_enabled('edit') && section.name == 'files' and !item.callback" class="oe_sidebar_delete_item" t-att-data-id="item.id" title="Delete this attachment"> <i class="fa fa-trash-o"/> </span> </a> </li> - <li t-if="section.name == 'files'" class="oe_sidebar_add_attachment"> + <li t-if="widget.view.is_action_enabled('edit') && section.name == 'files'" class="oe_sidebar_add_attachment"> <t t-call="HiddenInputFile"> <t t-set="fileupload_id" t-value="widget.fileupload_id"/> <t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t> @@ -1755,7 +1755,11 @@ <input type="number" class="field_integer form-control" value = "0" step="1"/> </t> <t t-name="SearchView.extended_search.proposition.float"> - <input type="number" class="field_float form-control" value = "0.0" step="0.01"/> + <input class="field_float form-control" + t-att-type="widget.decimal_point === '.' ? 'number' : 'text'" + t-attf-title="Number using #{widget.decimal_point || '.' } as decimal separator." + t-attf-pattern="[0-9]+([\\#{widget.decimal_point || '.' }][0-9]+)?" + t-attf-value="0#{widget.decimal_point || '.' }0" step="0.01"/> </t> <t t-name="SearchView.extended_search.proposition.selection"> <select class="form-control"> |
