You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.7 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2009-2018 Noviat.
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from odoo import api, models
  5. import logging
  6. _logger = logging.getLogger(__name__)
  7. try:
  8. from odoo.addons.report_xlsx_helper.report.abstract_report_xlsx \
  9. import AbstractReportXlsx
  10. _render = AbstractReportXlsx._render
  11. except (ImportError, IOError) as err:
  12. _logger.debug(err)
  13. class AccountMoveLine(models.Model):
  14. _inherit = 'account.move.line'
  15. # Change list in custom module e.g. to add/drop columns or change order
  16. @api.model
  17. def _report_xlsx_fields(self):
  18. return [
  19. 'move', 'name', 'date', 'journal', 'partner', 'account',
  20. 'date_maturity', 'debit', 'credit', 'balance',
  21. 'full_reconcile', 'reconcile_amount',
  22. # 'analytic_account_name', 'analytic_account',
  23. # 'ref', 'partner_ref',
  24. # 'amount_residual', 'amount_currency', 'currency_name',
  25. # 'company_currency', 'amount_residual_currency',
  26. # 'product', 'product_ref', 'product_uom', 'quantity',
  27. # 'statement', 'invoice', 'narration', 'blocked',
  28. # 'id', 'matched_debit_ids', 'matched_credit_ids',
  29. ]
  30. # Change/Add Template entries
  31. @api.model
  32. def _report_xlsx_template(self):
  33. """
  34. Template updates, e.g.
  35. my_change = {
  36. 'move': {
  37. 'header': {
  38. 'value': 'My Move Title',
  39. },
  40. 'lines': {
  41. 'value': _render("line.move_id.name or ''"),
  42. },
  43. 'width': 20,
  44. },
  45. }
  46. return my_change
  47. """
  48. return {}