[MERGE] forward port of branch 7.0 up to 3632949

This commit is contained in:
Denis Ledoux
2014-08-11 15:28:54 +02:00
4 changed files with 23 additions and 8 deletions
+14
View File
@@ -5415,6 +5415,20 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
this._super.apply(this, arguments); this._super.apply(this, arguments);
this.render_value(); this.render_value();
this.set_filename(''); this.set_filename('');
},
set_value: function(value_){
var changed = value_ !== this.get_value();
this._super.apply(this, arguments);
// By default, on binary images read, the server returns the binary size
// This is possible that two images have the exact same size
// Therefore we trigger the change in case the image value hasn't changed
// So the image is re-rendered correctly
if (!changed){
this.trigger("change:value", this, {
oldValue: value_,
newValue: value_
});
}
} }
}); });
+3 -3
View File
@@ -421,8 +421,8 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
stop: function(event, ui) { stop: function(event, ui) {
var stop_index = ui.item.index(); var stop_index = ui.item.index();
if (start_index !== stop_index) { if (start_index !== stop_index) {
var $start_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(start_index); var $start_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
var $stop_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index); var $stop_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter'; var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter';
$start_column[method]($stop_column); $start_column[method]($stop_column);
var tmp_group = self.groups.splice(start_index, 1)[0]; var tmp_group = self.groups.splice(start_index, 1)[0];
@@ -1148,7 +1148,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
*/ */
instance.web_kanban.QuickCreate = instance.web.Widget.extend({ instance.web_kanban.QuickCreate = instance.web.Widget.extend({
template: 'KanbanView.quick_create', template: 'KanbanView.quick_create',
/** /**
* close_btn: If true, the widget will display a "Close" button able to trigger * close_btn: If true, the widget will display a "Close" button able to trigger
* a "close" event. * a "close" event.
+5 -4
View File
@@ -24,9 +24,10 @@ import time
import psycopg2 import psycopg2
from datetime import datetime from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
import pytz
import openerp import openerp
from openerp import netsvc from openerp import netsvc, SUPERUSER_ID
from openerp.osv import fields, osv from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
from openerp.tools.safe_eval import safe_eval as eval from openerp.tools.safe_eval import safe_eval as eval
@@ -158,8 +159,8 @@ class ir_cron(osv.osv):
must not be committed/rolled back! must not be committed/rolled back!
""" """
try: try:
now = datetime.now() now = fields.datetime.context_timestamp(job_cr, SUPERUSER_ID, datetime.now())
nextcall = datetime.strptime(job['nextcall'], DEFAULT_SERVER_DATETIME_FORMAT) nextcall = fields.datetime.context_timestamp(job_cr, SUPERUSER_ID, datetime.strptime(job['nextcall'], DEFAULT_SERVER_DATETIME_FORMAT))
numbercall = job['numbercall'] numbercall = job['numbercall']
ok = False ok = False
@@ -175,7 +176,7 @@ class ir_cron(osv.osv):
if not numbercall: if not numbercall:
addsql = ', active=False' addsql = ', active=False'
cron_cr.execute("UPDATE ir_cron SET nextcall=%s, numbercall=%s"+addsql+" WHERE id=%s", cron_cr.execute("UPDATE ir_cron SET nextcall=%s, numbercall=%s"+addsql+" WHERE id=%s",
(nextcall.strftime(DEFAULT_SERVER_DATETIME_FORMAT), numbercall, job['id'])) (nextcall.astimezone(pytz.UTC).strftime(DEFAULT_SERVER_DATETIME_FORMAT), numbercall, job['id']))
finally: finally:
job_cr.commit() job_cr.commit()
+1 -1
View File
@@ -452,7 +452,7 @@ class YamlInterpreter(object):
# do not shadow values explicitly set in yaml. # do not shadow values explicitly set in yaml.
record_dict[key] = process_val(key, val) record_dict[key] = process_val(key, val)
else: else:
_logger.warning("The returning field '%s' from your on_change call '%s'" _logger.debug("The returning field '%s' from your on_change call '%s'"
" does not exist either on the object '%s', either in" " does not exist either on the object '%s', either in"
" the view '%s'", " the view '%s'",
key, match.group(1), model._name, view_info['name']) key, match.group(1), model._name, view_info['name'])