[MERGE] forward port of branch saas-4 up to 7ecaab9

This commit is contained in:
Denis Ledoux 2014-08-11 15:31:04 +02:00
commit 0739bc4eda
7 changed files with 33 additions and 19 deletions

View File

@ -8,7 +8,6 @@
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "EntypoRegular";
src: url("/web/static/src/font/entypo-webfont.eot") format("eot");
@ -19,7 +18,6 @@
font-weight: normal;
font-style: normal;
}
.openerp {
padding: 0;
margin: 0;
@ -1366,6 +1364,9 @@
.openerp .oe_view_manager_inline > .oe_view_manager_header, .openerp .oe_view_manager_inlineview > .oe_view_manager_header {
display: none;
}
.openerp .oe_popup_form {
display: table;
}
.openerp .oe_popup_form .oe_formview .oe_form_pager {
display: none !important;
}
@ -3087,7 +3088,6 @@
top: 0px;
}
}
.kitten-mode-activated {
background-size: cover;
background-attachment: fixed;

View File

@ -1134,6 +1134,7 @@ $sheet-padding: 16px
// }}}
// FormPopup {{{
.oe_popup_form
display: table
.oe_formview .oe_form_pager
display: none !important
// Customize label weight for popup wizard appear from another wizard according bootstrap3

View File

@ -5684,6 +5684,20 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
this._super.apply(this, arguments);
this.render_value();
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_
});
}
}
});

View File

@ -420,8 +420,8 @@ instance.web_kanban.KanbanView = instance.web.View.extend({
stop: function(event, ui) {
var stop_index = ui.item.index();
if (start_index !== stop_index) {
var $start_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
var $stop_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
var $start_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
var $stop_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter';
$start_column[method]($stop_column);
var tmp_group = self.groups.splice(start_index, 1)[0];
@ -1143,7 +1143,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({
*/
instance.web_kanban.QuickCreate = instance.web.Widget.extend({
template: 'KanbanView.quick_create',
/**
* close_btn: If true, the widget will display a "Close" button able to trigger
* a "close" event.

View File

@ -359,14 +359,12 @@ class Website(openerp.addons.web.controllers.main.Home):
@http.route(['/website/seo_suggest/<keywords>'], type='http', auth="public", website=True)
def seo_suggest(self, keywords):
url = "http://google.com/complete/search"
param = {
'ie': 'utf8',
'oe': 'utf8',
'output': 'toolbar',
'q': keywords
}
req = urllib2.Request("%s?%s" % (url, werkzeug.url_encode(param)))
request = urllib2.urlopen(req)
try:
req = urllib2.Request("%s?%s" % (url, werkzeug.url_encode({
'ie': 'utf8', 'oe': 'utf8', 'output': 'toolbar', 'q': keywords})))
request = urllib2.urlopen(req)
except (urllib2.HTTPError, urllib2.URLError):
return []
xmlroot = ET.fromstring(request.read())
return json.dumps([sugg[0].attrib['data'] for sugg in xmlroot if len(sugg) and sugg[0].attrib['data']])

View File

@ -24,9 +24,10 @@ import time
import psycopg2
from datetime import datetime
from dateutil.relativedelta import relativedelta
import pytz
import openerp
from openerp import netsvc
from openerp import netsvc, SUPERUSER_ID
from openerp.osv import fields, osv
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
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!
"""
try:
now = datetime.now()
nextcall = datetime.strptime(job['nextcall'], DEFAULT_SERVER_DATETIME_FORMAT)
now = fields.datetime.context_timestamp(job_cr, SUPERUSER_ID, datetime.now())
nextcall = fields.datetime.context_timestamp(job_cr, SUPERUSER_ID, datetime.strptime(job['nextcall'], DEFAULT_SERVER_DATETIME_FORMAT))
numbercall = job['numbercall']
ok = False
@ -175,7 +176,7 @@ class ir_cron(osv.osv):
if not numbercall:
addsql = ', active=False'
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:
job_cr.commit()

View File

@ -451,7 +451,7 @@ class YamlInterpreter(object):
# do not shadow values explicitly set in yaml.
record_dict[key] = process_val(key, val)
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"
" the view '%s'",
key, match.group(1), model._name, view_info['name'])