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.

37 lines
1.2 KiB

  1. # Copyright 2017-2020 Akretion France (http://www.akretion.com/)
  2. # @author: Alexis de Lattre <alexis.delattre@akretion.com>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from odoo import api, fields, models
  5. class BankReconciliationReportWizard(models.TransientModel):
  6. _name = "bank.reconciliation.report.wizard"
  7. _description = "Bank Reconciliation Report Wizard"
  8. @api.model
  9. def _default_journal_ids(self):
  10. journals = self.env["account.journal"].search(
  11. [
  12. ("type", "=", "bank"),
  13. ("bank_account_id", "!=", False),
  14. ("company_id", "=", self.env.user.company_id.id),
  15. ]
  16. )
  17. return journals
  18. date = fields.Date(required=True, default=fields.Date.context_today)
  19. journal_ids = fields.Many2many(
  20. "account.journal",
  21. string="Bank Journals",
  22. domain=[("type", "=", "bank")],
  23. required=True,
  24. default=lambda self: self._default_journal_ids(),
  25. )
  26. def open_xlsx(self):
  27. report = self.env.ref(
  28. "account_bank_reconciliation_summary_xlsx." "bank_reconciliation_xlsx"
  29. )
  30. action = report.report_action(self)
  31. return action