~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to analytic_distribution/analytic_line.py

  • Committer: jf
  • Date: 2016-02-08 16:40:08 UTC
  • mfrom: (2753.1.7 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20160208164008-426e001so4e9xoip
US-871 [FIX] Mass Realloc: add COR prefix in AJI, use entry_sequence as ref. in COR and REV AJIs
US-871 [FIX] Single AJI manually corrected, COR AJI can't be mass rallocated
lp:~jfb-tempo-consulting/unifield-wm/us-871

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
                        if p.state != 'draft':
306
306
                            raise osv.except_osv(_('Error'), _('Period (%s) is not open.') % (p.name,))
307
307
                    # then create new lines
 
308
                    cor_name = self.pool.get('account.analytic.line').join_without_redundancy(aline.name, 'COR')
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
                        'source_date': aline.source_date or aline.date, 'journal_id': correction_journal_id,
 
311
                        'name': cor_name, 'ref': aline.entry_sequence}, 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})