diff --git a/base_accounting_kit/README.rst b/base_accounting_kit/README.rst index 0f5559a7b..e9c1edfa6 100644 --- a/base_accounting_kit/README.rst +++ b/base_accounting_kit/README.rst @@ -1,5 +1,9 @@ -Accounting Kit -============== +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Odoo 15 Full Accounting Kit +=========================== * Full accounting kit for Odoo 15 community editions Installation @@ -10,7 +14,7 @@ Installation License ------- General Public License, Version 3 (LGPL v3). -(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) Company ------- @@ -36,6 +40,9 @@ Bugs are tracked on GitHub Issues. In case of trouble, please check there if you Maintainer ========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + This module is maintained by Cybrosys Technologies. For support and more information, please visit https://www.cybrosys.com @@ -43,4 +50,3 @@ For support and more information, please visit https://www.cybrosys.com Further information =================== HTML Description: ``__ - diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py index 7d7c6a701..7b4fbd30d 100644 --- a/base_accounting_kit/__manifest__.py +++ b/base_accounting_kit/__manifest__.py @@ -19,10 +19,9 @@ # If not, see . # ############################################################################# - { 'name': 'Odoo 15 Full Accounting Kit', - 'version': '15.0.2.2.4', + 'version': '15.0.2.2.5', 'category': 'Accounting', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'summary': """ Asset and Budget Management, @@ -50,7 +49,8 @@ 'website': "https://www.cybrosys.com", 'company': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', - 'depends': ['base', 'account', 'sale', 'account_check_printing', 'base_account_budget'], + 'depends': ['base', 'account', 'sale', 'account_check_printing', + 'base_account_budget'], 'data': [ 'security/ir.model.access.csv', 'security/security.xml', @@ -61,7 +61,6 @@ 'data/account_asset_data.xml', 'data/recurring_entry_cron.xml', 'data/multiple_invoice_data.xml', - 'views/assets.xml', 'views/dashboard_views.xml', 'views/reports_config_view.xml', 'views/accounting_menu.xml', @@ -77,7 +76,6 @@ 'wizard/asset_modify_views.xml', 'views/account_asset_views.xml', 'views/account_move_views.xml', - 'views/account_asset_templates.xml', 'views/product_template_views.xml', 'views/payment_matching.xml', 'views/multiple_invoice_layout_view.xml', @@ -125,7 +123,6 @@ 'base_accounting_kit/static/lib/Chart.min.js', 'base_accounting_kit/static/lib/Chart.js', 'base_accounting_kit/static/lib/bootstrap-toggle-master/js/bootstrap-toggle.min.js', - ], 'web.assets_qweb': [ 'base_accounting_kit/static/src/xml/template.xml', diff --git a/base_accounting_kit/doc/RELEASE_NOTES.md b/base_accounting_kit/doc/RELEASE_NOTES.md index dd53138e0..565316f3b 100644 --- a/base_accounting_kit/doc/RELEASE_NOTES.md +++ b/base_accounting_kit/doc/RELEASE_NOTES.md @@ -3,14 +3,13 @@ #### 06.10.2021 #### Version 15.0.1.0.0 #### ADD -- Initial commit for Odoo 15 accounting +- Initial commit for Odoo 15 Full Accounting Kit #### 20.11.2021 #### Version 15.0.2.0.1 #### ADD - Added specific user group for Accounting Dashboard view. - #### 14.01.2022 #### Version 15.0.2.0.2 #### FIX @@ -24,4 +23,9 @@ #### 28.04.2023 #### Version 15.0.2.2.4 #### FIX -- asset closing issue is fixed \ No newline at end of file +- asset closing issue is fixed + +#### 27.06.2023 +#### Version 15.0.2.2.5 +#### REF +- Refactor code and remove unused files \ No newline at end of file diff --git a/base_accounting_kit/models/__init__.py b/base_accounting_kit/models/__init__.py index d74e179e7..e7dd1466b 100644 --- a/base_accounting_kit/models/__init__.py +++ b/base_accounting_kit/models/__init__.py @@ -1,4 +1,3 @@ -############################################################################# # -*- coding: utf-8 -*- ############################################################################# # diff --git a/base_accounting_kit/models/account_account.py b/base_accounting_kit/models/account_account.py index b99560434..e38511c79 100644 --- a/base_accounting_kit/models/account_account.py +++ b/base_accounting_kit/models/account_account.py @@ -19,21 +19,21 @@ # If not, see . # ############################################################################# - -import time from odoo import api, models, fields, _ -from odoo.exceptions import UserError class CashFlow(models.Model): _inherit = 'account.account' - def get_cash_flow_ids(self): - cash_flow_id = self.env.ref('base_accounting_kit.account_financial_report_cash_flow0') + def _domain_cash_flow_type(self): + cash_flow_id = self.env.ref( + 'base_accounting_kit.account_financial_report_cash_flow0') if cash_flow_id: return [('parent_id.id', '=', cash_flow_id.id)] - cash_flow_type = fields.Many2one('account.financial.report', string="Cash Flow type", domain=get_cash_flow_ids) + cash_flow_type = fields.Many2one( + 'account.financial.report', string="Cash Flow type", + domain=_domain_cash_flow_type) @api.onchange('cash_flow_type') def onchange_cash_flow_type(self): @@ -42,7 +42,6 @@ class CashFlow(models.Model): rec.write({ 'account_ids': [(4, self._origin.id)] }) - if self._origin.cash_flow_type.ids: for rec in self._origin.cash_flow_type: # remove old record diff --git a/base_accounting_kit/models/account_asset.py b/base_accounting_kit/models/account_asset.py index c63de14bf..77414e958 100644 --- a/base_accounting_kit/models/account_asset.py +++ b/base_accounting_kit/models/account_asset.py @@ -19,10 +19,8 @@ # If not, see . # ############################################################################# - import calendar from datetime import date, datetime - from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ diff --git a/base_accounting_kit/models/account_dashboard.py b/base_accounting_kit/models/account_dashboard.py index e2cab9f28..8a777af19 100644 --- a/base_accounting_kit/models/account_dashboard.py +++ b/base_accounting_kit/models/account_dashboard.py @@ -1,12 +1,30 @@ # -*- 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 calendar import datetime from datetime import datetime - from dateutil.relativedelta import relativedelta -from odoo import models, api +from odoo import api, models from odoo.http import request diff --git a/base_accounting_kit/models/account_journal.py b/base_accounting_kit/models/account_journal.py index f8e65bfed..c1fbcee81 100755 --- a/base_accounting_kit/models/account_journal.py +++ b/base_accounting_kit/models/account_journal.py @@ -20,7 +20,7 @@ # ############################################################################# -from odoo import models, api +from odoo import api, models class AccountJournal(models.Model): @@ -46,4 +46,4 @@ class AccountJournal(models.Model): 'type': 'ir.actions.client', 'tag': 'manual_reconciliation_view', 'context': action_context, - } \ No newline at end of file + } diff --git a/base_accounting_kit/models/account_move.py b/base_accounting_kit/models/account_move.py index eeefb9941..fd4e703f0 100644 --- a/base_accounting_kit/models/account_move.py +++ b/base_accounting_kit/models/account_move.py @@ -19,13 +19,10 @@ # If not, see . # ############################################################################# - from datetime import datetime - from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ -from odoo.addons.base.models import decimal_precision as dp from odoo.exceptions import UserError from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF @@ -33,9 +30,9 @@ from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF class AccountMove(models.Model): _inherit = 'account.move' - asset_depreciation_ids = fields.One2many('account.asset.depreciation.line', - 'move_id', - string='Assets Depreciation Lines') + asset_depreciation_ids = fields.One2many( + 'account.asset.depreciation.line', 'move_id', + string='Assets Depreciation Lines') def button_cancel(self): for move in self: @@ -44,7 +41,6 @@ class AccountMove(models.Model): return super(AccountMove, self).button_cancel() def post(self): - self.mapped('asset_depreciation_ids').post_lines_and_close_asset() return super(AccountMove, self).post() @@ -67,7 +63,6 @@ class AccountMove(models.Model): def action_post(self): self.mapped('asset_depreciation_ids').post_lines_and_close_asset() result = super(AccountMove, self).action_post() - for inv in self: context = dict(self.env.context) # Within the context of an invoice, diff --git a/base_accounting_kit/models/account_payment.py b/base_accounting_kit/models/account_payment.py index 311a69cca..a6dd174c3 100755 --- a/base_accounting_kit/models/account_payment.py +++ b/base_accounting_kit/models/account_payment.py @@ -19,7 +19,7 @@ # If not, see . # ############################################################################# -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import UserError @@ -153,4 +153,4 @@ class AccountPaymentMethod(models.Model): def _get_payment_method_information(self): res = super()._get_payment_method_information() res['pdc'] = {'mode': 'multi', 'domain': [('type', '=', 'bank')]} - return res \ No newline at end of file + return res diff --git a/base_accounting_kit/models/credit_limit.py b/base_accounting_kit/models/credit_limit.py index eb4651420..bf7e4f86f 100644 --- a/base_accounting_kit/models/credit_limit.py +++ b/base_accounting_kit/models/credit_limit.py @@ -20,7 +20,7 @@ # ############################################################################# -from odoo import models, fields, api +from odoo import api, fields, models from odoo.exceptions import UserError from odoo.tools.translate import _ diff --git a/base_accounting_kit/models/multiple_invoice.py b/base_accounting_kit/models/multiple_invoice.py index 7f727c38c..32d4360f0 100644 --- a/base_accounting_kit/models/multiple_invoice.py +++ b/base_accounting_kit/models/multiple_invoice.py @@ -1,4 +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 odoo import fields, models @@ -7,8 +27,8 @@ class MultipleInvoice(models.Model): _name = "multiple.invoice" _order = "sequence" - sequence = fields.Integer('Sequence No') - copy_name = fields.Char('Invoice Copy Name') + sequence = fields.Integer(string='Sequence No') + copy_name = fields.Char(string='Invoice Copy Name') journal_id = fields.Many2one('account.journal', string="Journal") @@ -21,26 +41,20 @@ class AccountJournal(models.Model): multiple_invoice_type = fields.Selection( [('text', 'Text'), ('watermark', 'Watermark')], required=True, default='text', string="Display Type") - text_position = fields.Selection([ ('header', 'Header'), ('footer', 'Footer'), ('body', 'Document Body') ], required=True, default='header') - body_text_position = fields.Selection([ ('tl', 'Top Left'), ('tr', 'Top Right'), ('bl', 'Bottom Left'), ('br', 'Bottom Right'), - ], default='tl') - text_align = fields.Selection([ ('right', 'Right'), ('left', 'Left'), ('center', 'Center'), - ], default='right') - - layout = fields.Char(related="company_id.external_report_layout_id.key") \ No newline at end of file + layout = fields.Char(related="company_id.external_report_layout_id.key") diff --git a/base_accounting_kit/models/multiple_invoice_layout.py b/base_accounting_kit/models/multiple_invoice_layout.py index 821750324..4b5f2e6e2 100644 --- a/base_accounting_kit/models/multiple_invoice_layout.py +++ b/base_accounting_kit/models/multiple_invoice_layout.py @@ -1,7 +1,25 @@ # -*- 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 api, fields, models - from odoo.modules import get_resource_path try: @@ -24,44 +42,29 @@ class MultipleInvoiceLayout(models.TransientModel): company_id = fields.Many2one( 'res.company', default=lambda self: self.env.company, required=True) - layout = fields.Char(related="company_id.external_report_layout_id.key") - journal_id = fields.Many2one('account.journal', string='Journal', required=True, default=_get_default_journal) - multiple_invoice_type = fields.Selection( related='journal_id.multiple_invoice_type', readonly=False, required=True) - text_position = fields.Selection(related='journal_id.text_position', readonly=False, required=True, default='header') - body_text_position = fields.Selection( - related='journal_id.body_text_position', - readonly=False) - + related='journal_id.body_text_position', readonly=False) text_align = fields.Selection( - related='journal_id.text_align', - readonly=False) - - preview = fields.Html(compute='_compute_preview', - sanitize=False, - sanitize_tags=False, - sanitize_attributes=False, - sanitize_style=False, - sanitize_form=False, - strip_style=False, - strip_classes=False) + related='journal_id.text_align', readonly=False) + preview = fields.Html( + compute='_compute_preview', sanitize=False, sanitize_tags=False, + sanitize_attributes=False, sanitize_style=False, sanitize_form=False, + strip_style=False, strip_classes=False) @api.depends('multiple_invoice_type', 'text_position', 'body_text_position', 'text_align') def _compute_preview(self): """ compute a qweb based preview to display on the wizard """ - styles = self._get_asset_style() - for wizard in self: if wizard.company_id: preview_css = self._get_css_for_preview(styles, wizard.id) @@ -86,11 +89,9 @@ class MultipleInvoiceLayout(models.TransientModel): raise_if_not_found=False) if not template_style: return b'' - company_styles = template_style._render({ 'company_ids': self.company_id, }) - return company_styles @api.model @@ -108,16 +109,13 @@ class MultipleInvoiceLayout(models.TransientModel): Parameters are the same from odoo/addons/base/models/assetsbundle.py Simply copied and adapted slightly """ - # No scss ? still valid, returns empty css if not scss_source.strip(): return "" - precision = 8 output_style = 'expanded' bootstrap_path = get_resource_path('web', 'static', 'lib', 'bootstrap', 'scss') - try: return libsass.compile( string=scss_source, @@ -133,19 +131,15 @@ class MultipleInvoiceLayout(models.TransientModel): def _get_layout_for_preview(self): if self.layout == 'web.external_layout_boxed': new_layout = 'base_accounting_kit.boxed' - elif self.layout == 'web.external_layout_bold': new_layout = 'base_accounting_kit.bold' - elif self.layout == 'web.external_layout_striped': new_layout = 'base_accounting_kit.striped' - else: new_layout = 'base_accounting_kit.standard' - return new_layout def document_layout_save(self): # meant to be overridden return self.env.context.get('report_action') or { - 'type': 'ir.actions.act_window_close'} \ No newline at end of file + 'type': 'ir.actions.act_window_close'} diff --git a/base_accounting_kit/models/payment_matching.py b/base_accounting_kit/models/payment_matching.py index 0099765ff..d9451a549 100644 --- a/base_accounting_kit/models/payment_matching.py +++ b/base_accounting_kit/models/payment_matching.py @@ -1,6 +1,26 @@ # -*- 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 copy + from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.osv import expression @@ -1175,6 +1195,9 @@ class AccountBankStatementLine(models.Model): class ResCompany(models.Model): _inherit = "res.company" - account_bank_reconciliation_start = fields.Date(string="Bank Reconciliation Threshold", help="""The bank reconciliation widget won't ask to reconcile payments older than this date. - This is useful if you install accounting after having used invoicing for some time and - don't want to reconcile all the past payments with bank statements.""") + account_bank_reconciliation_start = fields.Date( + string="Bank Reconciliation Threshold", + help="The bank reconciliation widget won't ask to reconcile payments " + "older than this date. This is useful if you install accounting " + "after having used invoicing for some time and don't want to " + "reconcile all the past payments with bank statements.") diff --git a/base_accounting_kit/models/product_template.py b/base_accounting_kit/models/product_template.py index f5f5b5c81..c99e6a712 100644 --- a/base_accounting_kit/models/product_template.py +++ b/base_accounting_kit/models/product_template.py @@ -19,15 +19,18 @@ # If not, see . # ############################################################################# - from odoo import api, fields, models class ProductTemplate(models.Model): _inherit = 'product.template' - asset_category_id = fields.Many2one('account.asset.category', string='Asset Type', company_dependent=True, ondelete="restrict") - deferred_revenue_category_id = fields.Many2one('account.asset.category', string='Deferred Revenue Type', company_dependent=True, ondelete="restrict") + asset_category_id = fields.Many2one( + 'account.asset.category', string='Asset Type', company_dependent=True, + ondelete="restrict") + deferred_revenue_category_id = fields.Many2one( + 'account.asset.category', string='Deferred Revenue Type', + company_dependent=True, ondelete="restrict") def _get_asset_accounts(self): res = super(ProductTemplate, self)._get_asset_accounts() diff --git a/base_accounting_kit/models/recurring_payments.py b/base_accounting_kit/models/recurring_payments.py index ba2ba7b45..f61923443 100644 --- a/base_accounting_kit/models/recurring_payments.py +++ b/base_accounting_kit/models/recurring_payments.py @@ -19,12 +19,10 @@ # If not, see . # ############################################################################# -from datetime import datetime, date - +from datetime import date, datetime from dateutil.relativedelta import relativedelta -from odoo import models, fields, api, _ -from odoo.exceptions import UserError +from odoo import api, fields, models, _ class FilterRecurringEntries(models.Model): @@ -90,7 +88,8 @@ class RecurringPayments(models.Model): store=True, required=True) company_id = fields.Many2one('res.company', default=lambda l: l.env.company.id) - recurring_lines = fields.One2many('account.recurring.entries.line', 'tmpl_id') + recurring_lines = fields.One2many( + 'account.recurring.entries.line', 'tmpl_id') @api.onchange('partner_id') def onchange_partner_id(self): @@ -167,13 +166,11 @@ class RecurringPayments(models.Model): move_id.post() - class GetAllRecurringEntries(models.TransientModel): - _name = 'account.recurring.entries.line' - _description = 'Account Recurring Entries Line' - - date = fields.Date('Date') - template_name = fields.Char('Name') - amount = fields.Float('Amount') - tmpl_id = fields.Many2one('account.recurring.payments', string='id') - +class GetAllRecurringEntries(models.TransientModel): + _name = 'account.recurring.entries.line' + _description = 'Account Recurring Entries Line' + date = fields.Date('Date') + template_name = fields.Char('Name') + amount = fields.Float('Amount') + tmpl_id = fields.Many2one('account.recurring.payments', string='id') diff --git a/base_accounting_kit/models/res_config_settings.py b/base_accounting_kit/models/res_config_settings.py index 675671d76..22fc57fdc 100644 --- a/base_accounting_kit/models/res_config_settings.py +++ b/base_accounting_kit/models/res_config_settings.py @@ -19,8 +19,7 @@ # If not, see . # ############################################################################# - -from odoo import models, fields, api +from odoo import api, fields, models class ResConfigSettings(models.TransientModel): @@ -40,5 +39,4 @@ class ResConfigSettings(models.TransientModel): def set_values(self): super(ResConfigSettings, self).set_values() self.env['ir.config_parameter'].sudo().set_param( - "customer_credit_limit", - self.customer_credit_limit) + "customer_credit_limit", self.customer_credit_limit) diff --git a/base_accounting_kit/models/res_partner.py b/base_accounting_kit/models/res_partner.py index 52d3e67d0..3f3376902 100644 --- a/base_accounting_kit/models/res_partner.py +++ b/base_accounting_kit/models/res_partner.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - from datetime import date, timedelta from odoo import fields, models @@ -28,12 +27,11 @@ from odoo import fields, models class ResPartner(models.Model): _inherit = "res.partner" - invoice_list = fields.One2many('account.move', 'partner_id', - string="Invoice Details", - readonly=True, - domain=( - [('payment_state', '=', 'not_paid'), - ('move_type', '=', 'out_invoice')])) + invoice_list = fields.One2many( + 'account.move', 'partner_id', string="Invoice Details", + readonly=True, domain=( + [('payment_state', '=', 'not_paid'), + ('move_type', '=', 'out_invoice')])) total_due = fields.Monetary(compute='_compute_for_followup', store=False, readonly=True) next_reminder_date = fields.Date(compute='_compute_for_followup', @@ -44,8 +42,7 @@ class ResPartner(models.Model): [('in_need_of_action', 'In need of action'), ('with_overdue_invoices', 'With overdue invoices'), ('no_action_needed', 'No action needed')], - string='Followup status', - ) + string='Followup status') def _compute_for_followup(self): """ @@ -99,14 +96,11 @@ class ResPartner(models.Model): order by delay limit 1""" self._cr.execute(delay, [self.env.company.id]) record = self._cr.dictfetchall() - return record - def action_after(self): lines = self.env['followup.line'].search([( 'followup_id.company_id', '=', self.env.company.id)]) - if lines: record = self.get_delay() for i in record: diff --git a/base_accounting_kit/report/account_asset_report.py b/base_accounting_kit/report/account_asset_report.py index 7917958c5..0aec51b99 100644 --- a/base_accounting_kit/report/account_asset_report.py +++ b/base_accounting_kit/report/account_asset_report.py @@ -1,6 +1,24 @@ # -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - +############################################################################# +# +# 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 api, fields, models, tools @@ -12,19 +30,29 @@ class AssetAssetReport(models.Model): name = fields.Char(string='Year', required=False, readonly=True) date = fields.Date(readonly=True) depreciation_date = fields.Date(string='Depreciation Date', readonly=True) - asset_id = fields.Many2one('account.asset.asset', string='Asset', readonly=True) - asset_category_id = fields.Many2one('account.asset.category', string='Asset category', readonly=True) - partner_id = fields.Many2one('res.partner', string='Partner', readonly=True) - state = fields.Selection([('draft', 'Draft'), ('open', 'Running'), ('close', 'Close')], string='Status', readonly=True) - depreciation_value = fields.Float(string='Amount of Depreciation Lines', readonly=True) - installment_value = fields.Float(string='Amount of Installment Lines', readonly=True) + asset_id = fields.Many2one( + 'account.asset.asset', string='Asset', readonly=True) + asset_category_id = fields.Many2one( + 'account.asset.category', string='Asset category', readonly=True) + partner_id = fields.Many2one( + 'res.partner', string='Partner', readonly=True) + state = fields.Selection( + [('draft', 'Draft'), ('open', 'Running'), ('close', 'Close')], + string='Status', readonly=True) + depreciation_value = fields.Float( + string='Amount of Depreciation Lines', readonly=True) + installment_value = fields.Float( + string='Amount of Installment Lines', readonly=True) move_check = fields.Boolean(string='Posted', readonly=True) - installment_nbr = fields.Integer(string='# of Installment Lines', readonly=True) - depreciation_nbr = fields.Integer(string='# of Depreciation Lines', readonly=True) + installment_nbr = fields.Integer( + string='# of Installment Lines', readonly=True) + depreciation_nbr = fields.Integer( + string='# of Depreciation Lines', readonly=True) gross_value = fields.Float(string='Gross Amount', readonly=True) posted_value = fields.Float(string='Posted Amount', readonly=True) unposted_value = fields.Float(string='Unposted Amount', readonly=True) - company_id = fields.Many2one('res.company', string='Company', readonly=True) + company_id = fields.Many2one( + 'res.company', string='Company', readonly=True) def init(self): tools.drop_view_if_exists(self._cr, 'asset_asset_report') diff --git a/base_accounting_kit/report/account_bank_book.py b/base_accounting_kit/report/account_bank_book.py index a4faa2f0b..9dea3ec71 100644 --- a/base_accounting_kit/report/account_bank_book.py +++ b/base_accounting_kit/report/account_bank_book.py @@ -21,7 +21,7 @@ ############################################################################# from datetime import time -from odoo import models, api, _ +from odoo import api, models, _ from odoo.exceptions import UserError diff --git a/base_accounting_kit/report/account_cash_book.py b/base_accounting_kit/report/account_cash_book.py index 2d36ddbf6..8a61953ec 100644 --- a/base_accounting_kit/report/account_cash_book.py +++ b/base_accounting_kit/report/account_cash_book.py @@ -21,7 +21,7 @@ ############################################################################# from datetime import time -from odoo import models, api, _ +from odoo import api, models, _ from odoo.exceptions import UserError diff --git a/base_accounting_kit/report/account_day_book.py b/base_accounting_kit/report/account_day_book.py index fcc7e8b4d..cac14005f 100644 --- a/base_accounting_kit/report/account_day_book.py +++ b/base_accounting_kit/report/account_day_book.py @@ -22,7 +22,7 @@ import time from datetime import timedelta, datetime -from odoo import models, api, _ +from odoo import api, models, _ from odoo.exceptions import UserError diff --git a/base_accounting_kit/report/account_report_common_account.py b/base_accounting_kit/report/account_report_common_account.py index 1c359e24e..b855245bf 100644 --- a/base_accounting_kit/report/account_report_common_account.py +++ b/base_accounting_kit/report/account_report_common_account.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - from odoo import api, fields, models diff --git a/base_accounting_kit/report/cash_flow_report.py b/base_accounting_kit/report/cash_flow_report.py index f4af93f31..4d93c1a20 100644 --- a/base_accounting_kit/report/cash_flow_report.py +++ b/base_accounting_kit/report/cash_flow_report.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - import time from odoo import api, models, _ diff --git a/base_accounting_kit/report/general_ledger_report.py b/base_accounting_kit/report/general_ledger_report.py index f4e4b4ed1..1ceef23cf 100644 --- a/base_accounting_kit/report/general_ledger_report.py +++ b/base_accounting_kit/report/general_ledger_report.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - import time from odoo import api, models, _ diff --git a/base_accounting_kit/report/multiple_invoice_report.py b/base_accounting_kit/report/multiple_invoice_report.py index 085b0829a..c343b97e2 100644 --- a/base_accounting_kit/report/multiple_invoice_report.py +++ b/base_accounting_kit/report/multiple_invoice_report.py @@ -1,6 +1,25 @@ # -*- coding: utf-8 -*- - -from odoo import models, api +############################################################################# +# +# 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 api, models class ReportInvoiceMultiple(models.AbstractModel): @@ -10,28 +29,21 @@ class ReportInvoiceMultiple(models.AbstractModel): @api.model def _get_report_values(self, docids, data=None): rslt = super()._get_report_values(docids, data) - inv = rslt['docs'] layout = inv.journal_id.company_id.external_report_layout_id.key - if layout == 'web.external_layout_boxed': new_layout = 'base_accounting_kit.boxed' - elif layout == 'web.external_layout_bold': new_layout = 'base_accounting_kit.bold' - elif layout == 'web.external_layout_striped': new_layout = 'base_accounting_kit.striped' - else: new_layout = 'base_accounting_kit.standard' - rslt['mi_type'] = inv.journal_id.multiple_invoice_type rslt['mi_ids'] = inv.journal_id.multiple_invoice_ids rslt['txt_position'] = inv.journal_id.text_position rslt['body_txt_position'] = inv.journal_id.body_text_position rslt['txt_align'] = inv.journal_id.text_align rslt['layout'] = new_layout - rslt['report_type'] = data.get('report_type') if data else '' - return rslt \ No newline at end of file + return rslt diff --git a/base_accounting_kit/report/report_aged_partner.py b/base_accounting_kit/report/report_aged_partner.py index f9467931a..41b34bc50 100644 --- a/base_accounting_kit/report/report_aged_partner.py +++ b/base_accounting_kit/report/report_aged_partner.py @@ -19,10 +19,8 @@ # If not, see . # ############################################################################# - import time from datetime import datetime - from dateutil.relativedelta import relativedelta from odoo import api, models, _ @@ -287,17 +285,15 @@ class ReportAgedPartnerBalance(models.AbstractModel): else: account_type = ['payable', 'receivable'] - movelines, total, dummy = self._get_partner_move_lines(account_type, - date_from, - target_move, - data['form'][ - 'period_length']) + move_lines, total, dummy = self._get_partner_move_lines( + account_type, date_from, target_move, + data['form']['period_length']) return { 'doc_ids': self.ids, 'doc_model': model, 'data': data['form'], 'docs': docs, 'time': time, - 'get_partner_lines': movelines, + 'get_partner_lines': move_lines, 'get_direction': total, } diff --git a/base_accounting_kit/report/report_financial.py b/base_accounting_kit/report/report_financial.py index bdf58017b..0d6464f4c 100644 --- a/base_accounting_kit/report/report_financial.py +++ b/base_accounting_kit/report/report_financial.py @@ -33,7 +33,7 @@ class AccountFinancialReport(models.Model): _rec_name = 'name' @api.depends('parent_id', 'parent_id.level') - def _get_level(self): + def _compute_level(self): """Returns a dictionary with key=the ID of a record and value = the level of this record in the tree structure.""" @@ -54,35 +54,27 @@ class AccountFinancialReport(models.Model): res += child._get_children_by_order() return res - name = fields.Char('Report Name', required=True, translate=True) - parent_id = fields.Many2one('account.financial.report', 'Parent') + name = fields.Char(string='Report Name', required=True, translate=True) + parent_id = fields.Many2one('account.financial.report', string='Parent') children_ids = fields.One2many( - 'account.financial.report', - 'parent_id', - 'Account Report') + 'account.financial.report', 'parent_id', string='Account Report') sequence = fields.Integer('Sequence') - level = fields.Integer(compute='_get_level', string='Level', store=True) + level = fields.Integer( + compute='_compute_level', string='Level', store=True) type = fields.Selection( [('sum', 'View'), ('accounts', 'Accounts'), ('account_type', 'Account Type'), ('account_report', 'Report Value')], - 'Type', - default='sum') + string='Type', default='sum') account_ids = fields.Many2many( - 'account.account', - 'account_account_financial_report', - 'report_line_id', - 'account_id', - 'Accounts') + 'account.account', 'account_account_financial_report', + 'report_line_id', 'account_id', string='Accounts') account_report_id = fields.Many2one( - 'account.financial.report', - 'Report Value') + 'account.financial.report', string='Report Value') account_type_ids = fields.Many2many( - 'account.account.type', - 'account_account_financial_report_type', - 'report_id', 'account_type_id', - 'Account Types') + 'account.account.type', 'account_account_financial_report_type', + 'report_id', 'account_type_id', string='Account Types') sign = fields.Selection( [("-1", 'Reverse balance sign'), ("1", 'Preserve balance sign')], 'Sign on Reports', required=True, default="1", @@ -100,8 +92,7 @@ class AccountFinancialReport(models.Model): [('no_detail', 'No detail'), ('detail_flat', 'Display children flat'), ('detail_with_hierarchy', 'Display children with hierarchy')], - 'Display details', - default='detail_flat') + string='Display details', default='detail_flat') style_overwrite = fields.Selection( [('0', 'Automatic formatting'), ('1', 'Main Title 1 (bold, underlined)'), @@ -110,8 +101,7 @@ class AccountFinancialReport(models.Model): ('4', 'Normal Text'), ('5', 'Italic Text (smaller)'), ('6', 'Smallest Text')], - 'Financial Report Style', - default='0', + string='Financial Report Style', default='0', help="You can set up here the format you want this" " record to be displayed. If you leave the" " automatic formatting, it will be computed" diff --git a/base_accounting_kit/report/report_journal_audit.py b/base_accounting_kit/report/report_journal_audit.py index ea5ab3f0d..9972374ff 100644 --- a/base_accounting_kit/report/report_journal_audit.py +++ b/base_accounting_kit/report/report_journal_audit.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - import time from odoo import api, models, _ @@ -133,17 +132,13 @@ class ReportJournal(models.AbstractModel): if not data.get('form'): raise UserError( _("Form content is missing, this report cannot be printed.")) - target_move = data['form'].get('target_move', 'all') sort_selection = data['form'].get('sort_selection', 'date') - res = {} for journal in data['form']['journal_ids']: res[journal] = self.with_context( - data['form'].get('used_context', {})).lines(target_move, - journal, - sort_selection, - data) + data['form'].get('used_context', {})).lines( + target_move, journal, sort_selection, data) return { 'doc_ids': data['form']['journal_ids'], 'doc_model': self.env['account.journal'], diff --git a/base_accounting_kit/report/report_partner_ledger.py b/base_accounting_kit/report/report_partner_ledger.py index 6e8951abf..eac27514e 100644 --- a/base_accounting_kit/report/report_partner_ledger.py +++ b/base_accounting_kit/report/report_partner_ledger.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - import time from odoo import api, models, _ diff --git a/base_accounting_kit/report/report_tax.py b/base_accounting_kit/report/report_tax.py index 410b9d96e..e95e29e12 100644 --- a/base_accounting_kit/report/report_tax.py +++ b/base_accounting_kit/report/report_tax.py @@ -19,8 +19,7 @@ # If not, see . # ############################################################################# - -from _datetime import datetime +from datetime import datetime from odoo import api, models, _ from odoo.exceptions import UserError @@ -98,10 +97,9 @@ class ReportTax(models.AbstractModel): strict_range=True)._compute_from_amls(options, taxes) elif options['date_from'] and options['date_to']: - self.with_context(date_from=options['date_from'], - date_to=options['date_to'], - strict_range=True)._compute_from_amls(options, - taxes) + self.with_context( + date_from=options['date_from'], date_to=options['date_to'], + strict_range=True)._compute_from_amls(options, taxes) else: date_to = str(datetime.today().date()) self.with_context(date_to=date_to, diff --git a/base_accounting_kit/report/report_trial_balance.py b/base_accounting_kit/report/report_trial_balance.py index d8bbe4d38..f4ae3f464 100644 --- a/base_accounting_kit/report/report_trial_balance.py +++ b/base_accounting_kit/report/report_trial_balance.py @@ -19,7 +19,6 @@ # If not, see . # ############################################################################# - import time from odoo import api, models, _ diff --git a/base_accounting_kit/static/description/assets/icons/logo.png b/base_accounting_kit/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/base_accounting_kit/static/description/assets/icons/logo.png differ diff --git a/base_accounting_kit/static/description/images/xslx_image.png b/base_accounting_kit/static/description/images/xlsx_image.png similarity index 100% rename from base_accounting_kit/static/description/images/xslx_image.png rename to base_accounting_kit/static/description/images/xlsx_image.png diff --git a/base_accounting_kit/static/description/index.html b/base_accounting_kit/static/description/index.html index d0f90b895..5f0cb2025 100644 --- a/base_accounting_kit/static/description/index.html +++ b/base_accounting_kit/static/description/index.html @@ -1,3 +1,17 @@ +
+
+
+
+ +
+
+
+ Community +
+
+
+
+
@@ -7,7 +21,7 @@ Full Accounting Kit

A full-fledged accounting kit for every organization.

-
+
@@ -17,7 +31,7 @@
-
+
@@ -83,7 +97,7 @@

Overview

-
+

Accounting in odoo is sufficient for any organization to meet all their needs related to accounting. @@ -115,44 +129,44 @@

All Features

-

Specific User Group for Accounting Dashboard

-

Multiple Invoice Copies Option

-

Reconciliation Widget

-

Accounting Dashboard with all necessary details

-

Manage Customer follow-ups

-

PDC management is now in

-

Accounting lock dates for Odoo 15 @@ -162,40 +176,40 @@

-

Customer credit limit

-

Handle Recurring payments in Odoo

-

Asset management system for Odoo 15 community edition

-

Multiple Invoice Copies

-

Day book, Bank book and Cash book reports

-

Financial reports

@@ -205,37 +219,37 @@
-

Trial balance report

-

Journal audit report

-

General ledger report

-

Partner ledger report

-

Aged partner balance

-

Tax reports

@@ -253,7 +267,7 @@
Arabic RTL Support
-
+

Added Translations for Arabic.

@@ -264,7 +278,7 @@
Multiple Language Support
-
+

Added Translations for German,Spanish,French,Ukrainian,Chinese.

@@ -280,7 +294,7 @@
Detailed Dashboard
-
+

The Dashboard support report overview for Invoices,Income/Expense,Aged and for other Reports @@ -303,7 +317,7 @@

Accounting Dashboard
-
+

Accounting Dashboard that supports shows reports overview.

@@ -314,7 +328,7 @@
Customer Follow-Ups
-
+

Set up customer follow-ups.

@@ -325,7 +339,7 @@
Recurring Templates
-
+

Used for recurring payments.

@@ -338,79 +352,76 @@
- - -
Comprehensive Reports
-
+
-
+
Invoice

-
+
Bank Book Report

-
+
Cash Book Report

-
+
Day Book Reporting

-
+
Cash Flow Statement

-
+
General Ledger

-
+
Profit and Loss

-
+
Balance Sheet

-
+
Trial Balance

-
+
Tax Invoice Journal

@@ -425,7 +436,7 @@
Screenshots
-
+