diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py
index ab6623b3068..d4ab83da890 100644
--- a/addons/account_check_printing/models/account_payment.py
+++ b/addons/account_check_printing/models/account_payment.py
@@ -45,7 +45,7 @@ class AccountPayment(models.Model):
_inherit = "account.payment"
check_amount_in_words = fields.Char(string="Amount in Words")
- check_manual_sequencing = fields.Boolean(related='journal_id.check_manual_sequencing')
+ check_manual_sequencing = fields.Boolean(related='journal_id.check_manual_sequencing', readonly=1)
check_number = fields.Integer(string="Check Number", readonly=True, copy=False,
help="The selected journal is configured to print check numbers. If your pre-printed check paper already has numbers "
"or if the current numbering is wrong, you can change it in the journal configuration page.")
@@ -82,10 +82,10 @@ class AccountPayment(models.Model):
@api.model
def create(self, vals):
- if vals['payment_method_id'] == self.env.ref('account_check_printing.account_payment_method_check').id\
- and vals.get('check_manual_sequencing'):
- sequence = self.env['account.journal'].browse(vals['journal_id']).check_sequence_id
- vals.update({'check_number': sequence.next_by_id()})
+ if vals['payment_method_id'] == self.env.ref('account_check_printing.account_payment_method_check').id:
+ journal = self.env['account.journal'].browse(vals['journal_id'])
+ if journal.check_manual_sequencing:
+ vals.update({'check_number': journal.check_sequence_id.next_by_id()})
return super(AccountPayment, self).create(vals)
@api.multi
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js
index e9dec85739f..80d418de6dc 100644
--- a/addons/board/static/src/js/dashboard.js
+++ b/addons/board/static/src/js/dashboard.js
@@ -172,8 +172,8 @@ var DashBoard = form_common.FormWidget.extend({
board.columns.push(actions);
});
var arch = QWeb.render('DashBoard.xml', board);
- this.rpc('/web/view/add_custom', {
- view_id: this.view.fields_view.view_id,
+ this.rpc('/web/view/edit_custom', { // do not forward-port > saas-15
+ custom_id: this.view.fields_view.custom_view_id, // do not forward-port > saas-15
arch: arch
}).then(function() {
data_manager.invalidate();
diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py
index ebd923ab8f8..94d12ceebf2 100644
--- a/addons/mail/models/mail_channel.py
+++ b/addons/mail/models/mail_channel.py
@@ -649,7 +649,7 @@ class Channel(models.Model):
msg += _(" This channel is private. People must be invited to join it.")
else:
channel_partners = self.env['mail.channel.partner'].search([('partner_id', '!=', partner.id), ('channel_id', '=', self.id)])
- msg = _("You are in a private conversation with @%s.") % channel_partners[0].partner_id.name
+ msg = _("You are in a private conversation with @%s.") % (channel_partners[0].partner_id.name if channel_partners else _('Anonymous'))
msg += _("""
You can mention someone by typing @username, this will grab its attention.
You can mention a channel by typing #channel.
diff --git a/addons/mass_mailing/wizard/test_mailing.py b/addons/mass_mailing/wizard/test_mailing.py
index 24b395c7c53..0c82ed25588 100644
--- a/addons/mass_mailing/wizard/test_mailing.py
+++ b/addons/mass_mailing/wizard/test_mailing.py
@@ -26,7 +26,7 @@ class TestMassMailing(models.TransientModel):
'reply_to': mailing.reply_to,
'email_to': test_mail,
'subject': mailing.name,
- 'body_html': mailing.body_html,
+ 'body_html': tools.html_sanitize(mailing.body_html, sanitize_attributes=True, sanitize_style=True, strip_classes=True),
'notification': True,
'mailing_id': mailing.id,
'attachment_ids': [(4, attachment.id) for attachment in mailing.attachment_ids],
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 0e6f29aeff7..585cb2f36b7 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -928,14 +928,18 @@ class DataSet(http.Controller):
class View(http.Controller):
- @http.route('/web/view/add_custom', type='json', auth="user")
- def add_custom(self, view_id, arch):
- CustomView = request.env['ir.ui.view.custom']
- CustomView.create({
- 'user_id': request.session.uid,
- 'ref_id': view_id,
- 'arch': arch
- })
+ @http.route('/web/view/edit_custom', type='json', auth="user")
+ def edit_custom(self, custom_id, arch):
+ """
+ Edit a custom view
+
+ :param int custom_id: the id of the edited custom view
+ :param str arch: the edited arch of the custom view
+ :returns: dict with acknowledged operation (result set to True)
+ """
+
+ custom_view = request.env['ir.ui.view.custom'].browse(custom_id)
+ custom_view.write({ 'arch': arch })
return {'result': True}
class TreeView(View):
diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js
index d28ac5e0774..e9f4068ec05 100644
--- a/addons/web/static/src/js/views/list_view.js
+++ b/addons/web/static/src/js/views/list_view.js
@@ -1445,7 +1445,7 @@ ListView.Groups = Class.extend({
} else if (column.id in group.aggregates) {
var r = {};
r[column.id] = {value: group.aggregates[column.id]};
- $('