From 0624e3329d5be4ce76ab5c79945c3c42d675153b Mon Sep 17 00:00:00 2001 From: git_admin Date: Fri, 1 May 2026 14:26:34 +0000 Subject: [PATCH] Tower: upload base_accounting_kit 19.0.2.3.1 (via marketplace) --- .../wizard/account_common_partner_report.py | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 addons/base_accounting_kit/wizard/account_common_partner_report.py diff --git a/addons/base_accounting_kit/wizard/account_common_partner_report.py b/addons/base_accounting_kit/wizard/account_common_partner_report.py new file mode 100644 index 0000000..c3b96d3 --- /dev/null +++ b/addons/base_accounting_kit/wizard/account_common_partner_report.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models +from odoo.tools.misc import get_lang + + +class AccountingCommonPartnerReport(models.TransientModel): + _name = 'account.common.partner.report' + _inherit = "account.report" + _description = 'Account Common Partner Report' + + section_main_report_ids = fields.Many2many(string="Section Of", + comodel_name='account.report', + relation="account_common_parnter_report_section_rel", + column1="sub_report_id", + column2="main_report_id") + section_report_ids = fields.Many2many(string="Sections", + comodel_name='account.report', + relation="account_common_parnter_report_section_rel", + column1="main_report_id", + column2="sub_report_id") + company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, + default=lambda self: self.env.company) + journal_ids = fields.Many2many( + comodel_name='account.journal', + string='Journals', + required=True, + default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]), + domain="[('company_id', '=', company_id)]", + ) + date_from = fields.Date(string='Start Date') + date_to = fields.Date(string='End Date') + target_move = fields.Selection([('posted', 'All Posted Entries'), + ('all', 'All Entries'), + ], string='Target Moves', required=True, default='posted') + + result_selection = fields.Selection([('customer', 'Receivable Accounts'), + ('supplier', 'Payable Accounts'), + ('customer_supplier', + 'Receivable and Payable Accounts') + ], string="Partner's", required=True, + default='customer') + + def _build_contexts(self, data): + result = {} + result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][ + 'journal_ids'] or False + result['state'] = 'target_move' in data['form'] and data['form'][ + 'target_move'] or '' + result['date_from'] = data['form']['date_from'] or False + result['date_to'] = data['form']['date_to'] or False + result['strict_range'] = True if result['date_from'] else False + return result + + def check_report(self): + self.ensure_one() + data = {} + data['ids'] = self.env.context.get('active_ids', []) + data['model'] = self.env.context.get('active_model', 'ir.ui.menu') + data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0] + used_context = self._build_contexts(data) + data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code) + return self.with_context(discard_logo_check=True)._print_report(data) + + def _print_report(self, data): + data['form'].update(self.read( + ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp', + 'account_report_id', 'enable_filter', 'label_filter', + 'target_move'])[0]) + return self.env.ref( + 'base_accounting_kit.action_report_cash_flow').report_action(self, + data=data, + config=False) + + def pre_print_report(self, data): + data['form'].update(self.read(['result_selection'])[0]) + return data