[MERGE] forward port of branch 8.0 up to d519dac

This commit is contained in:
Christophe Simonis
2016-03-24 15:03:55 +01:00
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -1259,6 +1259,7 @@ class account_move_line(osv.osv):
todo_date = vals['date']
del vals['date']
centralized_journals = []
for line in self.browse(cr, uid, ids, context=context):
ctx = context.copy()
if not ctx.get('journal_id'):
@@ -1273,8 +1274,10 @@ class account_move_line(osv.osv):
ctx['period_id'] = line.period_id.id
#Check for centralisation
journal = journal_obj.browse(cr, uid, ctx['journal_id'], context=ctx)
if journal.centralisation:
self._check_moves(cr, uid, context=ctx)
if journal.centralisation and (ctx['journal_id'], ctx['period_id']) not in centralized_journals:
centralized_journals.append((ctx['journal_id'], ctx['period_id']))
for journal_period in centralized_journals:
self._check_moves(cr, uid, context=dict(ctx, journal_id=journal_period[0], period_id=journal_period[1]))
result = super(account_move_line, self).write(cr, uid, ids, vals, context)
if affects_move and check and not context.get('novalidate'):
+1
View File
@@ -5856,6 +5856,7 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({
$img.css("max-height", "" + self.options.size[1] + "px");
});
$img.on('error', function() {
self.on_clear();
$img.attr('src', self.placeholder);
instance.webclient.notification.warn(_t("Image"), _t("Could not display the selected image."));
});