[MERGE] forward port branch saas-15 up to ef5ac872b8

This commit is contained in:
Christophe Simonis
2017-09-06 12:26:36 +02:00
10 changed files with 23 additions and 4 deletions
+1 -1
View File
@@ -453,7 +453,7 @@ class Import(models.TransientModel):
:rtype: (None, None) | (list(str), dict(int: list(str)))
"""
if not options.get('headers'):
return None, None
return [], {}
headers = next(rows)
return headers, {
+1 -1
View File
@@ -152,7 +152,7 @@ class TestMatchHeadersMultiple(TransactionCase):
def test_noheaders(self):
self.assertEqual(
self.env['base_import.import']._match_headers([], [], {}), (None, None)
self.env['base_import.import']._match_headers([], [], {}), ([], {})
)
def test_nomatch(self):
+3
View File
@@ -79,7 +79,10 @@ class MailController(http.Controller):
record_action = record.get_access_action()
else:
record_action = record_sudo.get_access_action()
if record_action['type'] == 'ir.actions.act_url' and record_action.get('target_type') != 'public':
return cls._redirect_to_messaging()
record_action.pop('target_type', None)
# the record has an URL redirection: use it directly
if record_action['type'] == 'ir.actions.act_url':
return werkzeug.utils.redirect(record_action['url'])
+7
View File
@@ -477,6 +477,13 @@ var PosDB = core.Class.extend({
}
return orders;
},
set_cashier: function(cashier) {
// Always update if the user is the same as before
this.save('cashier', cashier);
},
get_cashier: function() {
return this.load('cashier');
}
});
return PosDB;
+3 -1
View File
@@ -247,6 +247,7 @@ exports.PosModel = Backbone.Model.extend({
}
self.db.set_uuid(self.config.uuid);
self.cashier = self.get_cashier();
var orders = self.db.get_orders();
for (var i = 0; i < orders.length; i++) {
@@ -588,11 +589,12 @@ exports.PosModel = Backbone.Model.extend({
// returns the user who is currently the cashier for this point of sale
get_cashier: function(){
return this.cashier || this.user;
return this.db.get_cashier() || this.cashier || this.user;
},
// changes the current cashier
set_cashier: function(user){
this.cashier = user;
this.db.set_cashier(this.cashier);
},
//creates a new empty order and sets it as the current order
add_new_order: function(){
@@ -226,6 +226,7 @@ class BlogPost(models.Model):
'type': 'ir.actions.act_url',
'url': self.url,
'target': 'self',
'target_type': 'public',
'res_id': self.id,
}
+1
View File
@@ -786,6 +786,7 @@ class Post(models.Model):
'type': 'ir.actions.act_url',
'url': '/forum/%s/question/%s' % (self.forum_id.id, self.id),
'target': 'self',
'target_type': 'public',
'res_id': self.id,
}
+1
View File
@@ -450,6 +450,7 @@ class Slide(models.Model):
'type': 'ir.actions.act_url',
'url': '%s' % self.website_url,
'target': 'self',
'target_type': 'public',
'res_id': self.id,
}
return super(Slide, self).get_access_action()
+4
View File
@@ -213,6 +213,10 @@ Instead you must have a proxy redirecting requests whose URL starts with
``/longpolling/`` to the longpolling port. Other request should be proxied to
the :option:`normal HTTP port <odoo-bin --xmlrpc-port>`
.. warning:: The livechat worker requires the ``psycogreen`` Python module,
which is not always included with all installation packages.
It can be manually installed with ``pip install psycogreen``.
Configuration sample
--------------------
+1 -1
View File
@@ -50,7 +50,7 @@ CREATE TABLE ir_module_module (
website character varying(256),
summary character varying(256),
name character varying(128) NOT NULL,
author character varying(128),
author character varying,
icon varchar,
state character varying(16),
latest_version character varying(64),