update account_move_line_report_xls
parent
222cb74cf8
commit
e322a7fa50
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# 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
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
@ -20,10 +20,5 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
try:
|
||||
from . import account_move_line
|
||||
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
|
||||
#
|
||||
# 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
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
@ -22,25 +22,53 @@
|
|||
|
||||
{
|
||||
'name': 'Account Move Line XLS export',
|
||||
'version': '0.5',
|
||||
'version': '0.6',
|
||||
'license': 'AGPL-3',
|
||||
'author': 'Noviat',
|
||||
'category': 'Accounting & Finance',
|
||||
'description': """
|
||||
|
||||
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:
|
||||
https://launchpad.net/openerp-reporting-engines"
|
||||
If you are installing this module manually, you need also the **report_xls**
|
||||
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'],
|
||||
'demo_xml': [],
|
||||
'init_xml': [],
|
||||
'update_xml' : [
|
||||
'data': [
|
||||
'report/move_line_list_xls.xml',
|
||||
],
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# 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
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
@ -24,15 +24,21 @@ from openerp.osv import orm
|
|||
from openerp.addons.report_xls.utils import rowcol_to_cell, _render
|
||||
from openerp.tools.translate import _
|
||||
|
||||
|
||||
class account_move_line(orm.Model):
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
# override list in custom module to add/drop columns or change order
|
||||
def _report_xls_fields(self, cr, uid, context=None):
|
||||
return [
|
||||
'move', 'name', 'date', 'period', 'partner', 'account',
|
||||
'date_maturity', 'debit', 'credit', 'balance', 'reconcile', 'reconcile_partial',
|
||||
#'amount_currency', 'currency_name',
|
||||
'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',
|
||||
]
|
||||
|
||||
# Change/Add Template entries
|
||||
|
@ -49,4 +55,3 @@ class account_move_line(orm.Model):
|
|||
return my_change
|
||||
"""
|
||||
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:
|
||||
# * account_move_line_report_xls
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.1\n"
|
||||
"Report-Msgid-Bugs-To: support@noviat.be\n"
|
||||
"POT-Creation-Date: 2013-11-23 16:11:12.706000\n"
|
||||
"PO-Revision-Date: 2013-11-23 16:11:12.706000\n"
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: support@noviat.com\n"
|
||||
"POT-Creation-Date: 2014-01-08 23:46:06.568000\n"
|
||||
"PO-Revision-Date: 2014-01-08 23:46:06.568000\n"
|
||||
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -109,3 +109,68 @@ msgstr "Montant devise"
|
|||
msgid "Curr."
|
||||
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:
|
||||
# * account_move_line_report_xls
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 6.1\n"
|
||||
"Report-Msgid-Bugs-To: support@noviat.be\n"
|
||||
"POT-Creation-Date: 2013-11-23 16:11:12.702000\n"
|
||||
"PO-Revision-Date: 2013-11-23 16:11:12.702000\n"
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: support@noviat.com\n"
|
||||
"POT-Creation-Date: 2014-01-08 23:46:06.564000\n"
|
||||
"PO-Revision-Date: 2014-01-08 23:46:06.564000\n"
|
||||
"Last-Translator: Luc De Meyer (Noviat nv/sa)\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -109,3 +109,68 @@ msgstr "Bedrag valuta"
|
|||
msgid "Curr."
|
||||
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
|
||||
#
|
||||
# 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
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# 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
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
|
@ -34,6 +34,7 @@ _logger = logging.getLogger(__name__)
|
|||
|
||||
_ir_translation_name = 'move.line.list.xls'
|
||||
|
||||
|
||||
class move_line_xls_parser(report_sxw.rml_parse):
|
||||
|
||||
def __init__(self, cr, uid, name, context):
|
||||
|
@ -53,6 +54,7 @@ class move_line_xls_parser(report_sxw.rml_parse):
|
|||
lang = self.context.get('lang', 'en_US')
|
||||
return translate(self.cr, _ir_translation_name, 'report', lang, src) or src
|
||||
|
||||
|
||||
class move_line_xls(report_xls):
|
||||
|
||||
def __init__(self, name, table, rml=False, parser=False, header=True, store=False):
|
||||
|
@ -156,17 +158,62 @@ class move_line_xls(report_xls):
|
|||
'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]},
|
||||
'journal': {
|
||||
'header': [1, 6, 'text', _('Journal')],
|
||||
'header': [1, 12, 'text', _render("_('Journal')")],
|
||||
'lines': [1, 0, 'text', _render("line.journal_id.code or ''")],
|
||||
'totals': [1, 0, 'text', None]},
|
||||
'company_currency': {
|
||||
'header': [1, 6, 'text', _('Company currency')],
|
||||
'lines': [1, 0, 'text', _render("line.company_id.currency_id.name or ''")],
|
||||
'header': [1, 10, 'text', _render("_('Comp. Curr.')")],
|
||||
'lines': [1, 0, 'text', _render("line.company_id.currency_id.name or ''"), None, self.aml_cell_style_center],
|
||||
'totals': [1, 0, 'text', None]},
|
||||
'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 ''")],
|
||||
'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):
|
||||
|
|
Loading…
Reference in New Issue