diff --git a/account_financial_report_qweb/report/general_ledger.py b/account_financial_report_qweb/report/general_ledger.py
index 82db22bf..2f7bfd27 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/general_ledger_xlsx.py b/account_financial_report_qweb/report/general_ledger_xlsx.py
index c1810359..dc50a2c3 100644
--- a/account_financial_report_qweb/report/general_ledger_xlsx.py
+++ b/account_financial_report_qweb/report/general_ledger_xlsx.py
@@ -38,8 +38,7 @@ class GeneralLedgerXslx(abstract_report_xlsx.AbstractReportXslx):
'field': 'tags',
'width': 10},
9: {'header': _('Rec.'),
- 'field': 'matched_ml_id',
- 'type': 'many2one',
+ 'field': 'reconcile_string',
'width': 5},
10: {'header': _('Debit'),
'field': 'debit',
diff --git a/account_financial_report_qweb/report/open_items.py b/account_financial_report_qweb/report/open_items.py
index d939958c..658ad111 100644
--- a/account_financial_report_qweb/report/open_items.py
+++ b/account_financial_report_qweb/report/open_items.py
@@ -28,7 +28,7 @@ class OpenItemsReport(models.TransientModel):
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')
-
+ show_reconciliations = fields.Boolean()
# Data fields, used to browse report data
account_ids = fields.One2many(
comodel_name='report_open_items_qweb_account',
@@ -129,6 +129,14 @@ class OpenItemsReportMoveLine(models.TransientModel):
# Data fields, used to keep link with real object
move_line_id = fields.Many2one('account.move.line')
+ # 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')
+
# Data fields, used for report display
date = fields.Date()
date_due = fields.Date()
@@ -143,6 +151,20 @@ class OpenItemsReportMoveLine(models.TransientModel):
amount_total_due_currency = fields.Float(digits=(16, 2))
amount_residual_currency = fields.Float(digits=(16, 2))
+ 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 OpenItemsReportCompute(models.TransientModel):
""" Here, we just define methods.
diff --git a/account_financial_report_qweb/report/open_items_xlsx.py b/account_financial_report_qweb/report/open_items_xlsx.py
index 58343068..0d1d3222 100644
--- a/account_financial_report_qweb/report/open_items_xlsx.py
+++ b/account_financial_report_qweb/report/open_items_xlsx.py
@@ -27,12 +27,13 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx):
3: {'header': _('Account'), 'field': 'account', 'width': 9},
4: {'header': _('Partner'), 'field': 'partner', 'width': 25},
5: {'header': _('Ref - Label'), 'field': 'label', 'width': 40},
- 6: {'header': _('Due date'), 'field': 'date_due', 'width': 11},
- 7: {'header': _('Original'),
+ 6: {'header': _('Rec.'), 'field': 'reconcile_string', 'width': 11},
+ 7: {'header': _('Due date'), 'field': 'date_due', 'width': 11},
+ 8: {'header': _('Original'),
'field': 'amount_total_due',
'type': 'amount',
'width': 14},
- 8: {'header': _('Residual'),
+ 9: {'header': _('Residual'),
'field': 'amount_residual',
'field_final_balance': 'final_amount_residual',
'type': 'amount',
@@ -40,15 +41,15 @@ class OpenItemsXslx(abstract_report_xlsx.AbstractReportXslx):
}
if report.foreign_currency:
foreign_currency = {
- 9: {'header': _('Cur.'), 'field': 'currency_id',
- 'field_currency_balance': 'currency_id',
- 'type': 'many2one', 'width': 7},
- 10: {'header': _('Cur. Original'),
+ 10: {'header': _('Cur.'), 'field': 'currency_id',
+ 'field_currency_balance': 'currency_id',
+ 'type': 'many2one', 'width': 7},
+ 11: {'header': _('Cur. Original'),
'field': 'amount_total_due_currency',
'field_final_balance': 'final_amount_total_due_currency',
'type': 'amount_currency',
'width': 14},
- 11: {'header': _('Cur. Residual'),
+ 12: {'header': _('Cur. Residual'),
'field': 'amount_residual_currency',
'field_final_balance': 'final_amount_residual_currency',
'type': 'amount_currency',
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">