80 - report_xls port
parent
c5ff5db105
commit
7480f51e99
Binary file not shown.
|
@ -22,5 +22,4 @@
|
||||||
|
|
||||||
from . import ir_report
|
from . import ir_report
|
||||||
from . import report_xls
|
from . import report_xls
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -77,6 +77,6 @@ Excel reports in odoo.
|
||||||
'depends': ['base'],
|
'depends': ['base'],
|
||||||
'external_dependencies': {'python': ['xlwt']},
|
'external_dependencies': {'python': ['xlwt']},
|
||||||
'active': False,
|
'active': False,
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -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:
|
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
@ -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>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
|
@ -48,5 +48,4 @@ def rowcol_to_cell(row, col, row_abs=False, col_abs=False):
|
||||||
# Zero index to 1-index
|
# Zero index to 1-index
|
||||||
return col_abs + chr1 + chr2 + row_abs + str(row + 1)
|
return col_abs + chr1 + chr2 + row_abs + str(row + 1)
|
||||||
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
Loading…
Reference in New Issue