[IMP] Acccount: Aged trial balance => add target move field on wizard (still need to update the queries)
bzr revid: mra@mra-laptop-20100915104015-ey8o87wbqph32hvu
This commit is contained in:
parent
54ecb762bb
commit
8e3b2aff4e
|
@ -49,6 +49,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
|||
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']
|
||||
|
@ -271,7 +272,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
|||
for i in t:
|
||||
d['No Partner Defined'] = i[0]
|
||||
history.append(d)
|
||||
|
||||
|
||||
values = {}
|
||||
if self.direction_selection == 'future':
|
||||
before = False
|
||||
|
@ -281,11 +282,11 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
|
|||
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'):
|
||||
|
|
|
@ -37,11 +37,14 @@ class account_aged_trial_balance(osv.osv_memory):
|
|||
'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):
|
||||
|
@ -61,7 +64,7 @@ class account_aged_trial_balance(osv.osv_memory):
|
|||
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:
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
<newline/>
|
||||
<field name="result_selection"/>
|
||||
<field name="direction_selection"/>
|
||||
<field name="target_move"/>
|
||||
<field name="journal_ids"/>
|
||||
<newline/>
|
||||
<separator colspan="4"/>
|
||||
|
|
Loading…
Reference in New Issue