clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00546
lp:~dr.clearcorp/openerp-ccorp-addons/6.1-accout_journal_period_report into lp:openerp-ccorp-addons
Diana Rodríguez Martínez has proposed merging lp:~dr.clearcorp/openerp-ccorp-addons/6.1-accout_journal_period_report into lp:openerp-ccorp-addons.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~dr.clearcorp/openerp-ccorp-addons/6.1-accout_journal_period_report/+merge/143748
[ADD] Add new module account_journal_period_report that fix jounal period report (add new webkit)
--
https://code.launchpad.net/~dr.clearcorp/openerp-ccorp-addons/6.1-accout_journal_period_report/+merge/143748
Your team CLEARCORP development team is subscribed to branch lp:openerp-ccorp-addons.
=== added directory 'account_journal_period_report'
=== added file 'account_journal_period_report/__init__.py'
--- account_journal_period_report/__init__.py 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/__init__.py 2013-01-17 19:19:28 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import report
+import wizard
\ No newline at end of file
=== added file 'account_journal_period_report/__openerp__.py'
--- account_journal_period_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/__openerp__.py 2013-01-17 19:19:28 +0000
@@ -0,0 +1,40 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+{
+ 'name': 'Account Journal Period Report',
+ 'version': '1.0',
+ 'url': 'http://launchpad.net/openerp-ccorp-addons',
+ 'author': 'ClearCorp S.A.',
+ 'website': 'http://clearcorp.co.cr',
+ 'category': 'Accounting & Finance',
+ 'complexity': 'normal',
+ 'description': """This module modifies the account journal period report """,
+ 'depends': [
+ 'account',
+ ],
+ 'init_xml': [],
+ 'demo_xml': [],
+ 'update_xml': ['report/report.xml',],
+ 'license': 'AGPL-3',
+ 'installable': True,
+ 'active': False,
+}
=== added directory 'account_journal_period_report/report'
=== added file 'account_journal_period_report/report/__init__.py'
--- account_journal_period_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/report/__init__.py 2013-01-17 19:19:28 +0000
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import account_journal_period_report
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_journal_period_report/report/account_journal_period_report.mako'
--- account_journal_period_report/report/account_journal_period_report.mako 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/report/account_journal_period_report.mako 2013-01-17 19:19:28 +0000
@@ -0,0 +1,127 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/account_webkit_report_library/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body>
+ <%setLang(user.context_lang)%>
+ <%
+ fiscalyear = get_fiscalyear(data)
+ company = get_account(data)
+ period_from = get_start_period(data)
+ period_to = get_end_period(data)
+ sort_by = get_sortby(data)
+ target_move = get_target_move(data)
+ %>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('internal_reports_logo', height=100)|n}</div>
+ <br/>
+ <div class="table-cell text">
+ <p class="title">${_('Journal Report ')}</p>
+ </div>
+ </div>
+ </div>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 70px">${_('Chart of Accounts: ')}<br/>${company}</div>
+ <div class="table-cell" style="width: 100px">${_('Fiscal Year: ')}<br/>${fiscalyear}</div>
+ <div class="table-cell" style="width: 100px">${_('Selected period: ')}<br/> ${period_from}</div>
+ <div class="table-cell" style="width: 100px">${_('Entries Sorted By:')}<br/>${sort_by}</div>
+ <div class="table-cell last-column" style="width: 40px">${_('Target Moves: ')}<br/>${target_move}</div>
+ </div>
+ </div>
+ </div>
+ <%
+ period_id = data['form']['period_from']
+ journal_ids = data['form']['journal_ids']
+ journal_list = get_journal_list(journal_ids)
+ %>
+ %for journal in journal_list:
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="subtitle">${journal.code +' - ' +journal.name + ' - ' + journal.company_id.currency_id.name}</p>
+ </div>
+ </div>
+ </div>
+ <%
+ journal_move_lines = lines(period_id, journal.id)
+ %>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ %if display_currency(data) is False:
+ <div class="table-cell first-column" style="width: 200px">${_('Move')}</div>
+ <div class="table-cell" style="width: 100px">${_('Date')}</div>
+ <div class="table-cell" style="width: 70px">${_('Account')}</div>
+ <div class="table-cell" style="width: 300px">${_('Partner')}</div>
+ <div class="table-cell" style="width: 300px">${_('Label')}</div>
+ <div class="table-cell" style="width: 100px">${_('Debit')}</div>
+ <div class="table-cell last-column" style="width: 100px">${_('Credit')}</div>
+ %else:
+ <div class="table-cell first-column" style="width: 100px">${_('Move')}</div>
+ <div class="table-cell" style="width: 100px">${_('Date')}</div>
+ <div class="table-cell" style="width: 70px">${_('Account')}</div>
+ <div class="table-cell" style="width: 200px">${_('Partner')}</div>
+ <div class="table-cell" style="width: 300px">${_('Label')}</div>
+ <div class="table-cell" style="width: 100px">${_('Debit')}</div>
+ <div class="table-cell" style="width: 100px">${_('Credit')}</div>
+ <div class="table-cell last-column" style="width: 70px">${_('Amount Currency')}</div>
+ %endif
+ </div>
+ </div>
+ <div class="table-body">
+ %for line in journal_move_lines:
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ %if line.move_id.name:
+ <div class="table-cell first-column">${line.move_id.name} </div>
+ %else:
+ <div class="table-cell first-column">${line.move_id.id} </div>
+ %endif
+ <div class="table-cell">${formatLang(line.date,date=True)}</div>
+ <div class="table-cell">${line.account_id.code}</div>
+ <div class="table-cell">${line.partner_id.name or ''}</div>
+ <div class="table-cell">${line.name}</div>
+ <div class="table-cell amount">${formatLang(line.debit)}</div>
+ %if display_currency(data) is False:
+ <div class="table-cell amount last-column">${formatLang(line.credit)}</div>
+ %else:
+ <div class="table-cell amount">${formatLang(line.credit)}</div>
+ <div class="table-cell amount last-column">${get_format_lang_currency(cr, uid, formatLang(line.amount_currency), line.currency_id)}</div>
+ %endif
+ </div>
+ %endfor
+ </div>
+ </div>
+ %if display_currency(data) is False:
+ <div class="table-row subtotal">
+ <div class="table-cell first-column" style="width: 200px"></div>
+ <div class="table-cell" style="width: 100px"></div>
+ <div class="table-cell" style="width: 70px"></div>
+ <div class="table-cell" style="width: 400px"></div>
+ <div class="table-cell" style="width: 900px">${_('TOTAL')}</div>
+ <div class="table-cell amount" style="width: 100px" >${formatLang(sum_debit(period_id, journal.id))}</div>
+ <div class="table-cell amount last-column" style="width: 100px">${formatLang(sum_credit(period_id, journal.id))}</div>
+ </div>
+ %else:
+ <div class="table-row subtotal">
+ <div class="table-cell first-column" style="width: 100px"></div>
+ <div class="table-cell" style="width: 100px"></div>
+ <div class="table-cell" style="width: 70px"></div>
+ <div class="table-cell" style="width: 200px"></div>
+ <div class="table-cell" style="width: 300px">${_('TOTAL')}</div>
+ <div class="table-cell" style="width: 100px">${formatLang(sum_debit(period_id, journal.id))}</div>
+ <div class="table-cell" style="width: 100px">${formatLang(sum_credit(period_id, journal.id))}</div>
+ <div class="table-cell last-column" style="width: 70px"></div>
+ </div>
+ %endif
+ %endfor
+ <p style="page-break-after:always"></p>
+ </body>
+</html>
\ No newline at end of file
=== added file 'account_journal_period_report/report/account_journal_period_report.py'
--- account_journal_period_report/report/account_journal_period_report.py 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/report/account_journal_period_report.py 2013-01-17 19:19:28 +0000
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+import pooler
+from report import report_sxw
+import locale
+from account.report.account_journal import journal_print
+
+#la herencia se debe hacer de journal_print (clase original del reporte)
+#para que se llame el init y el set context, y se puedan usar las variables y métodos.
+#si no se hace, se pierden los valores de la clase original donde se está heredando
+#la herencia en python se hace pasando por parámetro la clase a heredar (en este caso journal_print)
+
+class account_journal_period_report(journal_print):
+
+ def __init__(self, cr, uid, name, context):
+
+ super(account_journal_period_report, self).__init__(cr, uid, name, context=context)
+
+ self.localcontext.update({
+ 'get_journal_list': self.get_journal_list,
+ 'get_format_lang_currency': self.pool.get('account.webkit.report.library').format_lang_currency,
+ })
+
+ #Receive the journal_ids and return the full object
+ def get_journal_list(self, journal_ids):
+ return self.pool.get('account.journal').browse(self.cr, self.uid, journal_ids)
+
+#the parameters are the report name and module name
+report_sxw.report_sxw( 'report.account_journal_period_print_inherit',
+ 'account.print.journal',
+ 'addons/account_journal_period_report/report/account_journal_period_report.mako',
+ parser = account_journal_period_report)
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'account_journal_period_report/report/report.xml'
--- account_journal_period_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/report/report.xml 2013-01-17 19:19:28 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account.account_journal" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">account_journal_period_print_inherit</field>
+ <field eval="[(6,0,[])]" name="groups_id"/>
+ <field eval="0" name="multi"/>
+ <field eval="0" name="auto"/>
+ <field eval="1" name="header"/>
+ <field name="model">account.print.journal</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">Journal</field>
+ <field name="report_rml">account_journal_period_report/report/account_journal_period_report.mako</field>
+ <field name="report_file">account_journal_period_report/report/account_journal_period_report.mako</field>
+ </record>
+ </data>
+</openerp>
=== added directory 'account_journal_period_report/wizard'
=== added file 'account_journal_period_report/wizard/__init__.py'
--- account_journal_period_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/wizard/__init__.py 2013-01-17 19:19:28 +0000
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+import account_journal_period_report_wizard
=== added file 'account_journal_period_report/wizard/account_journal_period_report_wizard.py'
--- account_journal_period_report/wizard/account_journal_period_report_wizard.py 1970-01-01 00:00:00 +0000
+++ account_journal_period_report/wizard/account_journal_period_report_wizard.py 2013-01-17 19:19:28 +0000
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero 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 Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class account_journal_period_report_inherit(osv.osv_memory):
+
+ _inherit = "account.print.journal"
+ _name = "account.print.journal"
+ _description = "Account Print Journal"
+
+ def pre_print_report(self, cr, uid, ids, data, context=None):
+ #TODO Pass comments to english
+ """
+ account.print.journal wizard ya es una herencia del account_common_report. En este wizard se agrega el
+ campo sort_selection. Se presenta un error al leer este parámetro, ya que no se pasa de manera correcta
+ por lo que se hace un read del campo, para leer de nuevo el parámetro y pasarlo de forma correcta.
+ Con esto se soluciona el error.
+ """
+ data = super(account_journal_period_report_inherit, self).pre_print_report(cr, uid, ids, data, context)
+ if context is None:
+ context = {}
+ vals = self.read(cr, uid, ids,
+ ['sort_selection',],
+ context=context)[0]
+ data['form'].update(vals)
+ return data
+
+ def _print_report(self, cursor, uid, ids, data, context=None):
+ context = context or {}
+ # we update form with display account value
+ data = self.pre_print_report(cursor, uid, ids, data, context=context)
+
+ return {'type': 'ir.actions.report.xml',
+ 'report_name': 'account_journal_period_print_inherit',
+ 'datas': data}
+
Follow ups