Browse Source
Support bank reconciliation summary on date != today
Support bank reconciliation summary on date != today
Add wizard for that reportpull/322/head
Alexis de Lattre
7 years ago
10 changed files with 157 additions and 22 deletions
-
1account_bank_reconciliation_summary_xlsx/__init__.py
-
4account_bank_reconciliation_summary_xlsx/__manifest__.py
-
1account_bank_reconciliation_summary_xlsx/models/__init__.py
-
13account_bank_reconciliation_summary_xlsx/models/account_move_line.py
-
58account_bank_reconciliation_summary_xlsx/report/bank_reconciliation_xlsx.py
-
0account_bank_reconciliation_summary_xlsx/views/account_bank_statement.xml
-
22account_bank_reconciliation_summary_xlsx/views/account_move_line.xml
-
3account_bank_reconciliation_summary_xlsx/wizard/__init__.py
-
41account_bank_reconciliation_summary_xlsx/wizard/bank_reconciliation_report_wizard.py
-
36account_bank_reconciliation_summary_xlsx/wizard/bank_reconciliation_report_wizard_view.xml
@ -1,3 +1,4 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
|
|
||||
from . import account_bank_statement |
from . import account_bank_statement |
||||
|
from . import account_move_line |
@ -0,0 +1,13 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from odoo import fields, models |
||||
|
|
||||
|
|
||||
|
class AccountMoveLine(models.Model): |
||||
|
_inherit = 'account.move.line' |
||||
|
|
||||
|
statement_line_date = fields.Date( |
||||
|
string='Statement Line Date', |
||||
|
related='move_id.statement_line_id.date', store=True, readonly=True) |
@ -0,0 +1,22 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
|
||||
|
<record id="view_move_line_form" model="ir.ui.view"> |
||||
|
<field name="name">bank_rec_summarry.account_move_line_form</field> |
||||
|
<field name="model">account.move.line</field> |
||||
|
<field name="inherit_id" ref="account.view_move_line_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="statement_id" position="after"> |
||||
|
<field name="statement_line_date"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
|
||||
|
</odoo> |
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import bank_reconciliation_report_wizard |
@ -0,0 +1,41 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class BankReconciliationReportWizard(models.TransientModel): |
||||
|
_name = "bank.reconciliation.report.wizard" |
||||
|
_description = "Bank Reconciliation Report Wizard" |
||||
|
|
||||
|
@api.model |
||||
|
def _default_journal_ids(self): |
||||
|
journals = self.env['account.journal'].search([ |
||||
|
('type', '=', 'bank'), |
||||
|
('company_id', '=', self.env.user.company_id.id)]) |
||||
|
return journals |
||||
|
|
||||
|
company_id = fields.Many2one( |
||||
|
'res.company', string='Company', |
||||
|
default=lambda self: self.env.user.company_id) |
||||
|
date = fields.Date( |
||||
|
required=True, |
||||
|
default=fields.Date.context_today) |
||||
|
journal_ids = fields.Many2many( |
||||
|
'account.journal', string='Bank Journals', |
||||
|
domain=[('type', '=', 'bank')], required=True, |
||||
|
default=_default_journal_ids) |
||||
|
|
||||
|
def open_xlsx(self): |
||||
|
action = { |
||||
|
'type': 'ir.actions.report.xml', |
||||
|
'report_name': 'bank.reconciliation.xlsx', |
||||
|
'datas': { |
||||
|
'model': 'account.journal', |
||||
|
'ids': self.journal_ids.ids, |
||||
|
'date': self.date, |
||||
|
}, |
||||
|
'context': self._context, |
||||
|
} |
||||
|
return action |
@ -0,0 +1,36 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<!-- |
||||
|
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>) |
||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
--> |
||||
|
|
||||
|
<odoo> |
||||
|
|
||||
|
<record id="bank_reconciliation_report_wizard_form" model="ir.ui.view"> |
||||
|
<field name="name">bank.reconciliation.report.wizard.form</field> |
||||
|
<field name="model">bank.reconciliation.report.wizard</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Bank Reconciliation Report"> |
||||
|
<group name="main"> |
||||
|
<field name="company_id" groups="base.group_multi_company"/> |
||||
|
<field name="date"/> |
||||
|
<field name="journal_ids" widget="many2many_tags"/> |
||||
|
</group> |
||||
|
<footer> |
||||
|
<button name="open_xlsx" string="Export XLSX" type="object" class="btn-primary"/> |
||||
|
<button special="cancel" string="Cancel" class="oe_link"/> |
||||
|
</footer> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="bank_reconciliation_report_wizard_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Bank Reconciliation Report</field> |
||||
|
<field name="res_model">bank.reconciliation.report.wizard</field> |
||||
|
<field name="view_mode">form</field> |
||||
|
<field name="target">new</field> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem id="bank_reconciliation_report_wizard_menu" action="bank_reconciliation_report_wizard_action" parent="account.menu_finance_reports" groups="account.group_account_manager,account.group_account_user"/> |
||||
|
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue