update account_move_line_report_xls
parent
222cb74cf8
commit
e322a7fa50
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
|
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -12,18 +12,13 @@
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
try:
|
from . import account_move_line
|
||||||
from . import account_move_line
|
from . import report
|
||||||
from . import report
|
|
||||||
except ImportError:
|
|
||||||
import logging
|
|
||||||
logging.getLogger('openerp.module').warning('report_xls not available in addons path. account_financial_report_webkit_xls will not be usable')
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
|
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -12,35 +12,63 @@
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Account Move Line XLS export',
|
'name': 'Account Move Line XLS export',
|
||||||
'version': '0.5',
|
'version': '0.6',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'author': 'Noviat',
|
'author': 'Noviat',
|
||||||
'category' : 'Accounting & Finance',
|
'category': 'Accounting & Finance',
|
||||||
'description': """
|
'description': """
|
||||||
|
|
||||||
Journal Items Excel Export
|
Journal Items Excel Export
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
This module adds a button on the journal items ('account.move.line') list view in order to export the selected lines.
|
This module adds a button on the journal items ('account.move.line') list view
|
||||||
|
in order to export the selected lines.
|
||||||
|
|
||||||
If you are installing this module manually, you need also the module 'report_xls', that is located in:
|
If you are installing this module manually, you need also the **report_xls**
|
||||||
https://launchpad.net/openerp-reporting-engines"
|
module located in:
|
||||||
|
https://launchpad.net/openerp-reporting-engines
|
||||||
|
|
||||||
|
Report customisation
|
||||||
|
''''''''''''''''''''
|
||||||
|
|
||||||
|
The Excel export can be tailored to your exact needs via the following methods
|
||||||
|
of the 'account.move.line' object:
|
||||||
|
|
||||||
|
* **_report_xls_fields**
|
||||||
|
|
||||||
|
Add/drop columns or change order from the list of columns that are defined
|
||||||
|
in the Excel template.
|
||||||
|
|
||||||
|
The following fields are defined in the Excel template:
|
||||||
|
|
||||||
|
move, name, date, journal, period, partner, account,
|
||||||
|
date_maturity, debit, credit, balance,
|
||||||
|
reconcile, reconcile_partial, analytic_account,
|
||||||
|
ref, partner_ref, tax_code, tax_amount, amount_residual,
|
||||||
|
amount_currency, currency_name, company_currency,
|
||||||
|
amount_residual_currency, product, product_ref', product_uom, quantity,
|
||||||
|
statement, invoice, narration, blocked
|
||||||
|
|
||||||
|
* **_report_xls_template**
|
||||||
|
|
||||||
|
Change/extend the Excel template.
|
||||||
|
|
||||||
|
Customisation assistance
|
||||||
|
''''''''''''''''''''''''
|
||||||
|
Contact info@noviat.com for help with the customisation and/or development
|
||||||
|
of Excel reports in OpenERP.
|
||||||
""",
|
""",
|
||||||
'depends': ['account', 'report_xls'],
|
'depends': ['account', 'report_xls'],
|
||||||
'demo_xml': [],
|
'data': [
|
||||||
'init_xml': [],
|
'report/move_line_list_xls.xml',
|
||||||
'update_xml' : [
|
|
||||||
'report/move_line_list_xls.xml',
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
|
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -12,11 +12,11 @@
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
@ -24,22 +24,28 @@ from openerp.osv import orm
|
||||||
from openerp.addons.report_xls.utils import rowcol_to_cell, _render
|
from openerp.addons.report_xls.utils import rowcol_to_cell, _render
|
||||||
from openerp.tools.translate import _
|
from openerp.tools.translate import _
|
||||||
|
|
||||||
|
|
||||||
class account_move_line(orm.Model):
|
class account_move_line(orm.Model):
|
||||||
_inherit = 'account.move.line'
|
_inherit = 'account.move.line'
|
||||||
|
|
||||||
# override list in custom module to add/drop columns or change order
|
# override list in custom module to add/drop columns or change order
|
||||||
def _report_xls_fields(self, cr, uid, context=None):
|
def _report_xls_fields(self, cr, uid, context=None):
|
||||||
return [
|
return [
|
||||||
'move', 'name', 'date', 'period', 'partner', 'account',
|
'move', 'name', 'date', 'journal', 'period', 'partner', 'account',
|
||||||
'date_maturity', 'debit', 'credit', 'balance', 'reconcile', 'reconcile_partial',
|
'date_maturity', 'debit', 'credit', 'balance',
|
||||||
#'amount_currency', 'currency_name',
|
'reconcile', 'reconcile_partial', 'analytic_account',
|
||||||
|
#'ref', 'partner_ref', 'tax_code', 'tax_amount', 'amount_residual',
|
||||||
|
#'amount_currency', 'currency_name', 'company_currency',
|
||||||
|
#'amount_residual_currency',
|
||||||
|
#'product', 'product_ref', 'product_uom', 'quantity',
|
||||||
|
#'statement', 'invoice', 'narration', 'blocked',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Change/Add Template entries
|
# Change/Add Template entries
|
||||||
def _report_xls_template(self, cr, uid, context=None):
|
def _report_xls_template(self, cr, uid, context=None):
|
||||||
"""
|
"""
|
||||||
Template updates, e.g.
|
Template updates, e.g.
|
||||||
|
|
||||||
my_change = {
|
my_change = {
|
||||||
'move':{
|
'move':{
|
||||||
'header': [1, 20, 'text', _('My Move Title')],
|
'header': [1, 20, 'text', _('My Move Title')],
|
||||||
|
@ -47,6 +53,5 @@ class account_move_line(orm.Model):
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
}
|
}
|
||||||
return my_change
|
return my_change
|
||||||
"""
|
"""
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# French translation of OpenERP Server 6.1.
|
# French translation of OpenERP Server 7.0.
|
||||||
# This file contains the translation of the following modules:
|
# This file contains the translation of the following modules:
|
||||||
# * account_move_line_report_xls
|
# * account_move_line_report_xls
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: OpenERP Server 6.1\n"
|
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||||
"Report-Msgid-Bugs-To: support@noviat.be\n"
|
"Report-Msgid-Bugs-To: support@noviat.com\n"
|
||||||
"POT-Creation-Date: 2013-11-23 16:11:12.706000\n"
|
"POT-Creation-Date: 2014-01-08 23:46:06.568000\n"
|
||||||
"PO-Revision-Date: 2013-11-23 16:11:12.706000\n"
|
"PO-Revision-Date: 2014-01-08 23:46:06.568000\n"
|
||||||
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
|
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -109,3 +109,68 @@ msgstr "Montant devise"
|
||||||
msgid "Curr."
|
msgid "Curr."
|
||||||
msgstr "Dev."
|
msgstr "Dev."
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Journal"
|
||||||
|
msgstr "Journal"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Comp. Curr."
|
||||||
|
msgstr "Dev. Soc."
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Analytic Account"
|
||||||
|
msgstr "Compte analytique"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Product"
|
||||||
|
msgstr "Article"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Product Reference"
|
||||||
|
msgstr "Réf. Article"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Unit of Measure"
|
||||||
|
msgstr "Unité de mesure"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Qty"
|
||||||
|
msgstr "Qty"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Statement"
|
||||||
|
msgstr "Relevé"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Invoice"
|
||||||
|
msgstr "Facture"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Residual Amount"
|
||||||
|
msgstr "Montant résiduel"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Res. Am. in Curr."
|
||||||
|
msgstr "Montant résiduel en dev."
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Notes"
|
||||||
|
msgstr "Notes"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Lit."
|
||||||
|
msgstr "Lit."
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Dutch translation of OpenERP Server 6.1.
|
# Dutch translation of OpenERP Server 7.0.
|
||||||
# This file contains the translation of the following modules:
|
# This file contains the translation of the following modules:
|
||||||
# * account_move_line_report_xls
|
# * account_move_line_report_xls
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: OpenERP Server 6.1\n"
|
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||||
"Report-Msgid-Bugs-To: support@noviat.be\n"
|
"Report-Msgid-Bugs-To: support@noviat.com\n"
|
||||||
"POT-Creation-Date: 2013-11-23 16:11:12.702000\n"
|
"POT-Creation-Date: 2014-01-08 23:46:06.564000\n"
|
||||||
"PO-Revision-Date: 2013-11-23 16:11:12.702000\n"
|
"PO-Revision-Date: 2014-01-08 23:46:06.564000\n"
|
||||||
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
|
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -109,3 +109,68 @@ msgstr "Bedrag valuta"
|
||||||
msgid "Curr."
|
msgid "Curr."
|
||||||
msgstr "Val."
|
msgstr "Val."
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Journal"
|
||||||
|
msgstr "Dagboek"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Comp. Curr."
|
||||||
|
msgstr "Bedr. Val."
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Analytic Account"
|
||||||
|
msgstr "Kostenplaats"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Product"
|
||||||
|
msgstr "Product"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Product Reference"
|
||||||
|
msgstr "Ref. Product"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Unit of Measure"
|
||||||
|
msgstr "Maateenheid"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Qty"
|
||||||
|
msgstr "HvH"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Statement"
|
||||||
|
msgstr "Uitreksel"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Invoice"
|
||||||
|
msgstr "Factuur"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Residual Amount"
|
||||||
|
msgstr "Restbedrag"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Res. Am. in Curr."
|
||||||
|
msgstr "Restbedrag in val."
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Notes"
|
||||||
|
msgstr "Notities"
|
||||||
|
|
||||||
|
#. module: account_move_line_report_xls
|
||||||
|
#: report:move.line.list.xls:0
|
||||||
|
msgid "Lit."
|
||||||
|
msgstr "Lit."
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
|
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -12,11 +12,11 @@
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# OpenERP, Open Source Management Solution
|
# OpenERP, Open Source Management Solution
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
|
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
|
@ -12,11 +12,11 @@
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU Affero General Public License for more details.
|
# GNU Affero General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# 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/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
@ -34,8 +34,9 @@ _logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
_ir_translation_name = 'move.line.list.xls'
|
_ir_translation_name = 'move.line.list.xls'
|
||||||
|
|
||||||
|
|
||||||
class move_line_xls_parser(report_sxw.rml_parse):
|
class move_line_xls_parser(report_sxw.rml_parse):
|
||||||
|
|
||||||
def __init__(self, cr, uid, name, context):
|
def __init__(self, cr, uid, name, context):
|
||||||
super(move_line_xls_parser, self).__init__(cr, uid, name, context=context)
|
super(move_line_xls_parser, self).__init__(cr, uid, name, context=context)
|
||||||
move_obj = self.pool.get('account.move.line')
|
move_obj = self.pool.get('account.move.line')
|
||||||
|
@ -53,122 +54,168 @@ class move_line_xls_parser(report_sxw.rml_parse):
|
||||||
lang = self.context.get('lang', 'en_US')
|
lang = self.context.get('lang', 'en_US')
|
||||||
return translate(self.cr, _ir_translation_name, 'report', lang, src) or src
|
return translate(self.cr, _ir_translation_name, 'report', lang, src) or src
|
||||||
|
|
||||||
|
|
||||||
class move_line_xls(report_xls):
|
class move_line_xls(report_xls):
|
||||||
|
|
||||||
def __init__(self, name, table, rml=False, parser=False, header=True, store=False):
|
def __init__(self, name, table, rml=False, parser=False, header=True, store=False):
|
||||||
super(move_line_xls, self).__init__(name, table, rml, parser, header, store)
|
super(move_line_xls, self).__init__(name, table, rml, parser, header, store)
|
||||||
|
|
||||||
# Cell Styles
|
# Cell Styles
|
||||||
_xs = self.xls_styles
|
_xs = self.xls_styles
|
||||||
# header
|
# header
|
||||||
rh_cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all']
|
rh_cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all']
|
||||||
self.rh_cell_style = xlwt.easyxf(rh_cell_format)
|
self.rh_cell_style = xlwt.easyxf(rh_cell_format)
|
||||||
self.rh_cell_style_center = xlwt.easyxf(rh_cell_format + _xs['center'])
|
self.rh_cell_style_center = xlwt.easyxf(rh_cell_format + _xs['center'])
|
||||||
self.rh_cell_style_right = xlwt.easyxf(rh_cell_format + _xs['right'])
|
self.rh_cell_style_right = xlwt.easyxf(rh_cell_format + _xs['right'])
|
||||||
# lines
|
# lines
|
||||||
aml_cell_format = _xs['borders_all']
|
aml_cell_format = _xs['borders_all']
|
||||||
self.aml_cell_style = xlwt.easyxf(aml_cell_format)
|
self.aml_cell_style = xlwt.easyxf(aml_cell_format)
|
||||||
self.aml_cell_style_center = xlwt.easyxf(aml_cell_format + _xs['center'])
|
self.aml_cell_style_center = xlwt.easyxf(aml_cell_format + _xs['center'])
|
||||||
self.aml_cell_style_date = xlwt.easyxf(aml_cell_format + _xs['left'], num_format_str = report_xls.date_format)
|
self.aml_cell_style_date = xlwt.easyxf(aml_cell_format + _xs['left'], num_format_str=report_xls.date_format)
|
||||||
self.aml_cell_style_decimal = xlwt.easyxf(aml_cell_format + _xs['right'], num_format_str = report_xls.decimal_format)
|
self.aml_cell_style_decimal = xlwt.easyxf(aml_cell_format + _xs['right'], num_format_str=report_xls.decimal_format)
|
||||||
# totals
|
# totals
|
||||||
rt_cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all']
|
rt_cell_format = _xs['bold'] + _xs['fill'] + _xs['borders_all']
|
||||||
self.rt_cell_style = xlwt.easyxf(rt_cell_format)
|
self.rt_cell_style = xlwt.easyxf(rt_cell_format)
|
||||||
self.rt_cell_style_right = xlwt.easyxf(rt_cell_format + _xs['right'])
|
self.rt_cell_style_right = xlwt.easyxf(rt_cell_format + _xs['right'])
|
||||||
self.rt_cell_style_decimal = xlwt.easyxf(rt_cell_format + _xs['right'], num_format_str = report_xls.decimal_format)
|
self.rt_cell_style_decimal = xlwt.easyxf(rt_cell_format + _xs['right'], num_format_str=report_xls.decimal_format)
|
||||||
|
|
||||||
# XLS Template
|
# XLS Template
|
||||||
self.col_specs_template = {
|
self.col_specs_template = {
|
||||||
'move':{
|
'move': {
|
||||||
'header': [1, 20, 'text', _render("_('Entry')")],
|
'header': [1, 20, 'text', _render("_('Entry')")],
|
||||||
'lines': [1, 0, 'text', _render("line.move_id.name or ''")],
|
'lines': [1, 0, 'text', _render("line.move_id.name or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'name':{
|
'name': {
|
||||||
'header': [1, 42, 'text', _render("_('Name')")],
|
'header': [1, 42, 'text', _render("_('Name')")],
|
||||||
'lines': [1, 0, 'text', _render("line.name or ''")],
|
'lines': [1, 0, 'text', _render("line.name or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'ref':{
|
'ref': {
|
||||||
'header': [1, 42, 'text', _render("_('Reference')")],
|
'header': [1, 42, 'text', _render("_('Reference')")],
|
||||||
'lines': [1, 0, 'text', _render("line.ref or ''")],
|
'lines': [1, 0, 'text', _render("line.ref or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'date':{
|
'date': {
|
||||||
'header': [1, 13, 'text', _render("_('Effective Date')")],
|
'header': [1, 13, 'text', _render("_('Effective Date')")],
|
||||||
'lines': [1, 0, 'date', _render("datetime.strptime(line.date,'%Y-%m-%d')"), None, self.aml_cell_style_date],
|
'lines': [1, 0, 'date', _render("datetime.strptime(line.date,'%Y-%m-%d')"), None, self.aml_cell_style_date],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'period':{
|
'period': {
|
||||||
'header': [1, 12, 'text', _render("_('Period')")],
|
'header': [1, 12, 'text', _render("_('Period')")],
|
||||||
'lines': [1, 0, 'text', _render("line.period_id.code or line.period_id.name")],
|
'lines': [1, 0, 'text', _render("line.period_id.code or line.period_id.name")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'partner':{
|
'partner': {
|
||||||
'header': [1, 36, 'text', _render("_('Partner')")],
|
'header': [1, 36, 'text', _render("_('Partner')")],
|
||||||
'lines': [1, 0, 'text', _render("line.partner_id and line.partner_id.name or ''")],
|
'lines': [1, 0, 'text', _render("line.partner_id and line.partner_id.name or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'partner_ref':{
|
'partner_ref': {
|
||||||
'header': [1, 36, 'text', _render("_('Partner Reference')")],
|
'header': [1, 36, 'text', _render("_('Partner Reference')")],
|
||||||
'lines': [1, 0, 'text', _render("line.partner_id and line.partner_id.ref or ''")],
|
'lines': [1, 0, 'text', _render("line.partner_id and line.partner_id.ref or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'account':{
|
'account': {
|
||||||
'header': [1, 12, 'text', _render("_('Account')")],
|
'header': [1, 12, 'text', _render("_('Account')")],
|
||||||
'lines': [1, 0, 'text', _render("line.account_id.code")],
|
'lines': [1, 0, 'text', _render("line.account_id.code")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'date_maturity':{
|
'date_maturity': {
|
||||||
'header': [1, 13, 'text', _render("_('Maturity Date')")],
|
'header': [1, 13, 'text', _render("_('Maturity Date')")],
|
||||||
'lines': [1, 0, _render("line.date_maturity.val and 'date' or 'text'"),
|
'lines': [1, 0, _render("line.date_maturity.val and 'date' or 'text'"),
|
||||||
_render("line.date_maturity.val and datetime.strptime(line.date_maturity,'%Y-%m-%d') or None"),
|
_render("line.date_maturity.val and datetime.strptime(line.date_maturity,'%Y-%m-%d') or None"),
|
||||||
None, self.aml_cell_style_date],
|
None, self.aml_cell_style_date],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'debit':{
|
'debit': {
|
||||||
'header': [1, 18, 'text', _render("_('Debit')"), None, self.rh_cell_style_right],
|
'header': [1, 18, 'text', _render("_('Debit')"), None, self.rh_cell_style_right],
|
||||||
'lines': [1, 0, 'number', _render("line.debit"), None, self.aml_cell_style_decimal],
|
'lines': [1, 0, 'number', _render("line.debit"), None, self.aml_cell_style_decimal],
|
||||||
'totals': [1, 0, 'number', None, _render("debit_formula"), self.rt_cell_style_decimal]},
|
'totals': [1, 0, 'number', None, _render("debit_formula"), self.rt_cell_style_decimal]},
|
||||||
'credit':{
|
'credit': {
|
||||||
'header': [1, 18, 'text', _render("_('Credit')"), None, self.rh_cell_style_right],
|
'header': [1, 18, 'text', _render("_('Credit')"), None, self.rh_cell_style_right],
|
||||||
'lines': [1, 0, 'number', _render("line.credit"), None, self.aml_cell_style_decimal],
|
'lines': [1, 0, 'number', _render("line.credit"), None, self.aml_cell_style_decimal],
|
||||||
'totals': [1, 0, 'number', None, _render("credit_formula"), self.rt_cell_style_decimal]},
|
'totals': [1, 0, 'number', None, _render("credit_formula"), self.rt_cell_style_decimal]},
|
||||||
'balance':{
|
'balance': {
|
||||||
'header': [1, 18, 'text', _render("_('Balance')"), None, self.rh_cell_style_right],
|
'header': [1, 18, 'text', _render("_('Balance')"), None, self.rh_cell_style_right],
|
||||||
'lines': [1, 0, 'number', None, _render("bal_formula"), self.aml_cell_style_decimal],
|
'lines': [1, 0, 'number', None, _render("bal_formula"), self.aml_cell_style_decimal],
|
||||||
'totals': [1, 0, 'number', None, _render("bal_formula"), self.rt_cell_style_decimal]},
|
'totals': [1, 0, 'number', None, _render("bal_formula"), self.rt_cell_style_decimal]},
|
||||||
'reconcile':{
|
'reconcile': {
|
||||||
'header': [1, 12, 'text', _render("_('Rec.')"), None, self.rh_cell_style_center],
|
'header': [1, 12, 'text', _render("_('Rec.')"), None, self.rh_cell_style_center],
|
||||||
'lines': [1, 0, 'text', _render("line.reconcile_id.name or ''"), None, self.aml_cell_style_center],
|
'lines': [1, 0, 'text', _render("line.reconcile_id.name or ''"), None, self.aml_cell_style_center],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'reconcile_partial':{
|
'reconcile_partial': {
|
||||||
'header': [1, 12, 'text', _render("_('Part. Rec.')"), None, self.rh_cell_style_center],
|
'header': [1, 12, 'text', _render("_('Part. Rec.')"), None, self.rh_cell_style_center],
|
||||||
'lines': [1, 0, 'text', _render("line.reconcile_partial_id.name or ''"), None, self.aml_cell_style_center],
|
'lines': [1, 0, 'text', _render("line.reconcile_partial_id.name or ''"), None, self.aml_cell_style_center],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'tax_code':{
|
'tax_code': {
|
||||||
'header': [1, 12, 'text', _render("_('Tax Code')"), None, self.rh_cell_style_center],
|
'header': [1, 12, 'text', _render("_('Tax Code')"), None, self.rh_cell_style_center],
|
||||||
'lines': [1, 0, 'text', _render("line.tax_code_id.code or ''"), None, self.aml_cell_style_center],
|
'lines': [1, 0, 'text', _render("line.tax_code_id.code or ''"), None, self.aml_cell_style_center],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'tax_amount':{
|
'tax_amount': {
|
||||||
'header': [1, 18, 'text', _render("_('Tax/Base Amount')"), None, self.rh_cell_style_right],
|
'header': [1, 18, 'text', _render("_('Tax/Base Amount')"), None, self.rh_cell_style_right],
|
||||||
'lines': [1, 0, 'number', _render("line.tax_amount"), None, self.aml_cell_style_decimal],
|
'lines': [1, 0, 'number', _render("line.tax_amount"), None, self.aml_cell_style_decimal],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'amount_currency':{
|
'amount_currency': {
|
||||||
'header': [1, 18, 'text', _render("_('Am. Currency')"), None, self.rh_cell_style_right],
|
'header': [1, 18, 'text', _render("_('Am. Currency')"), None, self.rh_cell_style_right],
|
||||||
'lines': [1, 0, _render("line.amount_currency and 'number' or 'text'"),
|
'lines': [1, 0, _render("line.amount_currency and 'number' or 'text'"),
|
||||||
_render("line.amount_currency or None"),
|
_render("line.amount_currency or None"),
|
||||||
None, self.aml_cell_style_decimal],
|
None, self.aml_cell_style_decimal],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'currency_name':{
|
'currency_name': {
|
||||||
'header': [1, 6, 'text', _render("_('Curr.')"), None, self.rh_cell_style_center],
|
'header': [1, 6, 'text', _render("_('Curr.')"), None, self.rh_cell_style_center],
|
||||||
'lines': [1, 0, 'text', _render("line.currency_id and line.currency_id.name or ''"), None, self.aml_cell_style_center],
|
'lines': [1, 0, 'text', _render("line.currency_id and line.currency_id.name or ''"), None, self.aml_cell_style_center],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'journal': {
|
'journal': {
|
||||||
'header': [1, 6, 'text', _('Journal')],
|
'header': [1, 12, 'text', _render("_('Journal')")],
|
||||||
'lines': [1, 0, 'text', _render("line.journal_id.code or ''")],
|
'lines': [1, 0, 'text', _render("line.journal_id.code or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'company_currency': {
|
'company_currency': {
|
||||||
'header': [1, 6, 'text', _('Company currency')],
|
'header': [1, 10, 'text', _render("_('Comp. Curr.')")],
|
||||||
'lines': [1, 0, 'text', _render("line.company_id.currency_id.name or ''")],
|
'lines': [1, 0, 'text', _render("line.company_id.currency_id.name or ''"), None, self.aml_cell_style_center],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
'analytic_account': {
|
'analytic_account': {
|
||||||
'header': [1, 6, 'text', _('Analytic Account')],
|
'header': [1, 36, 'text', _render("_('Analytic Account')")],
|
||||||
'lines': [1, 0, 'text', _render("line.analytic_account_id.code or ''")],
|
'lines': [1, 0, 'text', _render("line.analytic_account_id.code or ''")],
|
||||||
'totals': [1, 0, 'text', None]},
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'product': {
|
||||||
|
'header': [1, 36, 'text', _render("_('Product')")],
|
||||||
|
'lines': [1, 0, 'text', _render("line.product_id.name or ''")],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'product_ref': {
|
||||||
|
'header': [1, 36, 'text', _render("_('Product Reference')")],
|
||||||
|
'lines': [1, 0, 'text', _render("line.product_id.default_code or ''")],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'product_uom': {
|
||||||
|
'header': [1, 20, 'text', _render("_('Unit of Measure')")],
|
||||||
|
'lines': [1, 0, 'text', _render("line.product_uom_id.name or ''")],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'quantity': {
|
||||||
|
'header': [1, 8, 'text', _render("_('Qty')"), None, self.rh_cell_style_right],
|
||||||
|
'lines': [1, 0, _render("line.quantity and 'number' or 'text'"),
|
||||||
|
_render("line.quantity or None"), None, self.aml_cell_style_decimal],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'statement': {
|
||||||
|
'header': [1, 20, 'text', _render("_('Statement')")],
|
||||||
|
'lines': [1, 0, 'text', _render("line.statement_id and line.statement_id.name or ''")],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'invoice': {
|
||||||
|
'header': [1, 20, 'text', _render("_('Invoice')")],
|
||||||
|
'lines': [1, 0, 'text', _render("line.invoice and line.invoice.number or ''")],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'amount_residual': {
|
||||||
|
'header': [1, 18, 'text', _render("_('Residual Amount')"), None, self.rh_cell_style_right],
|
||||||
|
'lines': [1, 0, _render("line.amount_residual and 'number' or 'text'"),
|
||||||
|
_render("line.amount_residual or None"),
|
||||||
|
None, self.aml_cell_style_decimal],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'amount_residual_currency': {
|
||||||
|
'header': [1, 18, 'text', _render("_('Res. Am. in Curr.')"), None, self.rh_cell_style_right],
|
||||||
|
'lines': [1, 0, _render("line.amount_residual_currency and 'number' or 'text'"),
|
||||||
|
_render("line.amount_residual_currency or None"),
|
||||||
|
None, self.aml_cell_style_decimal],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'narration': {
|
||||||
|
'header': [1, 42, 'text', _render("_('Notes')")],
|
||||||
|
'lines': [1, 0, 'text', _render("line.move_id.narration or ''")],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
|
'blocked': {
|
||||||
|
'header': [1, 4, 'text', _('Lit.'), None, self.rh_cell_style_right],
|
||||||
|
'lines': [1, 0, 'text', _render("line.blocked and 'x' or ''"), None, self.aml_cell_style_center],
|
||||||
|
'totals': [1, 0, 'text', None]},
|
||||||
}
|
}
|
||||||
|
|
||||||
def generate_xls_report(self, _p, _xs, data, objects, wb):
|
def generate_xls_report(self, _p, _xs, data, objects, wb):
|
||||||
|
|
||||||
wanted_list = _p.wanted_list
|
wanted_list = _p.wanted_list
|
||||||
|
@ -178,18 +225,18 @@ class move_line_xls(report_xls):
|
||||||
debit_pos = 'debit' in wanted_list and wanted_list.index('debit')
|
debit_pos = 'debit' in wanted_list and wanted_list.index('debit')
|
||||||
credit_pos = 'credit' in wanted_list and wanted_list.index('credit')
|
credit_pos = 'credit' in wanted_list and wanted_list.index('credit')
|
||||||
if not (credit_pos and debit_pos) and 'balance' in wanted_list:
|
if not (credit_pos and debit_pos) and 'balance' in wanted_list:
|
||||||
raise orm.except_orm(_('Customisation Error!'),
|
raise orm.except_orm(_('Customisation Error!'),
|
||||||
_("The 'Balance' field is a calculated XLS field requiring the presence of the 'Debit' and 'Credit' fields !"))
|
_("The 'Balance' field is a calculated XLS field requiring the presence of the 'Debit' and 'Credit' fields !"))
|
||||||
|
|
||||||
#report_name = objects[0]._description or objects[0]._name
|
#report_name = objects[0]._description or objects[0]._name
|
||||||
report_name = _("Journal Items")
|
report_name = _("Journal Items")
|
||||||
ws = wb.add_sheet(report_name[:31])
|
ws = wb.add_sheet(report_name[:31])
|
||||||
ws.panes_frozen = True
|
ws.panes_frozen = True
|
||||||
ws.remove_splits = True
|
ws.remove_splits = True
|
||||||
ws.portrait = 0 # Landscape
|
ws.portrait = 0 # Landscape
|
||||||
ws.fit_width_to_pages = 1
|
ws.fit_width_to_pages = 1
|
||||||
row_pos = 0
|
row_pos = 0
|
||||||
|
|
||||||
# set print header/footer
|
# set print header/footer
|
||||||
ws.header_str = self.xls_headers['standard']
|
ws.header_str = self.xls_headers['standard']
|
||||||
ws.footer_str = self.xls_footers['standard']
|
ws.footer_str = self.xls_footers['standard']
|
||||||
|
@ -198,7 +245,7 @@ class move_line_xls(report_xls):
|
||||||
cell_style = xlwt.easyxf(_xs['xls_title'])
|
cell_style = xlwt.easyxf(_xs['xls_title'])
|
||||||
c_specs = [
|
c_specs = [
|
||||||
('report_name', 1, 0, 'text', report_name),
|
('report_name', 1, 0, 'text', report_name),
|
||||||
]
|
]
|
||||||
row_data = self.xls_row_template(c_specs, ['report_name'])
|
row_data = self.xls_row_template(c_specs, ['report_name'])
|
||||||
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=cell_style)
|
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=cell_style)
|
||||||
row_pos += 1
|
row_pos += 1
|
||||||
|
@ -206,9 +253,9 @@ class move_line_xls(report_xls):
|
||||||
# Column headers
|
# Column headers
|
||||||
c_specs = map(lambda x: self.render(x, self.col_specs_template, 'header', render_space={'_': _p._}), wanted_list)
|
c_specs = map(lambda x: self.render(x, self.col_specs_template, 'header', render_space={'_': _p._}), wanted_list)
|
||||||
row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs])
|
row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs])
|
||||||
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=self.rh_cell_style, set_column_size=True)
|
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=self.rh_cell_style, set_column_size=True)
|
||||||
ws.set_horz_split_pos(row_pos)
|
ws.set_horz_split_pos(row_pos)
|
||||||
|
|
||||||
# account move lines
|
# account move lines
|
||||||
for line in objects:
|
for line in objects:
|
||||||
debit_cell = rowcol_to_cell(row_pos, debit_pos)
|
debit_cell = rowcol_to_cell(row_pos, debit_pos)
|
||||||
|
@ -218,23 +265,23 @@ class move_line_xls(report_xls):
|
||||||
row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs])
|
row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs])
|
||||||
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=self.aml_cell_style)
|
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=self.aml_cell_style)
|
||||||
|
|
||||||
# Totals
|
# Totals
|
||||||
aml_cnt = len(objects)
|
aml_cnt = len(objects)
|
||||||
debit_start = rowcol_to_cell(row_pos - aml_cnt, debit_pos)
|
debit_start = rowcol_to_cell(row_pos - aml_cnt, debit_pos)
|
||||||
debit_stop = rowcol_to_cell(row_pos - 1, debit_pos)
|
debit_stop = rowcol_to_cell(row_pos - 1, debit_pos)
|
||||||
debit_formula = 'SUM(%s:%s)' %(debit_start, debit_stop)
|
debit_formula = 'SUM(%s:%s)' % (debit_start, debit_stop)
|
||||||
credit_start = rowcol_to_cell(row_pos - aml_cnt, credit_pos)
|
credit_start = rowcol_to_cell(row_pos - aml_cnt, credit_pos)
|
||||||
credit_stop = rowcol_to_cell(row_pos - 1, credit_pos)
|
credit_stop = rowcol_to_cell(row_pos - 1, credit_pos)
|
||||||
credit_formula = 'SUM(%s:%s)' %(credit_start, credit_stop)
|
credit_formula = 'SUM(%s:%s)' % (credit_start, credit_stop)
|
||||||
debit_cell = rowcol_to_cell(row_pos, debit_pos)
|
debit_cell = rowcol_to_cell(row_pos, debit_pos)
|
||||||
credit_cell = rowcol_to_cell(row_pos, credit_pos)
|
credit_cell = rowcol_to_cell(row_pos, credit_pos)
|
||||||
bal_formula = debit_cell + '-' + credit_cell
|
bal_formula = debit_cell + '-' + credit_cell
|
||||||
c_specs = map(lambda x: self.render(x, self.col_specs_template, 'totals'), wanted_list)
|
c_specs = map(lambda x: self.render(x, self.col_specs_template, 'totals'), wanted_list)
|
||||||
row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs])
|
row_data = self.xls_row_template(c_specs, [x[0] for x in c_specs])
|
||||||
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=self.rt_cell_style_right)
|
row_pos = self.xls_write_row(ws, row_pos, row_data, row_style=self.rt_cell_style_right)
|
||||||
|
|
||||||
move_line_xls('report.move.line.list.xls',
|
move_line_xls('report.move.line.list.xls',
|
||||||
'account.move.line',
|
'account.move.line',
|
||||||
parser=move_line_xls_parser)
|
parser=move_line_xls_parser)
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
Loading…
Reference in New Issue