diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py index 83dee086..6290d0ef 100644 --- a/account_financial_report_qweb/report/general_ledger.py +++ b/account_financial_report_qweb/report/general_ledger.py @@ -32,6 +32,7 @@ class GeneralLedgerReport(models.TransientModel): hide_account_at_0 = fields.Boolean() foreign_currency = fields.Boolean() show_analytic_tags = fields.Boolean() + show_partial_reconciliations = fields.Boolean() company_id = fields.Many2one(comodel_name='res.company') filter_account_ids = fields.Many2many(comodel_name='account.account') filter_partner_ids = fields.Many2many(comodel_name='res.partner') @@ -204,6 +205,28 @@ class GeneralLedgerReportMoveLine(models.TransientModel): currency_id = fields.Many2one(comodel_name='res.currency') amount_currency = fields.Float(digits=(16, 2)) + # Display full or partial reconciliations + reconcile_string = fields.Char( + compute='_compute_reconcile', string='Reconcile') + partial_reconcile_ids = fields.Many2many( + comodel_name='account.partial.reconcile', + compute='_compute_reconcile', + string='Reconciliation move lines') + + def _compute_reconcile(self): + for line in self: + ml = line.move_line_id + partial_recs = self.env['account.partial.reconcile'] + if ml.full_reconcile_id: + rec_str = ml.full_reconcile_id.name + else: + rec_str = ', '.join([ + 'a%d' % pr.id for pr in + ml.matched_debit_ids + ml.matched_credit_ids]) + partial_recs = ml.matched_debit_ids + ml.matched_credit_ids + line.reconcile_string = rec_str + line.partial_reconcile_ids = partial_recs + class GeneralLedgerReportCompute(models.TransientModel): """ Here, we just define methods. diff --git a/account_financial_report_qweb/report/templates/general_ledger.xml b/account_financial_report_qweb/report/templates/general_ledger.xml index a8e5ecdf..c4c47a13 100644 --- a/account_financial_report_qweb/report/templates/general_ledger.xml +++ b/account_financial_report_qweb/report/templates/general_ledger.xml @@ -410,6 +410,15 @@ class="o_account_financial_reports_web_action underline-on-hover"> + + + +
diff --git a/account_financial_report_qweb/wizard/general_ledger_wizard.py b/account_financial_report_qweb/wizard/general_ledger_wizard.py index b8a5476e..32fc16c5 100644 --- a/account_financial_report_qweb/wizard/general_ledger_wizard.py +++ b/account_financial_report_qweb/wizard/general_ledger_wizard.py @@ -85,6 +85,9 @@ class GeneralLedgerReportWizard(models.TransientModel): comodel_name='account.analytic.tag', string='Filter accounts', ) + show_partial_reconciliations = fields.Boolean( + string='Display partial reconciliations', + ) def _default_foreign_currency(self): if self.env.user.has_group('base.group_multi_currency'): @@ -267,6 +270,7 @@ class GeneralLedgerReportWizard(models.TransientModel): 'filter_analytic_tag_ids': [(6, 0, self.analytic_tag_ids.ids)], 'centralize': self.centralize, 'fy_start_date': self.fy_start_date, + 'show_partial_reconciliations': self.show_partial_reconciliations, } def _export(self, report_type): diff --git a/account_financial_report_qweb/wizard/general_ledger_wizard_view.xml b/account_financial_report_qweb/wizard/general_ledger_wizard_view.xml index 4d799f81..ebe52a33 100644 --- a/account_financial_report_qweb/wizard/general_ledger_wizard_view.xml +++ b/account_financial_report_qweb/wizard/general_ledger_wizard_view.xml @@ -25,6 +25,7 @@ +