From 9fd5c1b3a8bdd96797803d3fb9105ee358c11825 Mon Sep 17 00:00:00 2001 From: Humberto Arocha Date: Mon, 6 Aug 2012 01:10:23 -0530 Subject: [PATCH] [ADD] Se agrega modelo para plantillas de reportes financieros --- account_financial_report/__openerp__.py | 1 + account_financial_report/model/__init__.py | 1 + .../model/account_financial_report.py | 82 +++++++++++ .../view/account_financial_report_view.xml | 129 ++++++++++++++++++ 4 files changed, 213 insertions(+) create mode 100644 account_financial_report/model/account_financial_report.py create mode 100644 account_financial_report/view/account_financial_report_view.xml diff --git a/account_financial_report/__openerp__.py b/account_financial_report/__openerp__.py index 2430be9e..b1c11cdb 100644 --- a/account_financial_report/__openerp__.py +++ b/account_financial_report/__openerp__.py @@ -41,6 +41,7 @@ "view/wizard.xml", "view/account_view.xml", "view/company_view.xml", + "view/account_financial_report_view.xml", ], "active": False, "installable": True diff --git a/account_financial_report/model/__init__.py b/account_financial_report/model/__init__.py index 48c4ca46..a59a5350 100755 --- a/account_financial_report/model/__init__.py +++ b/account_financial_report/model/__init__.py @@ -23,4 +23,5 @@ # along with this program. If not, see . ################################################################################ +import account_financial_report import res_company diff --git a/account_financial_report/model/account_financial_report.py b/account_financial_report/model/account_financial_report.py new file mode 100644 index 00000000..e04ef243 --- /dev/null +++ b/account_financial_report/model/account_financial_report.py @@ -0,0 +1,82 @@ +# -*- encoding: utf-8 -*- +########################################################################### +# Module Writen to OpenERP, Open Source Management Solution +# Copyright (C) OpenERP Venezuela (). +# All Rights Reserved +###############Credits###################################################### +# Coded by: Humberto Arocha humberto@openerp.com.ve +# Angelica Barrios angelicaisabelb@gmail.com +# Jordi Esteve +# Javier Duran +# Planified by: Humberto Arocha +# Finance by: LUBCAN COL S.A.S http://www.lubcancol.com +# Audited by: Humberto Arocha humberto@openerp.com.ve +############################################################################# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +############################################################################## + +from osv import osv,fields +import pooler +import time +from tools.translate import _ + +class account_financial_report(osv.osv): + _name = "afr" + + _columns = { + 'name': fields.char('Name', size= 128, required=True), + 'company_id': fields.many2one('res.company','Company',required=True), + '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([('BS','Balance Sheet'),('IS','Income Statement')],'Type',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)'), + 'account_ids': fields.many2many ('account.account','afr_account_rel','afr_id','account_id','Root accounts',required=True), + 'fiscalyear_id': fields.many2one('account.fiscalyear','Fiscal year',help='Fiscal Year for this report',required=True), + 'period_ids': fields.many2many('account.period','afr_period_rel','afr_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'), + 'date_from': fields.date('Start date'), + } + + _defaults = { + 'display_account_level': lambda *a: 0, + 'inf_type': lambda *a:'BS', + 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.invoice', context=c), + 'fiscalyear_id': lambda self, cr, uid, c: self.pool.get('account.fiscalyear').find(cr, uid), + 'display_account': lambda *a:'bal_mov', + 'columns': lambda *a:'five', + + 'date_from': lambda *a: time.strftime('%Y-%m-%d'), + 'date_to': lambda *a: time.strftime('%Y-%m-%d'), + 'filter': lambda *a:'byperiod', + } + + def copy(self, cr, uid, id, defaults, context=None): + if context is None: + context = {} + previous_name = self.browse(cr, uid, id, context=context).name + new_name = _('Copy of %s')%previous_name + lst = self.search(cr, uid, [('name','like',new_name)], context=context) + if lst: + new_name = '%s (%s)' % (new_name, len(lst)+1) + defaults['name'] = new_name + return super(account_financial_report,self).copy(cr, uid, id, defaults, context=context) + +account_financial_report() diff --git a/account_financial_report/view/account_financial_report_view.xml b/account_financial_report/view/account_financial_report_view.xml new file mode 100644 index 00000000..a6db5170 --- /dev/null +++ b/account_financial_report/view/account_financial_report_view.xml @@ -0,0 +1,129 @@ + + + + + + Account Financial Report (Template) + afr + form + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + Account Financial Report (Template) + afr + tree + + + + + + + + + + + + + + + + + + + + + + Account Financial Report + afr + ir.actions.act_window + form + tree,form + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ut nunc magna. Vivamus felis sem, mattis vel consequat pharetra, adipiscing ut erat. In accumsan fermentum ullamcorper. Cras vitae sem magna, pellentesque condimentum metus. Cras at sem quis lectus vehicula adipiscing. Vivamus in urna ipsum, sed molestie magna. Nam ullamcorper arcu condimentum leo ultrices egestas. Nullam ut tincidunt orci. Proin sollicitudin luctus risus sit amet mattis. Duis eget risus non enim pharetra dignissim. Mauris eros eros, fringilla et interdum non, aliquam at orci. + + + + + + + +
+