306
306
raise osv.except_osv(_('Error'), _('Period (%s) is not open.') % (p.name,))
308
309
cor_ids = self.pool.get('account.analytic.line').copy(cr, uid, aline.id, {fieldname: account_id, 'date': date,
309
'source_date': aline.source_date or aline.date, 'journal_id': correction_journal_id}, context=context)
310
312
self.pool.get('account.analytic.line').write(cr, uid, cor_ids, {'last_corrected_id': aline.id})
311
313
# finally flag analytic line as reallocated
312
314
self.pool.get('account.analytic.line').write(cr, uid, [aline.id], {'is_reallocated': True})