def set_context(self, objects, data, ids, report_type=None):
self.query = data['form'].get('query_line', '')
self.direction_selection = data['form'].get('direction_selection', 'past')
+ self.target_move = data['form'].get('direction_selection', 'past')
self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d'))
if (data['form']['result_selection'] == 'customer' ):
self.ACCOUNT_TYPE = ['receivable']
for i in t:
d['No Partner Defined'] = i[0]
history.append(d)
-
+
values = {}
if self.direction_selection == 'future':
before = False
values['direction'] = before and before[0] or 0.0
elif self.direction_selection == 'past':
after = False
- if future_past.has_key('No Partner Defined'):
+ if future_past.has_key('No Partner Defined'):
after = [ future_past['No Partner Defined'] ]
self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0)
values['direction'] = after and after[0] or ""
-
+
for i in range(5):
during = False
if history[i].has_key('No Partner Defined'):
'direction_selection': fields.selection([('past','Past'),
('future','Future')],
'Analysis Direction', required=True),
+ 'target_move': fields.selection([('all', 'All Entries'),
+ ('posted', 'All Posted Entries')], 'Target Moves', required=True),
}
_defaults = {
'period_length': 30,
'date_from' : time.strftime('%Y-%m-%d'),
'direction_selection': 'past',
+ 'target_move': 'all',
}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
context = {}
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
- data['form'].update(self.read(cr, uid, ids, ['period_length', 'direction_selection'])[0])
+ data['form'].update(self.read(cr, uid, ids, ['period_length', 'direction_selection', 'target_move'])[0])
period_length = data['form']['period_length']
if period_length<=0: