[IMP] account:
* Moved 'sign' field from account type to financial report object. * Changed and added demo data as per the new requirements. * Replaced the 'Balance Sheet' and 'Profit and Loss' reports with Financial report. bzr revid: uco@tinyerp.com-20111201115521-g8npi3igpq8dvthu
This commit is contained in:
parent
0920c044fd
commit
be08728a43
|
@ -121,8 +121,8 @@ module named account_voucher.
|
|||
'ir_sequence_view.xml',
|
||||
'company_view.xml',
|
||||
'board_account_view.xml',
|
||||
"wizard/account_report_profit_loss_view.xml",
|
||||
"wizard/account_report_balance_sheet_view.xml",
|
||||
#"wizard/account_report_profit_loss_view.xml",
|
||||
#"wizard/account_report_balance_sheet_view.xml",
|
||||
"edi/invoice_action_data.xml",
|
||||
"account_bank_view.xml",
|
||||
"account_pre_install.yml"
|
||||
|
|
|
@ -154,13 +154,11 @@ class account_account_type(osv.osv):
|
|||
'Balance' will generally be used for cash accounts.
|
||||
'Detail' will copy each existing journal item of the previous year, even the reconciled ones.
|
||||
'Unreconciled' will copy only the journal items that were unreconciled on the first day of the new fiscal year."""),
|
||||
'sign': fields.selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.'),
|
||||
'report_type': fields.selection(_get_report_type, 'P&L / BS Category', help="This field is used to generate legal reports: profit and loss, balance sheet.", required=True),
|
||||
'note': fields.text('Description'),
|
||||
}
|
||||
_defaults = {
|
||||
'close_method': 'none',
|
||||
'sign': 1,
|
||||
'report_type': 'none',
|
||||
}
|
||||
_order = "code"
|
||||
|
@ -2789,11 +2787,13 @@ class account_financial_report(osv.osv):
|
|||
], 'Display details'),
|
||||
'account_report_id': fields.many2one('account.financial.report', 'Report Value'),
|
||||
'account_type_ids': fields.many2many('account.account.type', 'account_account_financial_report_type', 'report_id', 'account_type_id', 'Account Types'),
|
||||
'sign': fields.selection([(-1, 'Reverse balance sign'), (1, 'Preserve balance sign')], 'Sign on Reports', required=True, help='For accounts that are typically more debited than credited and that you would like to print as negative amounts in your reports, you should reverse the sign of the balance; e.g.: Expense account. The same applies for accounts that are typically more credited than debited and that you would like to print as positive amounts in your reports; e.g.: Income account.'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'type': 'sum',
|
||||
'display_detail': 'only_detail',
|
||||
'sign': 1,
|
||||
}
|
||||
|
||||
account_financial_report()
|
||||
|
|
|
@ -786,7 +786,6 @@
|
|||
<group col="2" colspan="2">
|
||||
<separator string="Reporting Configuration" colspan="4"/>
|
||||
<field name="report_type" select="2"/>
|
||||
<field name="sign" />
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Closing Method" colspan="4"/>
|
||||
|
@ -2767,6 +2766,7 @@ action = pool.get('res.config').next(cr, uid, [], context)
|
|||
<field name="parent_id"/>
|
||||
<field name="sequence"/>
|
||||
<field name="type"/>
|
||||
<field name="sign"/>
|
||||
</group>
|
||||
<notebook colspan="6">
|
||||
<page string="Report">
|
||||
|
|
|
@ -4,14 +4,12 @@
|
|||
<record model="account.account.type" id="conf_account_type_receivable">
|
||||
<field name="name">Receivable</field>
|
||||
<field name="code">receivable</field>
|
||||
<field name="report_type">income</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_payable">
|
||||
<field name="name">Payable</field>
|
||||
<field name="code">payable</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
|
||||
|
@ -24,86 +22,159 @@
|
|||
<record model="account.account.type" id="account_type_income_view1">
|
||||
<field name="name">Income View</field>
|
||||
<field name="code">view</field>
|
||||
<field name="report_type">income</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_expense_view1">
|
||||
<field name="name">Expense View</field>
|
||||
<field name="code">expense</field>
|
||||
<field name="report_type">expense</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_asset_view1">
|
||||
<field name="name">Asset View</field>
|
||||
<field name="code">asset</field>
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_liability_view1">
|
||||
<field name="name">Liability View</field>
|
||||
<field name="code">liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_income">
|
||||
<field name="name">Income</field>
|
||||
<field name="code">income</field>
|
||||
<field name="report_type">income</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_expense">
|
||||
<field name="name">Expense</field>
|
||||
<field name="code">expense</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_tax">
|
||||
<field name="name">Tax</field>
|
||||
<field name="code">tax</field>
|
||||
<field name="report_type">expense</field>
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_cash">
|
||||
<field name="name">Cash</field>
|
||||
<field name="code">cash</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_liability">
|
||||
<field name="name">Liability</field>
|
||||
<field name="code">liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_asset">
|
||||
<field name="name">Asset</field>
|
||||
<field name="code">asset</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_equity">
|
||||
<field name="name">Equity</field>
|
||||
<field name="code">equity</field>
|
||||
<field name="report_type">liability</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="conf_account_type_bnk">
|
||||
<record model="account.account.type" id="conf_account_type_bnk">
|
||||
<field name="name">Bank</field>
|
||||
<field name="code">bank</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="conf_account_type_chk">
|
||||
<record model="account.account.type" id="conf_account_type_chk">
|
||||
<field name="name">Check</field>
|
||||
<field name="code">check</field>
|
||||
<field name="report_type">asset</field>
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<!-- Financial Reports -->
|
||||
<record id="conf_account_financial_report_balancesheet0" model="account.financial.report">
|
||||
<field name="name">Balance Sheet</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
<record id="conf_account_financial_report_assets0" model="account.financial.report">
|
||||
<field name="name">Assets</field>
|
||||
<field name="parent_id" ref="conf_account_financial_report_balancesheet0"/>
|
||||
<field name="account_type_ids" eval="[(6,0,[ref('account.conf_account_type_asset')])]"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
<record id="conf_account_financial_report_liability0" model="account.financial.report">
|
||||
<field name="name">Liability</field>
|
||||
<field name="parent_id" ref="conf_account_financial_report_balancesheet0"/>
|
||||
<field name="account_type_ids" eval="[(6,0,[ref('account.conf_account_type_liability')])]"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
|
||||
<record id="conf_account_financial_report_profitandloss0" model="account.financial.report">
|
||||
<field name="name">Profit and Loss</field>
|
||||
<field name="type">sum</field>
|
||||
</record>
|
||||
<record id="account_financial_report_income0" model="account.financial.report">
|
||||
<field name="name">Income</field>
|
||||
<field name="parent_id" ref="conf_account_financial_report_profitandloss0"/>
|
||||
<field name="account_type_ids" eval="[(6,0,[ref('account.conf_account_type_income')])]"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
<record id="conf_account_financial_report_expense0" model="account.financial.report">
|
||||
<field name="name">Expense</field>
|
||||
<field name="parent_id" ref="conf_account_financial_report_profitandloss0"/>
|
||||
<field name="account_type_ids" eval="[(6,0,[ref('account.conf_account_type_expense')])]"/>
|
||||
<field name="display_detail">detail_with_hierarchy</field>
|
||||
<field name="type">account_type</field>
|
||||
</record>
|
||||
|
||||
<!-- Update Account Type -->
|
||||
|
||||
<record id="account.conf_account_type_asset" model="account.account.type">
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_liability" model="account.account.type">
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_income" model="account.account.type">
|
||||
<field name="report_type">income</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_expense" model="account.account.type">
|
||||
<field name="report_type">expense</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_receivable" model="account.account.type">
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_payable" model="account.account.type">
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_equity" model="account.account.type">
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
<record id="account.conf_account_type_cash" model="account.account.type">
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_income_view1">
|
||||
<field name="report_type">income</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_expense_view1">
|
||||
<field name="report_type">expense</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_asset_view1">
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="account_type_liability_view1">
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="conf_account_type_tax">
|
||||
<field name="report_type">expense</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="conf_account_type_bnk">
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
<record model="account.account.type" id="conf_account_type_chk">
|
||||
<field name="report_type">asset</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Account Templates-->
|
||||
|
|
|
@ -33,13 +33,13 @@ import account_print_overdue
|
|||
import account_aged_partner_balance
|
||||
#import tax_report
|
||||
import account_tax_report
|
||||
import account_balance_landscape
|
||||
#import account_balance_landscape
|
||||
import account_invoice_report
|
||||
import account_report
|
||||
import account_entries_report
|
||||
import account_analytic_entries_report
|
||||
import account_balance_sheet
|
||||
import account_profit_loss
|
||||
#import account_balance_sheet
|
||||
#import account_profit_loss
|
||||
import account_treasury_report
|
||||
import account_financial_report
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ class report_account_common(report_sxw.rml_parse, common_report_header):
|
|||
flag = False
|
||||
vals = {
|
||||
'name': account.code + ' ' + account.name,
|
||||
'balance': account.balance != 0 and account.balance * account.user_type.sign or account.balance,
|
||||
'balance': account.balance != 0 and account.balance * report.sign or account.balance,
|
||||
'type': 'account',
|
||||
'level': 6,
|
||||
'account_type': account.type,
|
||||
|
|
|
@ -37,24 +37,15 @@
|
|||
data_dict = {'chart_account_id':ref('account.chart0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_aged_balance_view',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Sheet in Horizontal mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Sheet in Normal mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False, 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_bs_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Account Balance Report in Normal mode through the wizard - From Account Chart
|
||||
-
|
||||
|
@ -147,18 +138,9 @@
|
|||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all'}
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': False,'target_move': 'all', 'account_report_id': ref('account_financial_report_balancesheet0')}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Profit-Loss Report in Horizontal Mode
|
||||
-
|
||||
!python {model: account.account}: |
|
||||
ctx={}
|
||||
ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')]})
|
||||
data_dict = {'chart_account_id':ref('account.chart0'),'display_type': True,'target_move': 'all'}
|
||||
from tools import test_reports
|
||||
test_reports.try_report_action(cr, uid, 'action_account_pl_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
test_reports.try_report_action(cr, uid, 'action_account_report',wiz_data=data_dict, context=ctx, our_module='account')
|
||||
-
|
||||
Print the Analytic Balance Report through the wizard
|
||||
-
|
||||
|
|
|
@ -64,8 +64,8 @@ import account_report_account_balance
|
|||
|
||||
import account_change_currency
|
||||
|
||||
import account_report_balance_sheet
|
||||
import account_report_profit_loss
|
||||
#import account_report_balance_sheet
|
||||
#import account_report_profit_loss
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -38,9 +38,19 @@ class accounting_report(osv.osv_memory):
|
|||
'date_to_cmp': fields.date("End Date"),
|
||||
}
|
||||
|
||||
def _get_account_report(self, cr, uid, context=None):
|
||||
menu_obj = self.pool.get('ir.ui.menu')
|
||||
report_obj = self.pool.get('account.financial.report')
|
||||
report_ids = []
|
||||
if context.get('active_id'):
|
||||
menu = menu_obj.browse(cr, uid, context.get('active_id')).name
|
||||
report_ids = report_obj.search(cr, uid, [('name','ilike',menu)])
|
||||
return report_ids and report_ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'filter_cmp': 'filter_no',
|
||||
'target_move': 'posted',
|
||||
'account_report_id': _get_account_report,
|
||||
}
|
||||
|
||||
def _build_comparison_context(self, cr, uid, ids, data, context=None):
|
||||
|
|
|
@ -40,6 +40,24 @@
|
|||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="account.menu_finance_legal_statement"
|
||||
id="final_accounting_reports"
|
||||
name="Accounting Reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Profit And Loss"
|
||||
action="account.action_account_report"
|
||||
id="menu_account_pl_report"
|
||||
parent="final_accounting_reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Balance Sheet"
|
||||
action="account.action_account_report"
|
||||
groups="group_account_user,group_account_manager"
|
||||
id="menu_account_bs_report"
|
||||
parent="final_accounting_reports"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
name="Financial Report"
|
||||
action="action_account_report"
|
||||
|
|
Loading…
Reference in New Issue