Browse Source

[IMP] Optimizacion de Vista de Wizard

6.0
Humberto Arocha 12 years ago
parent
commit
7f290a9af6
  1. 89
      account_financial_report/view/wizard.xml
  2. 27
      account_financial_report/wizard/wizard.py

89
account_financial_report/view/wizard.xml

@ -3,31 +3,42 @@
<data>
<record id="wizard_report_view" model="ir.ui.view">
<field name="name">Wizard Report Balance Four Columns</field>
<field name="name">Account Financial Report (Template)</field>
<field name="model">wizard.report</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="General Account Balance (Multireports)">
<form string="Account Financial Report">
<group colspan="4">
<!--
<field name="name" colspan="4"/>
-->
</group>
<group colspan="4">
<group colspan="2">
<separator string="Company Info" colspan="4"/>
<field name="company_id" colspan="4"/>
<field name="currency_id" domain="[('company_id','=',company_id)]" colspan="4"/>
</group>
<group colspan="2">
<separator string="Report Info" colspan="4"/>
<field name="inf_type" colspan="4"/>
<field name="columns" colspan="4"/>
</group>
</group>
<newline/>
<group>
<group colspan='2'>
<group colspan="2">
<separator string="Accounts Info" colspan="4"/>
<field name="display_account" required="True" colspan="4"/>
<field name="display_account_level" required="True" colspan="4"/>
</group>
<group colspan="2">
<separator string="FiscalYear Info" colspan="4"/>
<field name="fiscalyear" domain="[('company_id','=',company_id)]"/>
<newline/>
</group>
</group>
<group colspan='4'>
<group colspan="1">
<separator string="Account to Include" colspan="4"/>
<field name="account_list" nolabel="1" colspan="4" domain="[('company_id','=',company_id)]">
<tree>
@ -37,42 +48,37 @@
</tree>
</field>
</group>
<group colspan="2">
<separator string="FiscalYear Info" colspan="4"/>
<field name="fiscalyear" domain="[('company_id','=',company_id)]"/>
<newline/>
<field name="filter" required="True" invisible='True'/>
<newline/>
<group attrs="{'invisible':[('filter','=','none')]}" colspan="4">
<group attrs="{'invisible':[('filter','=','byperiod')]}" colspan="4">
<separator string="Date Filter" colspan="4"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group attrs="{'invisible':[('filter','=','bydate')]}" colspan="4">
<!--
<separator string="Filter on Periods" colspan="4"/>
-->
<separator string="Periods to Include" colspan="4"/>
<field name="periods" colspan="4" nolabel="1" domain="[('fiscalyear_id','=',fiscalyear),('special','=',False),('company_id','=',company_id)]">
<group colspan="1">
<separator string="Periods to Include" colspan="4"/>
<field name="periods" colspan="4" nolabel="1" domain="[('fiscalyear_id','=',fiscalyear),('special','=',False),('company_id','=',company_id)]">
<tree>
<field name='code'/>
<field name='name'/>
<field name='state'/>
</tree>
</field>
</group>
</group>
<tree>
<field name='code'/>
<field name='name'/>
<field name='state'/>
</tree>
</field>
</group>
<group colspan="4">
<newline/>
<group colspan="4">
<separator string="Total" colspan="4"/>
<field name="tot_check" colspan="4"/>
<field name="lab_str" colspan="4"/>
</group>
<group colspan="4">
<group colspan="2">
<separator string="Account's Sign Conventions" colspan="4"/>
<label string="Please check the [ Account's Sign on Reports ] Section in the Company"/>
</group>
<group colspan="2">
<separator string="Total" colspan="4"/>
<field name="tot_check" colspan="4"/>
<field name="lab_str" colspan="4" attrs="{'required':[('tot_check','=',True)], 'readonly':[('tot_check','=',False)],}" />
</group>
</group>
<group colspan="4">
<separator string="" colspan="4"/>
<group colspan="2">
<label string=""/>
</group>
<group colspan="2">
<group colspan="2">
<label string=""/>
</group>
<button name="print_report" string="Print" type="object"/>
</group>
@ -82,8 +88,9 @@
</field>
</record>
<record id="action_wizard_report" model="ir.actions.act_window">
<field name="name">Reporte Balance (Multireportes)</field>
<field name="name">Account Financial Report (Multireports)</field>
<field name="res_model">wizard.report</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>

27
account_financial_report/wizard/wizard.py

@ -36,19 +36,24 @@ class wizard_report(osv.osv_memory):
_columns = {
'company_id': fields.many2one('res.company','Company',required=True),
'account_list': fields.many2many ('account.account','rel_wizard_account','account_list','account_id','Root accounts',required=True),
'filter': fields.selection([('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],'Date/Period Filter'),
'fiscalyear': fields.many2one('account.fiscalyear','Fiscal year',help='Keep empty to use all open fiscal years to compute the balance',required=True),
'periods': fields.many2many('account.period','rel_wizard_period','wizard_id','period_id','Periods',help='All periods in the fiscal year if empty'),
'currency_id': fields.many2one('res.currency', 'Currency', help="Currency at which this report will be expressed. If not selected will be used the one set in the company"),
'inf_type': fields.selection([('bgen','Balance Sheet'),('IS','Income Statement'),('bcom','Balance Comprobacion'),('edogp','Estado Ganancias y Perdidas'),('bml','Libro Mayor Legal')],'Tipo Informe',required=True),
'columns': fields.selection([('one','End. Balance'),('two','Debit | Credit'), ('four','Initial | Debit | Credit | YTD'), ('five','Initial | Debit | Credit | Period | YTD'),('thirteen','12 Months | YTD')],'Columns',required=True),
'display_account': fields.selection([('all','All Accounts'),('bal', 'With Balance'),('mov','With movements'),('bal_mov','With Balance / Movements')],'Display accounts'),
'display_account_level': fields.integer('Up to level',help='Display accounts up to this level (0 to show all)'),
'date_from': fields.date('Start date'),
'account_list': fields.many2many ('account.account','rel_wizard_account','account_list','account_id','Root accounts',required=True),
'fiscalyear': fields.many2one('account.fiscalyear','Fiscal year',help='Fiscal Year for this report',required=True),
'periods': fields.many2many('account.period','rel_wizard_period','wizard_id','period_id','Periods',help='All periods in the fiscal year if empty'),
'tot_check': fields.boolean('Summarize?', help='Checking will add a new line at the end of the Report which will Summarize Columns in Report'),
'lab_str': fields.char('Description', help='Description for the Summary', size= 128),
#~ Deprecated fields
'filter': fields.selection([('bydate','By Date'),('byperiod','By Period'),('all','By Date and Period'),('none','No Filter')],'Date/Period Filter'),
'date_to': fields.date('End date'),
'tot_check': fields.boolean('Show Total'),
'lab_str': fields.char('Description', size= 128),
'inf_type': fields.selection([('bgen','Balance Sheet'),('IS','Income Statement'),('bcom','Balance Comprobacion'),('edogp','Estado Ganancias y Perdidas'),('bml','Libro Mayor Legal')],'Tipo Informe',required=True),
'columns': fields.selection([('one','End. Balance'),('two','Debit | Credit'),('four','Init. | Dr. | Cr. | End.'),('five','Init. | Dr. | Cr. | YTD | End.'),('thirteen','12 Months | YTD')],'Column Number',required=True),
'currency_id': fields.many2one('res.currency', 'Secondary Currency', help="Forces all values for this report to be expressed in this secondary currency."),
'date_from': fields.date('Start date'),
}
_defaults = {
@ -56,7 +61,7 @@ class wizard_report(osv.osv_memory):
'date_to': lambda *a: time.strftime('%Y-%m-%d'),
'filter': lambda *a:'byperiod',
'display_account_level': lambda *a: 0,
'inf_type': lambda *a:'bcom',
'inf_type': lambda *a:'bgen',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.invoice', context=c),
'fiscalyear': lambda self, cr, uid, c: self.pool.get('account.fiscalyear').find(cr, uid),
'display_account': lambda *a:'bal_mov',

Loading…
Cancel
Save