[MERGE] merge from trunk
bzr revid: ged@openerp.com-20140430085942-umusyhp4cs2ffezj bzr revid: ged@openerp.com-20140430140423-kq0vdboq1mux4zfn
This commit is contained in:
commit
a6b25061ba
|
@ -1088,16 +1088,7 @@ class Menu(http.Controller):
|
||||||
"""
|
"""
|
||||||
s = request.session
|
s = request.session
|
||||||
Menus = s.model('ir.ui.menu')
|
Menus = s.model('ir.ui.menu')
|
||||||
# If a menu action is defined use its domain to get the root menu items
|
|
||||||
user_menu_id = s.model('res.users').read([s.uid], ['menu_id'],
|
|
||||||
request.context)[0]['menu_id']
|
|
||||||
|
|
||||||
menu_domain = [('parent_id', '=', False)]
|
menu_domain = [('parent_id', '=', False)]
|
||||||
if user_menu_id:
|
|
||||||
domain_string = s.model('ir.actions.act_window').read(
|
|
||||||
[user_menu_id[0]], ['domain'],request.context)[0]['domain']
|
|
||||||
if domain_string:
|
|
||||||
menu_domain = ast.literal_eval(domain_string)
|
|
||||||
|
|
||||||
return Menus.search(menu_domain, 0, False, False, request.context)
|
return Menus.search(menu_domain, 0, False, False, request.context)
|
||||||
|
|
||||||
|
|
|
@ -460,14 +460,11 @@ instance.web.Session.include( /** @lends instance.web.Session# */{
|
||||||
.appendTo(document.body)
|
.appendTo(document.body)
|
||||||
.load(function () {
|
.load(function () {
|
||||||
try {
|
try {
|
||||||
if (options.error) {
|
if (options.error) {
|
||||||
if (!this.contentDocument.body.childNodes[1]) {
|
var body = this.contentDocument.body;
|
||||||
options.error(this.contentDocument.body.childNodes);
|
var node = body.childNodes[1] || body.childNodes[0];
|
||||||
}
|
options.error(JSON.parse(node.textContent));
|
||||||
else {
|
}
|
||||||
options.error(JSON.parse(this.contentDocument.body.childNodes[1].textContent));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
complete();
|
complete();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3356,13 +3356,16 @@ instance.web.form.CompletionFieldMixin = {
|
||||||
instance.web.form.M2ODialog = instance.web.Dialog.extend({
|
instance.web.form.M2ODialog = instance.web.Dialog.extend({
|
||||||
template: "M2ODialog",
|
template: "M2ODialog",
|
||||||
init: function(parent) {
|
init: function(parent) {
|
||||||
|
this.name = parent.string;
|
||||||
this._super(parent, {
|
this._super(parent, {
|
||||||
title: _.str.sprintf(_t("Add %s"), parent.string),
|
title: _.str.sprintf(_t("Create a %s"), parent.string),
|
||||||
size: 'medium',
|
size: 'medium',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
start: function() {
|
start: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
var text = _.str.sprintf(_t("You are creating a new %s, are you sure it does not exist yet?"), self.name);
|
||||||
|
this.$("p").text( text );
|
||||||
this.$buttons.html(QWeb.render("M2ODialog.buttons"));
|
this.$buttons.html(QWeb.render("M2ODialog.buttons"));
|
||||||
this.$("input").val(this.getParent().last_query);
|
this.$("input").val(this.getParent().last_query);
|
||||||
this.$buttons.find(".oe_form_m2o_qc_button").click(function(){
|
this.$buttons.find(".oe_form_m2o_qc_button").click(function(){
|
||||||
|
@ -3621,6 +3624,8 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
|
||||||
minLength: 0,
|
minLength: 0,
|
||||||
delay: 250
|
delay: 250
|
||||||
});
|
});
|
||||||
|
// set position for list of suggestions box
|
||||||
|
this.$input.autocomplete( "option", "position", { my : "left top", at: "left bottom" } );
|
||||||
this.$input.autocomplete("widget").openerpClass();
|
this.$input.autocomplete("widget").openerpClass();
|
||||||
// used to correct a bug when selecting an element by pushing 'enter' in an editable list
|
// used to correct a bug when selecting an element by pushing 'enter' in an editable list
|
||||||
this.$input.keyup(function(e) {
|
this.$input.keyup(function(e) {
|
||||||
|
|
|
@ -1948,13 +1948,14 @@
|
||||||
</t>
|
</t>
|
||||||
<t t-name="M2ODialog">
|
<t t-name="M2ODialog">
|
||||||
<div>
|
<div>
|
||||||
|
<p class="oe_grey"/>
|
||||||
Name: <input class="oe_form_m2o_input_name" type="text"/>
|
Name: <input class="oe_form_m2o_input_name" type="text"/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="M2ODialog.buttons">
|
<t t-name="M2ODialog.buttons">
|
||||||
<button class="oe_form_m2o_qc_button oe_button oe_highlight">Quick Add</button>
|
<button class="oe_form_m2o_qc_button oe_button oe_highlight">Create</button>
|
||||||
<button class="oe_form_m2o_sc_button oe_button">Add All Info...</button>
|
<button class="oe_form_m2o_sc_button oe_button">Create and edit</button> or
|
||||||
<button class="oe_form_m2o_cancel_button oe_button">Cancel</button>
|
<button class="oe_form_m2o_cancel_button oe_button oe_link"><span>Cancel</span></button>
|
||||||
</t>
|
</t>
|
||||||
<t t-name="FieldMonetary" t-extend="FieldChar">
|
<t t-name="FieldMonetary" t-extend="FieldChar">
|
||||||
<t t-jquery="t:first" t-operation="before">
|
<t t-jquery="t:first" t-operation="before">
|
||||||
|
|
|
@ -28,9 +28,7 @@ class LoadTest(common.MockRequestCase):
|
||||||
|
|
||||||
self.MockMenus = model('ir.ui.menu')
|
self.MockMenus = model('ir.ui.menu')
|
||||||
# Mock the absence of custom menu
|
# Mock the absence of custom menu
|
||||||
model('res.users').read.return_value = [{
|
model('res.users').read.return_value = []
|
||||||
'menu_id': False
|
|
||||||
}]
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
del self.MockMenus
|
del self.MockMenus
|
||||||
|
|
|
@ -260,21 +260,12 @@ openerp.web_graph.Graph = openerp.web.Widget.extend({
|
||||||
option_selection: function (event) {
|
option_selection: function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
switch (event.currentTarget.getAttribute('data-choice')) {
|
switch (event.currentTarget.getAttribute('data-choice')) {
|
||||||
case 'bar_grouped':
|
|
||||||
this.bar_ui = 'group';
|
|
||||||
if (this.mode === 'bar') {
|
|
||||||
this.display_data();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'bar_stacked':
|
|
||||||
this.bar_ui = 'stack';
|
|
||||||
if (this.mode === 'bar') {
|
|
||||||
this.display_data();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'swap_axis':
|
case 'swap_axis':
|
||||||
this.swap_axis();
|
this.swap_axis();
|
||||||
break;
|
break;
|
||||||
|
case 'expand_all':
|
||||||
|
this.pivot.expand_all().then(this.proxy('display_data'));
|
||||||
|
break;
|
||||||
case 'update_values':
|
case 'update_values':
|
||||||
this.pivot.update_data().then(this.proxy('display_data'));
|
this.pivot.update_data().then(this.proxy('display_data'));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
<label class="btn btn-default" data-choice="swap_axis" title="Swap Axis">
|
<label class="btn btn-default" data-choice="swap_axis" title="Swap Axis">
|
||||||
<span class="fa fa-expand"></span>
|
<span class="fa fa-expand"></span>
|
||||||
</label>
|
</label>
|
||||||
|
<label class="btn btn-default" data-choice="expand_all" title="Expand All">
|
||||||
|
<span class="fa fa-arrows-alt"></span>
|
||||||
|
</label>
|
||||||
<label class="btn btn-default" data-choice="update_values" title="Reload Data">
|
<label class="btn btn-default" data-choice="update_values" title="Reload Data">
|
||||||
<span class="fa fa-refresh"></span>
|
<span class="fa fa-refresh"></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
Loading…
Reference in New Issue