[MERGE] forward port of branch 8.0 up to 890174b

This commit is contained in:
Christophe Simonis
2015-03-12 14:46:06 +01:00
5 changed files with 14 additions and 22 deletions
+1 -4
View File
@@ -606,10 +606,7 @@
<field name="date" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
<field name="name" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
<field name="ref" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
<field name="partner_id" domain="[
'&amp;',
'|',('parent_id','=',False),('is_company','=',True),
'|',('customer','=',True),('supplier','=',True)]"
<field name="partner_id" domain="['|',('parent_id','=',False),('is_company','=',True)]"
context="{'default_supplier': 1}"
attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
<field name="amount" attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/>
+1 -2
View File
@@ -34,8 +34,7 @@ class procurement_order(osv.osv):
return procurement_id
def run(self, cr, uid, ids, context=None):
context = context or {}
context['procurement_autorun_defer'] = True
context = dict(context or {}, procurement_autorun_defer=True)
res = super(procurement_order, self).run(cr, uid, ids, context=context)
procurement_ids = self.search(cr, uid, [('move_dest_id.procurement_id', 'in', ids)], order='id', context=context)
+1 -1
View File
@@ -663,7 +663,7 @@
<button name="do_enter_transfer_details" states="assigned,partially_available" string="Transfer" groups="stock.group_stock_user" type="object" class="oe_highlight"/>
<button name="do_print_picking" string="Print Picking List" groups="stock.group_stock_user" type="object" attrs="{'invisible': ['|', ('picking_type_code', '=', 'outgoing'), ('state', '!=', 'assigned')]}"/>
<button name="%(act_stock_return_picking)d" string="Reverse Transfer" states="done" type="action" groups="base.group_user"/>
<button name="action_cancel" states="assigned,confirmed,partially_available,draft" string="Cancel Transfer" groups="base.group_user" type="object"/>
<button name="action_cancel" states="assigned,confirmed,partially_available,draft,waiting" string="Cancel Transfer" groups="base.group_user" type="object"/>
<button name="do_unreserve" string="Unreserve" groups="base.group_user" type="object" attrs="{'invisible': [('quant_reserved_exist', '=', False)]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,partially_available,assigned,done" statusbar_colors='{"shipping_except":"red","invoice_except":"red","waiting_date":"blue"}'/>
</header>
+10 -14
View File
@@ -525,7 +525,6 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
this.autocomplete = new my.AutoComplete(this, {
source: this.proxy('complete_global_search'),
select: this.proxy('select_completion'),
delay: 0,
get_search_string: function () {
return self.$('div.oe_searchview_input').text();
},
@@ -2121,8 +2120,6 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
// options.source: function ({term:query}, callback). This function will be called to
// obtain the search results corresponding to the query string. It is assumed that
// options.source will call callback with the results.
// options.delay: delay in millisecond before calling source. Useful if you don't want
// to make too many rpc calls
// options.select: function (ev, {item: {facet:facet}}). Autocomplete widget will call
// that function when a selection is made by the user
// options.get_search_string: function (). This function will be called by autocomplete
@@ -2131,14 +2128,13 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
this._super(parent);
this.$input = parent.$el;
this.source = options.source;
this.delay = options.delay;
this.select = options.select,
this.select = options.select;
this.get_search_string = options.get_search_string;
this.current_result = null;
this.searching = true;
this.search_string = null;
this.search_string = '';
this.current_search = null;
},
start: function () {
@@ -2149,10 +2145,8 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
ev.preventDefault();
return;
}
// ENTER is caugth at KeyUp rather than KeyDown to avoid firing
// before all regular keystrokes have been processed
if (ev.which === $.ui.keyCode.ENTER) {
if (self.current_result && self.get_search_string().length) {
if (self.search_string.length) {
self.select_item(ev);
}
return;
@@ -2161,29 +2155,31 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
if (self.search_string !== search_string) {
if (search_string.length) {
self.search_string = search_string;
setTimeout(function () { self.initiate_search(search_string);}, self.delay);
self.initiate_search(search_string);
} else {
self.close();
}
}
});
this.$input.on('keypress', function (ev) {
self.search_string = self.get_search_string() + String.fromCharCode(ev.which);
self.search_string = self.search_string + String.fromCharCode(ev.which);
if (self.search_string.length) {
self.searching = true;
var search_string = self.search_string;
setTimeout(function () { self.initiate_search(search_string);}, self.delay);
self.initiate_search(search_string);
} else {
self.close();
}
});
this.$input.on('keydown', function (ev) {
switch (ev.which) {
case $.ui.keyCode.ENTER:
// TAB and direction keys are handled at KeyDown because KeyUp
// is not guaranteed to fire.
// See e.g. https://github.com/aef-/jquery.masterblaster/issues/13
case $.ui.keyCode.TAB:
if (self.current_result && self.get_search_string().length) {
if (self.search_string.length) {
self.select_item(ev);
}
break;
@@ -2314,7 +2310,7 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
},
close: function () {
this.current_search = null;
this.search_string = null;
this.search_string = '';
this.searching = true;
this.$el.hide();
},
@@ -89,7 +89,7 @@ class WebsiteMembership(http.Controller):
# TODO: Following line can be deleted in master. Kept for retrocompatibility.
membership_lines = sorted(membership_lines, key=lambda x: x.membership_id.website_sequence)
partner_ids = [m.partner.id for m in membership_lines]
free_partner_ids = partner_obj.search(cr, uid, [('free_member', '=', True), ('website_published', '=', True)], context=context)
free_partner_ids = partner_obj.search(cr, SUPERUSER_ID, [('free_member', '=', True), ('website_published', '=', True)], context=context)
google_map_partner_ids = ",".join(map(str, partner_ids))
memberships_data = []
for membership_record in memberships: