[IMP] Account: move Target_move field (All entrires or posted one) into common class for partner account
bzr revid: mra@mra-laptop-20100917044111-oceth6a9lmfqigo0
This commit is contained in:
@@ -37,14 +37,11 @@ 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):
|
||||
@@ -64,7 +61,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', 'target_move'])[0])
|
||||
data['form'].update(self.read(cr, uid, ids, ['period_length', 'direction_selection'])[0])
|
||||
|
||||
period_length = data['form']['period_length']
|
||||
if period_length<=0:
|
||||
|
||||
@@ -30,15 +30,19 @@ class account_common_partner_report(osv.osv_memory):
|
||||
('supplier','Payable Accounts'),
|
||||
('customer_supplier' ,'Receivable and Payable Accounts')],
|
||||
"Partner's", required=True),
|
||||
'target_move': fields.selection([('all', 'All Entries'),
|
||||
('posted', 'All Posted Entries')], 'Target Moves', required=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'result_selection': 'customer',
|
||||
'target_move': 'all'
|
||||
}
|
||||
|
||||
def pre_print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data['form'].update(self.read(cr, uid, ids, ['result_selection'])[0])
|
||||
data['form'].update(self.read(cr, uid, ids, ['result_selection', 'target_move'])[0])
|
||||
return data
|
||||
|
||||
account_common_partner_report()
|
||||
|
||||
@@ -33,20 +33,18 @@ class account_partner_balance(osv.osv_memory):
|
||||
# ,help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
|
||||
'display_partner': fields.selection([('non-zero_balance', 'With balance is not equal to 0'), ('all', 'All Partners')]
|
||||
,'Display Partners'),
|
||||
'target_move': fields.selection([('all', 'All Entries'),
|
||||
('posted', 'All Posted Entries')], 'Target Moves', required=True),
|
||||
}
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
# 'initial_balance': True,
|
||||
'display_partner': 'non-zero_balance',
|
||||
'target_move': 'all'
|
||||
}
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_partner', 'target_move'])[0])
|
||||
data['form'].update(self.read(cr, uid, ids, ['display_partner'])[0])
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'account.partner.balance',
|
||||
|
||||
@@ -35,22 +35,19 @@ class account_partner_ledger(osv.osv_memory):
|
||||
'reconcil': fields.boolean('Include Reconciled Entries', help='Consider reconciled entries'),
|
||||
'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page'),
|
||||
'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"),
|
||||
'target_move': fields.selection([('all', 'All Entries'),
|
||||
('posted', 'All Posted Entries')], 'Target Moves', required=True),
|
||||
|
||||
}
|
||||
_defaults = {
|
||||
'reconcil': True,
|
||||
'initial_balance': True,
|
||||
'page_split': False,
|
||||
'target_move': 'all'
|
||||
}
|
||||
|
||||
def _print_report(self, cr, uid, ids, data, query_line, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
|
||||
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency', 'target_move'])[0])
|
||||
data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0])
|
||||
if data['form']['page_split']:
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
|
||||
Reference in New Issue
Block a user