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]}; - $('') + $('') .html(column.format(r, {process_modifiers: false})) .appendTo($row); } else { diff --git a/doc/cla/corporate/vauxoo.md b/doc/cla/corporate/vauxoo.md index 017ffe08bba..39129bd0680 100644 --- a/doc/cla/corporate/vauxoo.md +++ b/doc/cla/corporate/vauxoo.md @@ -39,3 +39,4 @@ Jesus Zapata jesus@vauxoo.com https://github.com/JesusZapata Germana Oliveira germana@vauxoo.com https://github.com/goliveirab Mariano Fernandez mariano@vauxoo.com https://github.com/Batuto Edgar Rivero edgar@vauxoo.com https://github.com/egrivero +Edilianny Sánchez esanchez@vauxoo.com https://github.com/edy1192 diff --git a/odoo/addons/base/i18n/base.pot b/odoo/addons/base/i18n/base.pot index 158a3dbf179..1fad804525a 100644 --- a/odoo/addons/base/i18n/base.pot +++ b/odoo/addons/base/i18n/base.pot @@ -11244,6 +11244,18 @@ msgstr "" msgid "Memos pad" msgstr "" +#. module: base +#: code:addons/base/ir/ir_model.py:382 +#, python-format +msgid "Model %s does not exist" +msgstr "" + +#. module: base +#: code:addons/base/ir/ir_model.py:383 +#, python-format +msgid "Please specify a valid model for the object relation" +msgstr "" + #. module: base #: model:ir.model.fields,field_description:base.field_ir_ui_menu_name #: model:ir.ui.view,arch_db:base.edit_menu diff --git a/odoo/addons/base/ir/ir_model.py b/odoo/addons/base/ir/ir_model.py index d2a53042751..c8f4c4122d0 100644 --- a/odoo/addons/base/ir/ir_model.py +++ b/odoo/addons/base/ir/ir_model.py @@ -399,6 +399,13 @@ class IrModelFields(models.Model): def _onchange_ttype(self): self.copy = (self.ttype != 'one2many') if self.ttype == 'many2many' and self.model_id and self.relation: + if self.relation not in self.env: + return { + 'warning': { + 'title': _('Model %s does not exist') % self.relation, + 'message': _('Please specify a valid model for the object relation'), + } + } names = self._custom_many2many_names(self.model_id.model, self.relation) self.relation_table, self.column1, self.column2 = names else: