From 3f2bfde964059c608f5c6b6be6c5a9814c76898f Mon Sep 17 00:00:00 2001 From: odoomates Date: Fri, 31 Mar 2023 08:00:14 +0300 Subject: [PATCH] [IMP] accounting_pdf_reports: partner filter in partner ledger --- accounting_pdf_reports/__manifest__.py | 2 +- accounting_pdf_reports/report/report_partner_ledger.py | 6 +++++- accounting_pdf_reports/wizard/account_partner_ledger.py | 2 ++ accounting_pdf_reports/wizard/partner_ledger.xml | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/accounting_pdf_reports/__manifest__.py b/accounting_pdf_reports/__manifest__.py index 7adda4a9..6b8dd4a0 100644 --- a/accounting_pdf_reports/__manifest__.py +++ b/accounting_pdf_reports/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Odoo 14 Accounting Financial Reports', - 'version': '14.0.5.2.0', + 'version': '14.0.6.0.0', 'category': 'Invoicing Management', 'description': 'Accounting Reports For Odoo 14, Accounting Financial Reports,' ' Odoo 14 Financial Reports', diff --git a/accounting_pdf_reports/report/report_partner_ledger.py b/accounting_pdf_reports/report/report_partner_ledger.py index ac41d6a1..7407e7f1 100644 --- a/accounting_pdf_reports/report/report_partner_ledger.py +++ b/accounting_pdf_reports/report/report_partner_ledger.py @@ -106,7 +106,11 @@ def _get_report_values(self, docids, data=None): AND NOT account.deprecated AND """ + query_get_data[1] + reconcile_clause self.env.cr.execute(query, tuple(params)) - partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()] + if data['form']['partner_ids']: + partner_ids = data['form']['partner_ids'] + else: + partner_ids = [res['partner_id'] for res in + self.env.cr.dictfetchall()] partners = obj_partner.browse(partner_ids) partners = sorted(partners, key=lambda x: (x.ref or '', x.name or '')) diff --git a/accounting_pdf_reports/wizard/account_partner_ledger.py b/accounting_pdf_reports/wizard/account_partner_ledger.py index 4112efc5..147e5fca 100644 --- a/accounting_pdf_reports/wizard/account_partner_ledger.py +++ b/accounting_pdf_reports/wizard/account_partner_ledger.py @@ -12,10 +12,12 @@ class AccountPartnerLedger(models.TransientModel): help="It adds the currency column on report if the " "currency differs from the company currency.") reconciled = fields.Boolean('Reconciled Entries') + partner_ids = fields.Many2many('res.partner', string='Partners') def _get_report_data(self, data): data = self.pre_print_report(data) data['form'].update({'reconciled': self.reconciled, + 'partner_ids': self.partner_ids.ids, 'amount_currency': self.amount_currency}) return data diff --git a/accounting_pdf_reports/wizard/partner_ledger.xml b/accounting_pdf_reports/wizard/partner_ledger.xml index b90f4598..711b5c41 100644 --- a/accounting_pdf_reports/wizard/partner_ledger.xml +++ b/accounting_pdf_reports/wizard/partner_ledger.xml @@ -6,6 +6,9 @@ account.report.partner.ledger + + +