Browse Source

80 - report_xls port

pull/5/head
luc-demeyer 10 years ago
parent
commit
7480f51e99
  1. BIN
      __unported__/report_xls/static/src/img/icon.png
  2. 1
      report_xls/__init__.py
  3. 2
      report_xls/__openerp__.py
  4. 36
      report_xls/ir_report.py
  5. 0
      report_xls/report_xls.py
  6. BIN
      report_xls/static/description/help.png
  7. 0
      report_xls/static/description/icon.png
  8. 84
      report_xls/static/description/index.html
  9. BIN
      report_xls/static/description/open_receivables.png
  10. 1
      report_xls/utils.py

BIN
__unported__/report_xls/static/src/img/icon.png

1
__unported__/report_xls/__init__.py → report_xls/__init__.py

@ -22,5 +22,4 @@
from . import ir_report
from . import report_xls
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

2
__unported__/report_xls/__openerp__.py → report_xls/__openerp__.py

@ -77,6 +77,6 @@ Excel reports in odoo.
'depends': ['base'],
'external_dependencies': {'python': ['xlwt']},
'active': False,
'installable': False,
'installable': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

36
report_xls/ir_report.py

@ -0,0 +1,36 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# 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 openerp.osv import fields, orm
class ir_actions_report_xml(orm.Model):
_inherit = 'ir.actions.report.xml'
def _check_selection_field_value(self, cr, uid,
field, value, context=None):
if field == 'report_type' and value == 'xls':
return
return super(ir_actions_report_xml, self)._check_selection_field_value(
cr, uid, field, value, context=context)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

0
__unported__/report_xls/report_xls.py → report_xls/report_xls.py

BIN
report_xls/static/description/help.png

After

Width: 300  |  Height: 235  |  Size: 30 KiB

0
report_xls/static/description/icon2.png → report_xls/static/description/icon.png

Before

Width: 88  |  Height: 85  |  Size: 11 KiB

After

Width: 88  |  Height: 85  |  Size: 11 KiB

84
report_xls/static/description/index.html

@ -0,0 +1,84 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Excel report engine</h2>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<img src="open_receivables.png">
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<br><br>This module adds Excel export capabilities to the standard odoo reporting engine.
</p>
</div>
</div>
</section>
<section class="oe_spaced oe_container oe_dark">
<div class="oe_row">
<h2 class="oe_slogan">Report development</h2>
<p class="oe_mt32">
In order to create an Excel report you can
<ul>
<li>define a report of type 'xls'</li>
<li>pass <code>{'xls_export': 1}</code> via the context to the report create method</li>
</ul>
</p>
<p class="oe_mt32">
The <code>report_xls</code> class contains a number of attributes and methods to facilitate the creation XLS reports in odoo.
<ul>
<li>
cell types
<br>Supported cell types : text, number, boolean, date.
</li>
</ul>
<ul>
<li>
cell styles
<br>The predefined cell style definitions result in a consistent look and feel of the odoo Excel reports.
</li>
</ul>
<ul>
<li>
cell formulas
<br>Cell formulas can be easily added with the help of the <code>rowcol_to_cell()</code> function which you can import from the <code>utils.py</code> module.
</li>
</ul>
<ul>
<li>
Excel templates
<br>It is possible to define Excel templates which can be adapted by 'inherited' modules.
<br>Download the <b>account_move_line_report_xls</b> module from <a href="http://apps.odoo.com">http://apps.odoo.com</a> as example.
</li>
</ul>
<ul>
<li>
XLS with multiple sheets
<br>Download the <b>account_journal_report_xls</b> module from <a href="http://apps.odoo.com">http://apps.odoo.com</a> as example.
</li>
</ul>
</p>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Development assistance</h2>
</div>
<div class="oe_span6">
<br>
<div class="oe_picture">
<center><img src="help.png" height="150"></center>
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<br><br>Contact <a href="mailto:info@noviat.com">info@noviat.com</a> for help with the development of Excel reports in odoo.
</p>
</div>
</div>
</section>

BIN
report_xls/static/description/open_receivables.png

After

Width: 854  |  Height: 507  |  Size: 49 KiB

1
__unported__/report_xls/utils.py → report_xls/utils.py

@ -48,5 +48,4 @@ def rowcol_to_cell(row, col, row_abs=False, col_abs=False):
# Zero index to 1-index
return col_abs + chr1 + chr2 + row_abs + str(row + 1)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Loading…
Cancel
Save