diff --git a/account_partner_ledger_filter/README.rst b/account_partner_ledger_filter/README.rst new file mode 100644 index 000000000..ba326e22a --- /dev/null +++ b/account_partner_ledger_filter/README.rst @@ -0,0 +1,20 @@ +Partner Ledger Report with Partner Filter + +====================================== +Creates a partner ledger report by filtering partners + + +Installation +============ + - www.odoo.com/documentation/13.0/setup/install.html + - Install our custom addon + +Configuration +============= + + No additional configurations needed + +Credits +======= + Faslu ca v11 @ cybrosys, Contact: odoo@cybrosys.com + Afras Habis v13 @ cybrosys, Contact: odoo@cybrosys.com diff --git a/account_partner_ledger_filter/__init__.py b/account_partner_ledger_filter/__init__.py new file mode 100644 index 000000000..9d530e1ba --- /dev/null +++ b/account_partner_ledger_filter/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-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 . import wizard +from . import models diff --git a/account_partner_ledger_filter/__manifest__.py b/account_partner_ledger_filter/__manifest__.py new file mode 100644 index 000000000..f9b8d8a2a --- /dev/null +++ b/account_partner_ledger_filter/__manifest__.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-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 . +# +############################################################################# + +{ + 'name': 'Partner Ledger with Partner Filter', + 'version': '13.0.1.0.0', + 'summary': """Partner Ledger Report with Partner Filter""", + 'description': """Partner Ledger Report with Partner Filter""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'category': 'Accounting', + 'depends': ['base_accounting_kit'], + 'data': [ + 'views/report.xml', + 'wizard/account_report_general_ledger_view.xml' + ], + 'demo': [], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False +} diff --git a/account_partner_ledger_filter/doc/RELEASE_NOTES.md b/account_partner_ledger_filter/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..df5dd94e4 --- /dev/null +++ b/account_partner_ledger_filter/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 01.05.2020 +#### Version 13.0.1.0 +#### ADD +Initial Commit for account_partner_ledger_filter diff --git a/account_partner_ledger_filter/models/__init__.py b/account_partner_ledger_filter/models/__init__.py new file mode 100644 index 000000000..988bbac28 --- /dev/null +++ b/account_partner_ledger_filter/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-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 . import account_partner_ledger diff --git a/account_partner_ledger_filter/models/account_partner_ledger.py b/account_partner_ledger_filter/models/account_partner_ledger.py new file mode 100644 index 000000000..8bacf18ef --- /dev/null +++ b/account_partner_ledger_filter/models/account_partner_ledger.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-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 . +# +############################################################################# + +import time +import logging +from odoo import api, models, _ +from odoo.exceptions import UserError + +_logger = logging.getLogger(__name__) + + +class ReportPartnerLedger(models.AbstractModel): + _inherit = 'report.base_accounting_kit.report_partnerledger' + + @api.model + def _get_report_values(self, docids, data=None): + if not data.get('form'): + raise UserError(_("Form content is missing, this report cannot be printed.")) + + data['computed'] = {} + + obj_partner = self.env['res.partner'] + query_get_data = self.env['account.move.line'].with_context(data['form'].get('used_context', {}))._query_get() + data['computed']['move_state'] = ['draft', 'posted'] + if data['form'].get('target_move', 'all') == 'posted': + data['computed']['move_state'] = ['posted'] + result_selection = data['form'].get('result_selection', 'customer') + if result_selection == 'supplier': + data['computed']['ACCOUNT_TYPE'] = ['payable'] + elif result_selection == 'customer': + data['computed']['ACCOUNT_TYPE'] = ['receivable'] + else: + data['computed']['ACCOUNT_TYPE'] = ['payable', 'receivable'] + + self.env.cr.execute(""" + SELECT a.id + FROM account_account a + WHERE a.internal_type IN %s + AND NOT a.deprecated""", (tuple(data['computed']['ACCOUNT_TYPE']),)) + data['computed']['account_ids'] = [a for (a,) in self.env.cr.fetchall()] + params = [tuple(data['computed']['move_state']), tuple(data['computed']['account_ids'])] + query_get_data[2] + reconcile_clause = "" if data['form']['reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL ' + query = """ + SELECT DISTINCT "account_move_line".partner_id + FROM """ + query_get_data[0] + """, account_account AS account, account_move AS am + WHERE "account_move_line".partner_id IS NOT NULL + AND "account_move_line".account_id = account.id + AND am.id = "account_move_line".move_id + AND am.state IN %s + AND "account_move_line".account_id IN %s + AND NOT account.deprecated + AND """ + query_get_data[1] + reconcile_clause + self.env.cr.execute(query, tuple(params)) + # ---------------------Taking only selected partners--------------------------- + if data['form']['partner_ids']: + partner_ids = data['form']['partner_ids'] + else: + partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()] + # ----------------------------------------------------------------------------- + # 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 '')) + + return { + 'doc_ids': partner_ids, + 'doc_model': self.env['res.partner'], + 'data': data, + 'docs': partners, + 'time': time, + 'lines': self._lines, + 'sum_partner': self._sum_partner, + } diff --git a/account_partner_ledger_filter/static/description/banner.png b/account_partner_ledger_filter/static/description/banner.png new file mode 100644 index 000000000..51e5fee69 Binary files /dev/null and b/account_partner_ledger_filter/static/description/banner.png differ diff --git a/account_partner_ledger_filter/static/description/icon.png b/account_partner_ledger_filter/static/description/icon.png new file mode 100644 index 000000000..58a876e41 Binary files /dev/null and b/account_partner_ledger_filter/static/description/icon.png differ diff --git a/account_partner_ledger_filter/static/description/images/account_dynamic_report_banner.gif b/account_partner_ledger_filter/static/description/images/account_dynamic_report_banner.gif new file mode 100644 index 000000000..d4530e466 Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/account_dynamic_report_banner.gif differ diff --git a/account_partner_ledger_filter/static/description/images/checked.png b/account_partner_ledger_filter/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/checked.png differ diff --git a/account_partner_ledger_filter/static/description/images/crm_dashboard_banner.gif b/account_partner_ledger_filter/static/description/images/crm_dashboard_banner.gif new file mode 100644 index 000000000..b80a0bfc9 Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/crm_dashboard_banner.gif differ diff --git a/account_partner_ledger_filter/static/description/images/cybrosys.png b/account_partner_ledger_filter/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/cybrosys.png differ diff --git a/account_partner_ledger_filter/static/description/images/led.png b/account_partner_ledger_filter/static/description/images/led.png new file mode 100644 index 000000000..ab0b1fecd Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/led.png differ diff --git a/account_partner_ledger_filter/static/description/images/mobile_service_shop_pro_banner.jpg b/account_partner_ledger_filter/static/description/images/mobile_service_shop_pro_banner.jpg new file mode 100644 index 000000000..7a2e022ca Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/mobile_service_shop_pro_banner.jpg differ diff --git a/account_partner_ledger_filter/static/description/images/odoo11_magento_banner.jpg b/account_partner_ledger_filter/static/description/images/odoo11_magento_banner.jpg new file mode 100644 index 000000000..b2d9b33ce Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/odoo11_magento_banner.jpg differ diff --git a/account_partner_ledger_filter/static/description/images/par.png b/account_partner_ledger_filter/static/description/images/par.png new file mode 100644 index 000000000..2bb4d0ddf Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/par.png differ diff --git a/account_partner_ledger_filter/static/description/images/partner.png b/account_partner_ledger_filter/static/description/images/partner.png new file mode 100644 index 000000000..fcc37dac0 Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/partner.png differ diff --git a/account_partner_ledger_filter/static/description/images/project_custome_gantt_banner.gif b/account_partner_ledger_filter/static/description/images/project_custome_gantt_banner.gif new file mode 100644 index 000000000..3ee64f1c5 Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/project_custome_gantt_banner.gif differ diff --git a/account_partner_ledger_filter/static/description/images/report_maker_banner.gif b/account_partner_ledger_filter/static/description/images/report_maker_banner.gif new file mode 100644 index 000000000..db6305f39 Binary files /dev/null and b/account_partner_ledger_filter/static/description/images/report_maker_banner.gif differ diff --git a/account_partner_ledger_filter/static/description/index.html b/account_partner_ledger_filter/static/description/index.html new file mode 100644 index 000000000..073d53355 --- /dev/null +++ b/account_partner_ledger_filter/static/description/index.html @@ -0,0 +1,312 @@ +
cybrosys-logo
+
+
+
+

Partner Ledger Report with Partner Filter

+
+

Key Highlights

+
    +
  • checkCreates a partner ledger report by filtering partners
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This module adds a filter to the partner ledger report in Odoo 13 Full Accounting Kit Module . +

+
+
+ +

Partner Ledger Report with Partner Filter

+
+
    +
  • + checkHelps to filter partners and makes reports based on the input +
  • +
+ +
+
+

Screenshots

+
+
+
+ +
+
+
+
+
+ + + + +
+ +
+
    +
+
+
+
+
+
+
+

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/account_partner_ledger_filter/views/report.xml b/account_partner_ledger_filter/views/report.xml new file mode 100644 index 000000000..e85928158 --- /dev/null +++ b/account_partner_ledger_filter/views/report.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/account_partner_ledger_filter/wizard/__init__.py b/account_partner_ledger_filter/wizard/__init__.py new file mode 100644 index 000000000..677bb2b06 --- /dev/null +++ b/account_partner_ledger_filter/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-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 . import account_report_partner_ledger diff --git a/account_partner_ledger_filter/wizard/account_report_general_ledger_view.xml b/account_partner_ledger_filter/wizard/account_report_general_ledger_view.xml new file mode 100644 index 000000000..c7e1364e7 --- /dev/null +++ b/account_partner_ledger_filter/wizard/account_report_general_ledger_view.xml @@ -0,0 +1,15 @@ + + + + Partner Ledger + account.report.partner.ledger + + + + + + + + + + diff --git a/account_partner_ledger_filter/wizard/account_report_partner_ledger.py b/account_partner_ledger_filter/wizard/account_report_partner_ledger.py new file mode 100644 index 000000000..01fe1765d --- /dev/null +++ b/account_partner_ledger_filter/wizard/account_report_partner_ledger.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-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 + + +class AccountPartnerLedger(models.TransientModel): + _inherit = "account.report.partner.ledger" + + partner_ids = fields.Many2many('res.partner', 'partner_ledger_partner_rel', 'id', 'partner_id', string='Partners') + + def _print_report(self, data): + data = self.pre_print_report(data) + data['form'].update({'reconciled': self.reconciled, 'amount_currency': self.amount_currency, + 'partner_ids': self.partner_ids.ids}) + return self.env.ref('base_accounting_kit.action_report_partnerledger').report_action(self, data=data)