From c50af0b5a4f75e4379a7f1dc689b8cbc2185db3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 11 May 2016 13:58:27 +0200 Subject: [PATCH] [WIP] mis_builder refactoring: refactor and improve PDF report --- .../report/report_mis_report_instance.py | 20 ---- .../report/report_mis_report_instance.xml | 99 +++++++++---------- mis_builder/static/src/css/report.css | 62 ++++++------ 3 files changed, 78 insertions(+), 103 deletions(-) diff --git a/mis_builder/report/report_mis_report_instance.py b/mis_builder/report/report_mis_report_instance.py index 44cfbeb8..162b146a 100644 --- a/mis_builder/report/report_mis_report_instance.py +++ b/mis_builder/report/report_mis_report_instance.py @@ -9,26 +9,6 @@ from openerp import api, models _logger = logging.getLogger(__name__) -class ReportMisReportInstance(models.AbstractModel): - - _name = 'report.mis_builder.report_mis_report_instance' - - @api.multi - def render_html(self, data=None): - docs = self.env['mis.report.instance'].browse(self._ids) - docs_computed = {} - for doc in docs: - docs_computed[doc.id] = doc.compute() - docargs = { - 'doc_ids': self._ids, - 'doc_model': 'mis.report.instance', - 'docs': docs, - 'docs_computed': docs_computed, - } - return self.env['report'].\ - render('mis_builder.report_mis_report_instance', docargs) - - class Report(models.Model): _inherit = "report" diff --git a/mis_builder/report/report_mis_report_instance.xml b/mis_builder/report/report_mis_report_instance.xml index a960e874..940b917a 100644 --- a/mis_builder/report/report_mis_report_instance.xml +++ b/mis_builder/report/report_mis_report_instance.xml @@ -4,72 +4,69 @@ diff --git a/mis_builder/static/src/css/report.css b/mis_builder/static/src/css/report.css index 2ea21e43..581a8560 100644 --- a/mis_builder/static/src/css/report.css +++ b/mis_builder/static/src/css/report.css @@ -1,47 +1,45 @@ .mis_table { - display: table ; + display: table; width: 100%; - table-layout: fixed ; + table-layout: fixed; } .mis_row { - display: table-row ; + display: table-row; page-break-inside: avoid; } .mis_cell { - display: table-cell ; + display: table-cell; page-break-inside: avoid; } .mis_thead { - display: table-header-group ; + display: table-header-group; } .mis_tbody { - display: table-row-group ; -} -.mis_row.labels { - background-color:#F0F0F0 ; + display: table-row-group; } .mis_table, .mis_table .mis_row { - border-left:0px; - border-right:0px; - text-align:left; - padding-right:3px; - padding-left:3px; - padding-top:2px; - padding-bottom:2px; - border-collapse:collapse; -} -.mis_table .mis_row.labels, .mis_table .mis_row.lines { - border-color:grey ; - border-bottom:1px solid lightGrey ; -} -.mis_table .mis_cell { - word-wrap: break-word; -} -.mis_cell.amount { - word-wrap:normal; - text-align:right; -} -.mis_table .mis_cell{ - padding-left: 5px; -/* border-right:1px solid lightGrey; uncomment to active column lines */ + border-left: 0px; + border-right: 0px; + text-align: left; + padding-right: 3px; + padding-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + border-collapse: collapse; +} +.mis_table .mis_row { + border-color: grey; + border-bottom: 1px solid lightGrey; +} +.mis_table .mis_cell.mis_collabel { + font-weight: bold; + background-color: #F0F0F0; + text-align: center; +} +.mis_table .mis_cell.mis_rowlabel { + text-align: left; + /*white-space: nowrap;*/ +} +.mis_table .mis_cell.mis_amount { + text-align: right; }