|
@ -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 |
|
@ -34,6 +34,7 @@ _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): |
|
@ -53,6 +54,7 @@ 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): |
|
@ -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], |
|
|
'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')], |
|
|
|
|
|
'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]}, |
|
|
'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): |
|
|