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

« back to all changes in this revision

Viewing changes to data_finance/import_analytic_lines.py

  • Committer: jf
  • Date: 2012-01-13 10:13:29 UTC
  • mfrom: (575.2.1 unifield-wm)
  • Revision ID: jf@tempo4-20120113101329-832v05hm4uq92619
Import Analytics Lines: relative month, default invoice_method: picking

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
                max_date = date
74
74
 
75
75
        if obj['relative']:
76
 
            max_date = max_date+DateTime.RelativeDateTime(months=DateTime.now().month)
 
76
            max_date = max_date+DateTime.RelativeDateTime(months=DateTime.now().month-1)
77
77
 
78
78
        if max_date.year != DateTime.now().year:
79
79
            create_period_obj = self.pool.get('account.period.create')
169
169
            except ValueError:
170
170
                continue
171
171
            if obj['relative']:
172
 
                date += DateTime.RelativeDateTime(months=DateTime.now().month)
 
172
                date += DateTime.RelativeDateTime(months=DateTime.now().month-1)
173
173
            key_reg = '%s-%s'%(row[1], date.strftime('%m-%Y'))
174
174
            if key_reg not in register_id:
175
175
                p_ids = period_obj.search(cr, uid, [('date_start', '=', date.strftime('%Y-%m-01'))])