[MERGE] forward port branch 10.0 up to 2f037a13ca
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 <b>@%s</b>.") % channel_partners[0].partner_id.name
|
||||
msg = _("You are in a private conversation with <b>@%s</b>.") % (channel_partners[0].partner_id.name if channel_partners else _('Anonymous'))
|
||||
msg += _("""<br><br>
|
||||
You can mention someone by typing <b>@username</b>, this will grab its attention.<br>
|
||||
You can mention a channel by typing <b>#channel</b>.<br>
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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]};
|
||||
$('<td class="oe_number">')
|
||||
$('<td class="oe_number o_list_number">')
|
||||
.html(column.format(r, {process_modifiers: false}))
|
||||
.appendTo($row);
|
||||
} else {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user