Browse Source

Jun 30 : [IMP] Updated 'base_accounting_kit'

pull/280/head
AjmalCybro 2 years ago
parent
commit
e7f3f06e2d
  1. 14
      base_accounting_kit/README.rst
  2. 9
      base_accounting_kit/__manifest__.py
  3. 10
      base_accounting_kit/doc/RELEASE_NOTES.md
  4. 1
      base_accounting_kit/models/__init__.py
  5. 13
      base_accounting_kit/models/account_account.py
  6. 2
      base_accounting_kit/models/account_asset.py
  7. 24
      base_accounting_kit/models/account_dashboard.py
  8. 4
      base_accounting_kit/models/account_journal.py
  9. 11
      base_accounting_kit/models/account_move.py
  10. 4
      base_accounting_kit/models/account_payment.py
  11. 2
      base_accounting_kit/models/credit_limit.py
  12. 32
      base_accounting_kit/models/multiple_invoice.py
  13. 60
      base_accounting_kit/models/multiple_invoice_layout.py
  14. 31
      base_accounting_kit/models/payment_matching.py
  15. 9
      base_accounting_kit/models/product_template.py
  16. 25
      base_accounting_kit/models/recurring_payments.py
  17. 6
      base_accounting_kit/models/res_config_settings.py
  18. 18
      base_accounting_kit/models/res_partner.py
  19. 50
      base_accounting_kit/report/account_asset_report.py
  20. 2
      base_accounting_kit/report/account_bank_book.py
  21. 2
      base_accounting_kit/report/account_cash_book.py
  22. 2
      base_accounting_kit/report/account_day_book.py
  23. 1
      base_accounting_kit/report/account_report_common_account.py
  24. 1
      base_accounting_kit/report/cash_flow_report.py
  25. 1
      base_accounting_kit/report/general_ledger_report.py
  26. 32
      base_accounting_kit/report/multiple_invoice_report.py
  27. 12
      base_accounting_kit/report/report_aged_partner.py
  28. 38
      base_accounting_kit/report/report_financial.py
  29. 9
      base_accounting_kit/report/report_journal_audit.py
  30. 1
      base_accounting_kit/report/report_partner_ledger.py
  31. 10
      base_accounting_kit/report/report_tax.py
  32. 1
      base_accounting_kit/report/report_trial_balance.py
  33. BIN
      base_accounting_kit/static/description/assets/icons/logo.png
  34. 0
      base_accounting_kit/static/description/images/xlsx_image.png
  35. 111
      base_accounting_kit/static/description/index.html
  36. 9
      base_accounting_kit/views/account_asset_templates.xml
  37. 18
      base_accounting_kit/views/assets.xml
  38. 1
      base_accounting_kit/wizard/__init__.py
  39. 84
      base_accounting_kit/wizard/account_bank_book_wizard.py
  40. 26
      base_accounting_kit/wizard/account_cash_book_wizard.py
  41. 69
      base_accounting_kit/wizard/account_day_book_wizard.py
  42. 18
      base_accounting_kit/wizard/account_lock_date.py
  43. 11
      base_accounting_kit/wizard/account_report_common_partner.py
  44. 5
      base_accounting_kit/wizard/aged_partner.py
  45. 1
      base_accounting_kit/wizard/aged_partner.xml
  46. 16
      base_accounting_kit/wizard/asset_depreciation_confirmation_wizard.py
  47. 34
      base_accounting_kit/wizard/asset_modify.py
  48. 42
      base_accounting_kit/wizard/cash_flow_report.py
  49. 77
      base_accounting_kit/wizard/financial_report.py
  50. 19
      base_accounting_kit/wizard/general_ledger.py
  51. 10
      base_accounting_kit/wizard/journal_audit.py
  52. 10
      base_accounting_kit/wizard/partner_ledger.py
  53. 1
      base_accounting_kit/wizard/tax_report.py
  54. 9
      base_accounting_kit/wizard/trial_balance.py

14
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 * Full accounting kit for Odoo 15 community editions
Installation Installation
@ -10,7 +14,7 @@ Installation
License License
------- -------
General Public License, Version 3 (LGPL v3). 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 Company
------- -------
@ -36,6 +40,9 @@ Bugs are tracked on GitHub Issues. In case of trouble, please check there if you
Maintainer Maintainer
========== ==========
.. image:: https://cybrosys.com/images/logo.png
:target: https://cybrosys.com
This module is maintained by Cybrosys Technologies. This module is maintained by Cybrosys Technologies.
For support and more information, please visit https://www.cybrosys.com 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 Further information
=================== ===================
HTML Description: `<static/description/index.html>`__ HTML Description: `<static/description/index.html>`__

9
base_accounting_kit/__manifest__.py

@ -19,10 +19,9 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
{ {
'name': 'Odoo 15 Full Accounting Kit', 'name': 'Odoo 15 Full Accounting Kit',
'version': '15.0.2.2.4', 'version': '15.0.2.2.5',
'category': 'Accounting', 'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs',
'summary': """ Asset and Budget Management, 'summary': """ Asset and Budget Management,
@ -50,7 +49,8 @@
'website': "https://www.cybrosys.com", 'website': "https://www.cybrosys.com",
'company': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions',
'maintainer': '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': [ 'data': [
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'security/security.xml', 'security/security.xml',
@ -61,7 +61,6 @@
'data/account_asset_data.xml', 'data/account_asset_data.xml',
'data/recurring_entry_cron.xml', 'data/recurring_entry_cron.xml',
'data/multiple_invoice_data.xml', 'data/multiple_invoice_data.xml',
'views/assets.xml',
'views/dashboard_views.xml', 'views/dashboard_views.xml',
'views/reports_config_view.xml', 'views/reports_config_view.xml',
'views/accounting_menu.xml', 'views/accounting_menu.xml',
@ -77,7 +76,6 @@
'wizard/asset_modify_views.xml', 'wizard/asset_modify_views.xml',
'views/account_asset_views.xml', 'views/account_asset_views.xml',
'views/account_move_views.xml', 'views/account_move_views.xml',
'views/account_asset_templates.xml',
'views/product_template_views.xml', 'views/product_template_views.xml',
'views/payment_matching.xml', 'views/payment_matching.xml',
'views/multiple_invoice_layout_view.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.min.js',
'base_accounting_kit/static/lib/Chart.js', 'base_accounting_kit/static/lib/Chart.js',
'base_accounting_kit/static/lib/bootstrap-toggle-master/js/bootstrap-toggle.min.js', 'base_accounting_kit/static/lib/bootstrap-toggle-master/js/bootstrap-toggle.min.js',
], ],
'web.assets_qweb': [ 'web.assets_qweb': [
'base_accounting_kit/static/src/xml/template.xml', 'base_accounting_kit/static/src/xml/template.xml',

10
base_accounting_kit/doc/RELEASE_NOTES.md

@ -3,14 +3,13 @@
#### 06.10.2021 #### 06.10.2021
#### Version 15.0.1.0.0 #### Version 15.0.1.0.0
#### ADD #### ADD
- Initial commit for Odoo 15 accounting - Initial commit for Odoo 15 Full Accounting Kit
#### 20.11.2021 #### 20.11.2021
#### Version 15.0.2.0.1 #### Version 15.0.2.0.1
#### ADD #### ADD
- Added specific user group for Accounting Dashboard view. - Added specific user group for Accounting Dashboard view.
#### 14.01.2022 #### 14.01.2022
#### Version 15.0.2.0.2 #### Version 15.0.2.0.2
#### FIX #### FIX
@ -24,4 +23,9 @@
#### 28.04.2023 #### 28.04.2023
#### Version 15.0.2.2.4 #### Version 15.0.2.2.4
#### FIX #### FIX
- asset closing issue is fixed - asset closing issue is fixed
#### 27.06.2023
#### Version 15.0.2.2.5
#### REF
- Refactor code and remove unused files

1
base_accounting_kit/models/__init__.py

@ -1,4 +1,3 @@
#############################################################################
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################# #############################################################################
# #

13
base_accounting_kit/models/account_account.py

@ -19,21 +19,21 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time
from odoo import api, models, fields, _ from odoo import api, models, fields, _
from odoo.exceptions import UserError
class CashFlow(models.Model): class CashFlow(models.Model):
_inherit = 'account.account' _inherit = 'account.account'
def get_cash_flow_ids(self): def _domain_cash_flow_type(self):
cash_flow_id = self.env.ref('base_accounting_kit.account_financial_report_cash_flow0') cash_flow_id = self.env.ref(
'base_accounting_kit.account_financial_report_cash_flow0')
if cash_flow_id: if cash_flow_id:
return [('parent_id.id', '=', cash_flow_id.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') @api.onchange('cash_flow_type')
def onchange_cash_flow_type(self): def onchange_cash_flow_type(self):
@ -42,7 +42,6 @@ class CashFlow(models.Model):
rec.write({ rec.write({
'account_ids': [(4, self._origin.id)] 'account_ids': [(4, self._origin.id)]
}) })
if self._origin.cash_flow_type.ids: if self._origin.cash_flow_type.ids:
for rec in self._origin.cash_flow_type: for rec in self._origin.cash_flow_type:
# remove old record # remove old record

2
base_accounting_kit/models/account_asset.py

@ -19,10 +19,8 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import calendar import calendar
from datetime import date, datetime from datetime import date, datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _ from odoo import api, fields, models, _

24
base_accounting_kit/models/account_dashboard.py

@ -1,12 +1,30 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
import calendar import calendar
import datetime import datetime
from datetime import datetime from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import models, api from odoo import api, models
from odoo.http import request from odoo.http import request

4
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): class AccountJournal(models.Model):
@ -46,4 +46,4 @@ class AccountJournal(models.Model):
'type': 'ir.actions.client', 'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view', 'tag': 'manual_reconciliation_view',
'context': action_context, 'context': action_context,
} }

11
base_accounting_kit/models/account_move.py

@ -19,13 +19,10 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from datetime import datetime from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo.addons.base.models import decimal_precision as dp
from odoo.exceptions import UserError from odoo.exceptions import UserError
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF 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): class AccountMove(models.Model):
_inherit = 'account.move' _inherit = 'account.move'
asset_depreciation_ids = fields.One2many('account.asset.depreciation.line', asset_depreciation_ids = fields.One2many(
'move_id', 'account.asset.depreciation.line', 'move_id',
string='Assets Depreciation Lines') string='Assets Depreciation Lines')
def button_cancel(self): def button_cancel(self):
for move in self: for move in self:
@ -44,7 +41,6 @@ class AccountMove(models.Model):
return super(AccountMove, self).button_cancel() return super(AccountMove, self).button_cancel()
def post(self): def post(self):
self.mapped('asset_depreciation_ids').post_lines_and_close_asset() self.mapped('asset_depreciation_ids').post_lines_and_close_asset()
return super(AccountMove, self).post() return super(AccountMove, self).post()
@ -67,7 +63,6 @@ class AccountMove(models.Model):
def action_post(self): def action_post(self):
self.mapped('asset_depreciation_ids').post_lines_and_close_asset() self.mapped('asset_depreciation_ids').post_lines_and_close_asset()
result = super(AccountMove, self).action_post() result = super(AccountMove, self).action_post()
for inv in self: for inv in self:
context = dict(self.env.context) context = dict(self.env.context)
# Within the context of an invoice, # Within the context of an invoice,

4
base_accounting_kit/models/account_payment.py

@ -19,7 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import models, fields, api, _ from odoo import api, fields, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
@ -153,4 +153,4 @@ class AccountPaymentMethod(models.Model):
def _get_payment_method_information(self): def _get_payment_method_information(self):
res = super()._get_payment_method_information() res = super()._get_payment_method_information()
res['pdc'] = {'mode': 'multi', 'domain': [('type', '=', 'bank')]} res['pdc'] = {'mode': 'multi', 'domain': [('type', '=', 'bank')]}
return res return res

2
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.exceptions import UserError
from odoo.tools.translate import _ from odoo.tools.translate import _

32
base_accounting_kit/models/multiple_invoice.py

@ -1,4 +1,24 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import fields, models from odoo import fields, models
@ -7,8 +27,8 @@ class MultipleInvoice(models.Model):
_name = "multiple.invoice" _name = "multiple.invoice"
_order = "sequence" _order = "sequence"
sequence = fields.Integer('Sequence No') sequence = fields.Integer(string='Sequence No')
copy_name = fields.Char('Invoice Copy Name') copy_name = fields.Char(string='Invoice Copy Name')
journal_id = fields.Many2one('account.journal', string="Journal") journal_id = fields.Many2one('account.journal', string="Journal")
@ -21,26 +41,20 @@ class AccountJournal(models.Model):
multiple_invoice_type = fields.Selection( multiple_invoice_type = fields.Selection(
[('text', 'Text'), ('watermark', 'Watermark')], required=True, [('text', 'Text'), ('watermark', 'Watermark')], required=True,
default='text', string="Display Type") default='text', string="Display Type")
text_position = fields.Selection([ text_position = fields.Selection([
('header', 'Header'), ('header', 'Header'),
('footer', 'Footer'), ('footer', 'Footer'),
('body', 'Document Body') ('body', 'Document Body')
], required=True, default='header') ], required=True, default='header')
body_text_position = fields.Selection([ body_text_position = fields.Selection([
('tl', 'Top Left'), ('tl', 'Top Left'),
('tr', 'Top Right'), ('tr', 'Top Right'),
('bl', 'Bottom Left'), ('bl', 'Bottom Left'),
('br', 'Bottom Right'), ('br', 'Bottom Right'),
], default='tl') ], default='tl')
text_align = fields.Selection([ text_align = fields.Selection([
('right', 'Right'), ('right', 'Right'),
('left', 'Left'), ('left', 'Left'),
('center', 'Center'), ('center', 'Center'),
], default='right') ], default='right')
layout = fields.Char(related="company_id.external_report_layout_id.key")
layout = fields.Char(related="company_id.external_report_layout_id.key")

60
base_accounting_kit/models/multiple_invoice_layout.py

@ -1,7 +1,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, fields, models from odoo import api, fields, models
from odoo.modules import get_resource_path from odoo.modules import get_resource_path
try: try:
@ -24,44 +42,29 @@ class MultipleInvoiceLayout(models.TransientModel):
company_id = fields.Many2one( company_id = fields.Many2one(
'res.company', default=lambda self: self.env.company, required=True) 'res.company', default=lambda self: self.env.company, required=True)
layout = fields.Char(related="company_id.external_report_layout_id.key") layout = fields.Char(related="company_id.external_report_layout_id.key")
journal_id = fields.Many2one('account.journal', string='Journal', journal_id = fields.Many2one('account.journal', string='Journal',
required=True, default=_get_default_journal) required=True, default=_get_default_journal)
multiple_invoice_type = fields.Selection( multiple_invoice_type = fields.Selection(
related='journal_id.multiple_invoice_type', readonly=False, related='journal_id.multiple_invoice_type', readonly=False,
required=True) required=True)
text_position = fields.Selection(related='journal_id.text_position', text_position = fields.Selection(related='journal_id.text_position',
readonly=False, required=True, readonly=False, required=True,
default='header') default='header')
body_text_position = fields.Selection( body_text_position = fields.Selection(
related='journal_id.body_text_position', related='journal_id.body_text_position', readonly=False)
readonly=False)
text_align = fields.Selection( text_align = fields.Selection(
related='journal_id.text_align', related='journal_id.text_align', readonly=False)
readonly=False) preview = fields.Html(
compute='_compute_preview', sanitize=False, sanitize_tags=False,
preview = fields.Html(compute='_compute_preview', sanitize_attributes=False, sanitize_style=False, sanitize_form=False,
sanitize=False, strip_style=False, strip_classes=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', @api.depends('multiple_invoice_type', 'text_position', 'body_text_position',
'text_align') 'text_align')
def _compute_preview(self): def _compute_preview(self):
""" compute a qweb based preview to display on the wizard """ """ compute a qweb based preview to display on the wizard """
styles = self._get_asset_style() styles = self._get_asset_style()
for wizard in self: for wizard in self:
if wizard.company_id: if wizard.company_id:
preview_css = self._get_css_for_preview(styles, wizard.id) preview_css = self._get_css_for_preview(styles, wizard.id)
@ -86,11 +89,9 @@ class MultipleInvoiceLayout(models.TransientModel):
raise_if_not_found=False) raise_if_not_found=False)
if not template_style: if not template_style:
return b'' return b''
company_styles = template_style._render({ company_styles = template_style._render({
'company_ids': self.company_id, 'company_ids': self.company_id,
}) })
return company_styles return company_styles
@api.model @api.model
@ -108,16 +109,13 @@ class MultipleInvoiceLayout(models.TransientModel):
Parameters are the same from odoo/addons/base/models/assetsbundle.py Parameters are the same from odoo/addons/base/models/assetsbundle.py
Simply copied and adapted slightly Simply copied and adapted slightly
""" """
# No scss ? still valid, returns empty css # No scss ? still valid, returns empty css
if not scss_source.strip(): if not scss_source.strip():
return "" return ""
precision = 8 precision = 8
output_style = 'expanded' output_style = 'expanded'
bootstrap_path = get_resource_path('web', 'static', 'lib', 'bootstrap', bootstrap_path = get_resource_path('web', 'static', 'lib', 'bootstrap',
'scss') 'scss')
try: try:
return libsass.compile( return libsass.compile(
string=scss_source, string=scss_source,
@ -133,19 +131,15 @@ class MultipleInvoiceLayout(models.TransientModel):
def _get_layout_for_preview(self): def _get_layout_for_preview(self):
if self.layout == 'web.external_layout_boxed': if self.layout == 'web.external_layout_boxed':
new_layout = 'base_accounting_kit.boxed' new_layout = 'base_accounting_kit.boxed'
elif self.layout == 'web.external_layout_bold': elif self.layout == 'web.external_layout_bold':
new_layout = 'base_accounting_kit.bold' new_layout = 'base_accounting_kit.bold'
elif self.layout == 'web.external_layout_striped': elif self.layout == 'web.external_layout_striped':
new_layout = 'base_accounting_kit.striped' new_layout = 'base_accounting_kit.striped'
else: else:
new_layout = 'base_accounting_kit.standard' new_layout = 'base_accounting_kit.standard'
return new_layout return new_layout
def document_layout_save(self): def document_layout_save(self):
# meant to be overridden # meant to be overridden
return self.env.context.get('report_action') or { return self.env.context.get('report_action') or {
'type': 'ir.actions.act_window_close'} 'type': 'ir.actions.act_window_close'}

31
base_accounting_kit/models/payment_matching.py

@ -1,6 +1,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
import copy import copy
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
from odoo.osv import expression from odoo.osv import expression
@ -1175,6 +1195,9 @@ class AccountBankStatementLine(models.Model):
class ResCompany(models.Model): class ResCompany(models.Model):
_inherit = "res.company" _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. account_bank_reconciliation_start = fields.Date(
This is useful if you install accounting after having used invoicing for some time and string="Bank Reconciliation Threshold",
don't want to reconcile all the past payments with bank statements.""") 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.")

9
base_accounting_kit/models/product_template.py

@ -19,15 +19,18 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import api, fields, models from odoo import api, fields, models
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = 'product.template' _inherit = 'product.template'
asset_category_id = fields.Many2one('account.asset.category', string='Asset Type', company_dependent=True, ondelete="restrict") asset_category_id = fields.Many2one(
deferred_revenue_category_id = fields.Many2one('account.asset.category', string='Deferred Revenue Type', company_dependent=True, ondelete="restrict") '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): def _get_asset_accounts(self):
res = super(ProductTemplate, self)._get_asset_accounts() res = super(ProductTemplate, self)._get_asset_accounts()

25
base_accounting_kit/models/recurring_payments.py

@ -19,12 +19,10 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from datetime import datetime, date from datetime import date, datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import models, fields, api, _ from odoo import api, fields, models, _
from odoo.exceptions import UserError
class FilterRecurringEntries(models.Model): class FilterRecurringEntries(models.Model):
@ -90,7 +88,8 @@ class RecurringPayments(models.Model):
store=True, required=True) store=True, required=True)
company_id = fields.Many2one('res.company', company_id = fields.Many2one('res.company',
default=lambda l: l.env.company.id) 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') @api.onchange('partner_id')
def onchange_partner_id(self): def onchange_partner_id(self):
@ -167,13 +166,11 @@ class RecurringPayments(models.Model):
move_id.post() move_id.post()
class GetAllRecurringEntries(models.TransientModel): class GetAllRecurringEntries(models.TransientModel):
_name = 'account.recurring.entries.line' _name = 'account.recurring.entries.line'
_description = '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')
date = fields.Date('Date')
template_name = fields.Char('Name')
amount = fields.Float('Amount')
tmpl_id = fields.Many2one('account.recurring.payments', string='id')

6
base_accounting_kit/models/res_config_settings.py

@ -19,8 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import api, fields, models
from odoo import models, fields, api
class ResConfigSettings(models.TransientModel): class ResConfigSettings(models.TransientModel):
@ -40,5 +39,4 @@ class ResConfigSettings(models.TransientModel):
def set_values(self): def set_values(self):
super(ResConfigSettings, self).set_values() super(ResConfigSettings, self).set_values()
self.env['ir.config_parameter'].sudo().set_param( self.env['ir.config_parameter'].sudo().set_param(
"customer_credit_limit", "customer_credit_limit", self.customer_credit_limit)
self.customer_credit_limit)

18
base_accounting_kit/models/res_partner.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from datetime import date, timedelta from datetime import date, timedelta
from odoo import fields, models from odoo import fields, models
@ -28,12 +27,11 @@ from odoo import fields, models
class ResPartner(models.Model): class ResPartner(models.Model):
_inherit = "res.partner" _inherit = "res.partner"
invoice_list = fields.One2many('account.move', 'partner_id', invoice_list = fields.One2many(
string="Invoice Details", 'account.move', 'partner_id', string="Invoice Details",
readonly=True, readonly=True, domain=(
domain=( [('payment_state', '=', 'not_paid'),
[('payment_state', '=', 'not_paid'), ('move_type', '=', 'out_invoice')]))
('move_type', '=', 'out_invoice')]))
total_due = fields.Monetary(compute='_compute_for_followup', store=False, total_due = fields.Monetary(compute='_compute_for_followup', store=False,
readonly=True) readonly=True)
next_reminder_date = fields.Date(compute='_compute_for_followup', 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'), [('in_need_of_action', 'In need of action'),
('with_overdue_invoices', 'With overdue invoices'), ('with_overdue_invoices', 'With overdue invoices'),
('no_action_needed', 'No action needed')], ('no_action_needed', 'No action needed')],
string='Followup status', string='Followup status')
)
def _compute_for_followup(self): def _compute_for_followup(self):
""" """
@ -99,14 +96,11 @@ class ResPartner(models.Model):
order by delay limit 1""" order by delay limit 1"""
self._cr.execute(delay, [self.env.company.id]) self._cr.execute(delay, [self.env.company.id])
record = self._cr.dictfetchall() record = self._cr.dictfetchall()
return record return record
def action_after(self): def action_after(self):
lines = self.env['followup.line'].search([( lines = self.env['followup.line'].search([(
'followup_id.company_id', '=', self.env.company.id)]) 'followup_id.company_id', '=', self.env.company.id)])
if lines: if lines:
record = self.get_delay() record = self.get_delay()
for i in record: for i in record:

50
base_accounting_kit/report/account_asset_report.py

@ -1,6 +1,24 @@
# -*- coding: utf-8 -*- # -*- 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(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, fields, models, tools from odoo import api, fields, models, tools
@ -12,19 +30,29 @@ class AssetAssetReport(models.Model):
name = fields.Char(string='Year', required=False, readonly=True) name = fields.Char(string='Year', required=False, readonly=True)
date = fields.Date(readonly=True) date = fields.Date(readonly=True)
depreciation_date = fields.Date(string='Depreciation Date', readonly=True) depreciation_date = fields.Date(string='Depreciation Date', readonly=True)
asset_id = fields.Many2one('account.asset.asset', string='Asset', readonly=True) asset_id = fields.Many2one(
asset_category_id = fields.Many2one('account.asset.category', string='Asset category', readonly=True) 'account.asset.asset', string='Asset', readonly=True)
partner_id = fields.Many2one('res.partner', string='Partner', readonly=True) asset_category_id = fields.Many2one(
state = fields.Selection([('draft', 'Draft'), ('open', 'Running'), ('close', 'Close')], string='Status', readonly=True) 'account.asset.category', string='Asset category', readonly=True)
depreciation_value = fields.Float(string='Amount of Depreciation Lines', readonly=True) partner_id = fields.Many2one(
installment_value = fields.Float(string='Amount of Installment Lines', readonly=True) '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) move_check = fields.Boolean(string='Posted', readonly=True)
installment_nbr = fields.Integer(string='# of Installment Lines', readonly=True) installment_nbr = fields.Integer(
depreciation_nbr = fields.Integer(string='# of Depreciation Lines', readonly=True) 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) gross_value = fields.Float(string='Gross Amount', readonly=True)
posted_value = fields.Float(string='Posted Amount', readonly=True) posted_value = fields.Float(string='Posted Amount', readonly=True)
unposted_value = fields.Float(string='Unposted 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): def init(self):
tools.drop_view_if_exists(self._cr, 'asset_asset_report') tools.drop_view_if_exists(self._cr, 'asset_asset_report')

2
base_accounting_kit/report/account_bank_book.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
from datetime import time from datetime import time
from odoo import models, api, _ from odoo import api, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError

2
base_accounting_kit/report/account_cash_book.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
from datetime import time from datetime import time
from odoo import models, api, _ from odoo import api, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError

2
base_accounting_kit/report/account_day_book.py

@ -22,7 +22,7 @@
import time import time
from datetime import timedelta, datetime from datetime import timedelta, datetime
from odoo import models, api, _ from odoo import api, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError

1
base_accounting_kit/report/account_report_common_account.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import api, fields, models from odoo import api, fields, models

1
base_accounting_kit/report/cash_flow_report.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from odoo import api, models, _ from odoo import api, models, _

1
base_accounting_kit/report/general_ledger_report.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from odoo import api, models, _ from odoo import api, models, _

32
base_accounting_kit/report/multiple_invoice_report.py

@ -1,6 +1,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#############################################################################
from odoo import models, api #
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2019-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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 <http://www.gnu.org/licenses/>.
#
#############################################################################
from odoo import api, models
class ReportInvoiceMultiple(models.AbstractModel): class ReportInvoiceMultiple(models.AbstractModel):
@ -10,28 +29,21 @@ class ReportInvoiceMultiple(models.AbstractModel):
@api.model @api.model
def _get_report_values(self, docids, data=None): def _get_report_values(self, docids, data=None):
rslt = super()._get_report_values(docids, data) rslt = super()._get_report_values(docids, data)
inv = rslt['docs'] inv = rslt['docs']
layout = inv.journal_id.company_id.external_report_layout_id.key layout = inv.journal_id.company_id.external_report_layout_id.key
if layout == 'web.external_layout_boxed': if layout == 'web.external_layout_boxed':
new_layout = 'base_accounting_kit.boxed' new_layout = 'base_accounting_kit.boxed'
elif layout == 'web.external_layout_bold': elif layout == 'web.external_layout_bold':
new_layout = 'base_accounting_kit.bold' new_layout = 'base_accounting_kit.bold'
elif layout == 'web.external_layout_striped': elif layout == 'web.external_layout_striped':
new_layout = 'base_accounting_kit.striped' new_layout = 'base_accounting_kit.striped'
else: else:
new_layout = 'base_accounting_kit.standard' new_layout = 'base_accounting_kit.standard'
rslt['mi_type'] = inv.journal_id.multiple_invoice_type rslt['mi_type'] = inv.journal_id.multiple_invoice_type
rslt['mi_ids'] = inv.journal_id.multiple_invoice_ids rslt['mi_ids'] = inv.journal_id.multiple_invoice_ids
rslt['txt_position'] = inv.journal_id.text_position rslt['txt_position'] = inv.journal_id.text_position
rslt['body_txt_position'] = inv.journal_id.body_text_position rslt['body_txt_position'] = inv.journal_id.body_text_position
rslt['txt_align'] = inv.journal_id.text_align rslt['txt_align'] = inv.journal_id.text_align
rslt['layout'] = new_layout rslt['layout'] = new_layout
rslt['report_type'] = data.get('report_type') if data else '' rslt['report_type'] = data.get('report_type') if data else ''
return rslt return rslt

12
base_accounting_kit/report/report_aged_partner.py

@ -19,10 +19,8 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from datetime import datetime from datetime import datetime
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import api, models, _ from odoo import api, models, _
@ -287,17 +285,15 @@ class ReportAgedPartnerBalance(models.AbstractModel):
else: else:
account_type = ['payable', 'receivable'] account_type = ['payable', 'receivable']
movelines, total, dummy = self._get_partner_move_lines(account_type, move_lines, total, dummy = self._get_partner_move_lines(
date_from, account_type, date_from, target_move,
target_move, data['form']['period_length'])
data['form'][
'period_length'])
return { return {
'doc_ids': self.ids, 'doc_ids': self.ids,
'doc_model': model, 'doc_model': model,
'data': data['form'], 'data': data['form'],
'docs': docs, 'docs': docs,
'time': time, 'time': time,
'get_partner_lines': movelines, 'get_partner_lines': move_lines,
'get_direction': total, 'get_direction': total,
} }

38
base_accounting_kit/report/report_financial.py

@ -33,7 +33,7 @@ class AccountFinancialReport(models.Model):
_rec_name = 'name' _rec_name = 'name'
@api.depends('parent_id', 'parent_id.level') @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 """Returns a dictionary with key=the ID of a record and
value = the level of this value = the level of this
record in the tree structure.""" record in the tree structure."""
@ -54,35 +54,27 @@ class AccountFinancialReport(models.Model):
res += child._get_children_by_order() res += child._get_children_by_order()
return res return res
name = fields.Char('Report Name', required=True, translate=True) name = fields.Char(string='Report Name', required=True, translate=True)
parent_id = fields.Many2one('account.financial.report', 'Parent') parent_id = fields.Many2one('account.financial.report', string='Parent')
children_ids = fields.One2many( children_ids = fields.One2many(
'account.financial.report', 'account.financial.report', 'parent_id', string='Account Report')
'parent_id',
'Account Report')
sequence = fields.Integer('Sequence') 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( type = fields.Selection(
[('sum', 'View'), [('sum', 'View'),
('accounts', 'Accounts'), ('accounts', 'Accounts'),
('account_type', 'Account Type'), ('account_type', 'Account Type'),
('account_report', 'Report Value')], ('account_report', 'Report Value')],
'Type', string='Type', default='sum')
default='sum')
account_ids = fields.Many2many( account_ids = fields.Many2many(
'account.account', 'account.account', 'account_account_financial_report',
'account_account_financial_report', 'report_line_id', 'account_id', string='Accounts')
'report_line_id',
'account_id',
'Accounts')
account_report_id = fields.Many2one( account_report_id = fields.Many2one(
'account.financial.report', 'account.financial.report', string='Report Value')
'Report Value')
account_type_ids = fields.Many2many( account_type_ids = fields.Many2many(
'account.account.type', 'account.account.type', 'account_account_financial_report_type',
'account_account_financial_report_type', 'report_id', 'account_type_id', string='Account Types')
'report_id', 'account_type_id',
'Account Types')
sign = fields.Selection( sign = fields.Selection(
[("-1", 'Reverse balance sign'), ("1", 'Preserve balance sign')], [("-1", 'Reverse balance sign'), ("1", 'Preserve balance sign')],
'Sign on Reports', required=True, default="1", 'Sign on Reports', required=True, default="1",
@ -100,8 +92,7 @@ class AccountFinancialReport(models.Model):
[('no_detail', 'No detail'), [('no_detail', 'No detail'),
('detail_flat', 'Display children flat'), ('detail_flat', 'Display children flat'),
('detail_with_hierarchy', 'Display children with hierarchy')], ('detail_with_hierarchy', 'Display children with hierarchy')],
'Display details', string='Display details', default='detail_flat')
default='detail_flat')
style_overwrite = fields.Selection( style_overwrite = fields.Selection(
[('0', 'Automatic formatting'), [('0', 'Automatic formatting'),
('1', 'Main Title 1 (bold, underlined)'), ('1', 'Main Title 1 (bold, underlined)'),
@ -110,8 +101,7 @@ class AccountFinancialReport(models.Model):
('4', 'Normal Text'), ('4', 'Normal Text'),
('5', 'Italic Text (smaller)'), ('5', 'Italic Text (smaller)'),
('6', 'Smallest Text')], ('6', 'Smallest Text')],
'Financial Report Style', string='Financial Report Style', default='0',
default='0',
help="You can set up here the format you want this" help="You can set up here the format you want this"
" record to be displayed. If you leave the" " record to be displayed. If you leave the"
" automatic formatting, it will be computed" " automatic formatting, it will be computed"

9
base_accounting_kit/report/report_journal_audit.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from odoo import api, models, _ from odoo import api, models, _
@ -133,17 +132,13 @@ class ReportJournal(models.AbstractModel):
if not data.get('form'): if not data.get('form'):
raise UserError( raise UserError(
_("Form content is missing, this report cannot be printed.")) _("Form content is missing, this report cannot be printed."))
target_move = data['form'].get('target_move', 'all') target_move = data['form'].get('target_move', 'all')
sort_selection = data['form'].get('sort_selection', 'date') sort_selection = data['form'].get('sort_selection', 'date')
res = {} res = {}
for journal in data['form']['journal_ids']: for journal in data['form']['journal_ids']:
res[journal] = self.with_context( res[journal] = self.with_context(
data['form'].get('used_context', {})).lines(target_move, data['form'].get('used_context', {})).lines(
journal, target_move, journal, sort_selection, data)
sort_selection,
data)
return { return {
'doc_ids': data['form']['journal_ids'], 'doc_ids': data['form']['journal_ids'],
'doc_model': self.env['account.journal'], 'doc_model': self.env['account.journal'],

1
base_accounting_kit/report/report_partner_ledger.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from odoo import api, models, _ from odoo import api, models, _

10
base_accounting_kit/report/report_tax.py

@ -19,8 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from datetime import datetime
from _datetime import datetime
from odoo import api, models, _ from odoo import api, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
@ -98,10 +97,9 @@ class ReportTax(models.AbstractModel):
strict_range=True)._compute_from_amls(options, strict_range=True)._compute_from_amls(options,
taxes) taxes)
elif options['date_from'] and options['date_to']: elif options['date_from'] and options['date_to']:
self.with_context(date_from=options['date_from'], self.with_context(
date_to=options['date_to'], date_from=options['date_from'], date_to=options['date_to'],
strict_range=True)._compute_from_amls(options, strict_range=True)._compute_from_amls(options, taxes)
taxes)
else: else:
date_to = str(datetime.today().date()) date_to = str(datetime.today().date())
self.with_context(date_to=date_to, self.with_context(date_to=date_to,

1
base_accounting_kit/report/report_trial_balance.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from odoo import api, models, _ from odoo import api, models, _

BIN
base_accounting_kit/static/description/assets/icons/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

0
base_accounting_kit/static/description/images/xslx_image.png → base_accounting_kit/static/description/images/xlsx_image.png

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

111
base_accounting_kit/static/description/index.html

@ -1,3 +1,17 @@
<div class="container" style="padding: 1rem !important; margin-bottom: 1rem !important;">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 d-flex justify-content-between" style="border-bottom: 1px solid #d5d5d5;">
<div class="my-3">
<img src="./assets/icons/logo.png" style="width: auto !important; height: 40px !important;">
</div>
<div class="my-3 d-flex align-items-center">
<div style="background-color: #875A7B !important; color: #fff !important; font-weight: 600 !important; padding: 5px 15px 8px !important; margin: 0 5px !important;">
<i class="fa fa-check mr-1"></i>Community
</div>
</div>
</div>
</div>
</div>
<!-- HERO --> <!-- HERO -->
<section class="container oe_container" style="padding: 3em 3.5rem; background-color: #fff ; border-radius: 15px;"> <section class="container oe_container" style="padding: 3em 3.5rem; background-color: #fff ; border-radius: 15px;">
<div class="row"> <div class="row">
@ -7,7 +21,7 @@
Full Accounting Kit</h1> Full Accounting Kit</h1>
<p class="lead text-center" style="color: #102e42;">A full-fledged accounting kit for every <p class="lead text-center" style="color: #102e42;">A full-fledged accounting kit for every
organization.</p> organization.</p>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 100px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 100px;"/>
<img class="mt-4" src="./images/hero.png" height="450px" width="auto"> <img class="mt-4" src="./images/hero.png" height="450px" width="auto">
</div> </div>
</div> </div>
@ -17,7 +31,7 @@
<section class="container oe_container" style="padding: 3em 3.5rem; background-color: #fff ;"> <section class="container oe_container" style="padding: 3em 3.5rem; background-color: #fff ;">
<div class="row" style="margin-top: 2rem;"> <div class="row" style="margin-top: 2rem;">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="d-flex align-itmes-center" style=" border-bottom: 2px solid #0a1e2c; padding-bottom: 5px;"> <div class="d-flex align-items-center" style=" border-bottom: 2px solid #0a1e2c; padding-bottom: 5px;">
<img class="mr-1" src="./images/icons/update.png" style="height: 28px; width: auto;"> <img class="mr-1" src="./images/icons/update.png" style="height: 28px; width: auto;">
<h5 class="font-weight-bold " <h5 class="font-weight-bold "
style="font-size: 0.9375rem; font-family: Montserrat,'sans-serif'; color: #0a1e2c; margin-top: 0.3rem"> style="font-size: 0.9375rem; font-family: Montserrat,'sans-serif'; color: #0a1e2c; margin-top: 0.3rem">
@ -83,7 +97,7 @@
</div> </div>
<div class="col-lg-6 px-4 py-3" style="background-color: #fff;"> <div class="col-lg-6 px-4 py-3" style="background-color: #fff;">
<h4>Overview</h4> <h4>Overview</h4>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p style="font-size: 0.9rem; line-height: 1.6; font-family: Roboto, 'sans-serif'; color: #636e72;"> <p style="font-size: 0.9rem; line-height: 1.6; font-family: Roboto, 'sans-serif'; color: #636e72;">
Accounting in odoo is sufficient for any organization to meet all their needs related to Accounting in odoo is sufficient for any organization to meet all their needs related to
accounting. accounting.
@ -115,44 +129,44 @@
<h4 class="font-weight-bold" style="color: #0a1e2c;">All Features</h4> <h4 class="font-weight-bold" style="color: #0a1e2c;">All Features</h4>
</div> </div>
<div class="col-lg-4 mt-4"> <div class="col-lg-4 mt-4">
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Specific User Group for Accounting <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Specific User Group for Accounting
Dashboard</p> Dashboard</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Multiple Invoice Copies Option</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Multiple Invoice Copies Option</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Reconciliation Widget</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Reconciliation Widget</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Accounting Dashboard with all <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Accounting Dashboard with all
necessary details</p> necessary details</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Manage Customer follow-ups</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Manage Customer follow-ups</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">PDC management is now in</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">PDC management is now in</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Accounting lock dates for Odoo 15 <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Accounting lock dates for Odoo 15
@ -162,40 +176,40 @@
</div> </div>
<div class="col-lg-4 mt-4"> <div class="col-lg-4 mt-4">
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Customer credit limit</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Customer credit limit</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Handle Recurring payments in Odoo <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Handle Recurring payments in Odoo
</p> </p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Asset management system for Odoo <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Asset management system for Odoo
15 community edition</p> 15 community edition</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Multiple Invoice Copies</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Multiple Invoice Copies</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Day book, Bank book and Cash book <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Day book, Bank book and Cash book
reports</p> reports</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Financial reports</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Financial reports</p>
@ -205,37 +219,37 @@
<div class="col-lg-4 mt-4"> <div class="col-lg-4 mt-4">
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Trial balance report</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Trial balance report</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Journal audit report</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Journal audit report</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">General ledger report</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">General ledger report</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Partner ledger report</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Partner ledger report</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Aged partner balance</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Aged partner balance</p>
</div> </div>
<div class="px-3 pt-3 my-2 d-flex align-itmes-center" <div class="px-3 pt-3 my-2 d-flex align-items-center"
style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;"> style="background-color: #fff; border: 1px solid #d5d5d5; border-radius: 5px;">
<i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i> <i class="fa fa-check-circle mt-1 mr-2 deep-1" style="color: #27ae60; font-size: 1.3rem;"></i>
<p style="color: #102e42; font-weight: 500; margin-top: 1px;">Tax reports</p> <p style="color: #102e42; font-weight: 500; margin-top: 1px;">Tax reports</p>
@ -253,7 +267,7 @@
<div class="deep-2" <div class="deep-2"
style="background-color: #fff; background-image: url('./images/yellow-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;"> style="background-color: #fff; background-image: url('./images/yellow-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;">
<h5 style="font-family: Montserrat, 'sans-serif';">Arabic RTL Support</h5> <h5 style="font-family: Montserrat, 'sans-serif';">Arabic RTL Support</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;"> <p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;">
Added Translations for Arabic. Added Translations for Arabic.
</p> </p>
@ -264,7 +278,7 @@
<div class="deep-2" <div class="deep-2"
style="background-color: #fff; background-image: url('./images/blue-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;"> style="background-color: #fff; background-image: url('./images/blue-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;">
<h5 style="font-family: Montserrat, 'sans-serif';">Multiple Language Support</h5> <h5 style="font-family: Montserrat, 'sans-serif';">Multiple Language Support</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;"> <p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;">
Added Translations for German,Spanish,French,Ukrainian,Chinese. Added Translations for German,Spanish,French,Ukrainian,Chinese.
</p> </p>
@ -280,7 +294,7 @@
<div class="row"> <div class="row">
<div class="col-lg-7 d-flex flex-column justify-content-center"> <div class="col-lg-7 d-flex flex-column justify-content-center">
<h5 style="font-family: Montserrat, 'sans-serif';">Detailed Dashboard</h5> <h5 style="font-family: Montserrat, 'sans-serif';">Detailed Dashboard</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;"> <p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;">
The Dashboard support report overview for Invoices,Income/Expense,Aged and for other The Dashboard support report overview for Invoices,Income/Expense,Aged and for other
Reports Reports
@ -303,7 +317,7 @@
<div class="deep-2" <div class="deep-2"
style="height: 450px; background-color: #fff; background-image: url('./images/yellow-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;"> style="height: 450px; background-color: #fff; background-image: url('./images/yellow-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;">
<h5 style="font-family: Montserrat, 'sans-serif';">Accounting Dashboard</h5> <h5 style="font-family: Montserrat, 'sans-serif';">Accounting Dashboard</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;"> <p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;">
Accounting Dashboard that supports shows reports overview. Accounting Dashboard that supports shows reports overview.
</p> </p>
@ -314,7 +328,7 @@
<div class="deep-2" <div class="deep-2"
style="height: 450px; background-color: #fff; background-image: url('./images/red-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;"> style="height: 450px; background-color: #fff; background-image: url('./images/red-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;">
<h5 style="font-family: Montserrat, 'sans-serif';">Customer Follow-Ups</h5> <h5 style="font-family: Montserrat, 'sans-serif';">Customer Follow-Ups</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;"> <p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;">
Set up customer follow-ups. Set up customer follow-ups.
</p> </p>
@ -325,7 +339,7 @@
<div class="deep-2" <div class="deep-2"
style="height: 450px; background-color: #fff; background-image: url('./images/blue-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;"> style="height: 450px; background-color: #fff; background-image: url('./images/blue-pattern.png'); background-position: bottom; background-size: cover; background-repeat: no-repeat ; padding: 2rem 2.5rem; border-radius: 15px;">
<h5 style="font-family: Montserrat, 'sans-serif';">Recurring Templates</h5> <h5 style="font-family: Montserrat, 'sans-serif';">Recurring Templates</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px; margin-left: 0" />
<p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;"> <p class="lead" style="font-style: Roboto, 'sans-serif'; color: #636e72; font-size: 0.9125rem;">
Used for recurring payments. Used for recurring payments.
</p> </p>
@ -338,79 +352,76 @@
</section> </section>
<!-- END OF FEATURE BLOCKS --> <!-- END OF FEATURE BLOCKS -->
</div>
<!-- REPORT SECTION --> <!-- REPORT SECTION -->
<section class="container oe_container mt-4"> <section class="container oe_container mt-4">
<div class="row" style="display: flex;"> <div class="row" style="display: flex;">
<div class="col-lg-12 my-4"> <div class="col-lg-12 my-4">
<h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Comprehensive Reports</h5> <h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Comprehensive Reports</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" />
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-1.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-1.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Invoice</h6> <h6 class="mt-4 text-center">Invoice</h6>
<hr style="border: 2px solid #27ae60; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #27ae60; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-2.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-2.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Bank Book Report</h6> <h6 class="mt-4 text-center">Bank Book Report</h6>
<hr style="border: 2px solid #f39c12; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #f39c12; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-3.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-3.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Cash Book Report</h6> <h6 class="mt-4 text-center">Cash Book Report</h6>
<hr style="border: 2px solid #c0392b; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #c0392b; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-4.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-4.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Day Book Reporting</h6> <h6 class="mt-4 text-center">Day Book Reporting</h6>
<hr style="border: 2px solid #8e44ad; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #8e44ad; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-5.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-5.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Cash Flow Statement</h6> <h6 class="mt-4 text-center">Cash Flow Statement</h6>
<hr style="border: 2px solid #0984e3; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #0984e3; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-6.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-6.png" height="300px" width="auto">
<h6 class="mt-4 text-center">General Ledger</h6> <h6 class="mt-4 text-center">General Ledger</h6>
<hr style="border: 2px solid #e84393; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #e84393; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-7.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-7.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Profit and Loss</h6> <h6 class="mt-4 text-center">Profit and Loss</h6>
<hr style="border: 2px solid #f39c12; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #f39c12; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-8.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-8.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Balance Sheet</h6> <h6 class="mt-4 text-center">Balance Sheet</h6>
<hr style="border: 2px solid #27ae60; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #27ae60; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-9.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-9.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Trial Balance</h6> <h6 class="mt-4 text-center">Trial Balance</h6>
<hr style="border: 2px solid #c0392b; width: 50px; margin-top: 5px;"> <hr style="border: 2px solid #c0392b; width: 50px; margin-top: 5px;">
<p class="text-center" style="color: #636e72; font-size: 0.9rem"></p> <p class="text-center" style="color: #636e72; font-size: 0.9rem"></p>
</div> </div>
<div class="col-lg-6 d-flex flex-column justify-content-center align-itmes-center"> <div class="col-lg-6 d-flex flex-column justify-content-center align-items-center">
<img class="img img-fluid" src="./images/report-10.png" height="300px" width="auto"> <img class="img img-fluid" src="./images/report-10.png" height="300px" width="auto">
<h6 class="mt-4 text-center">Tax Invoice Journal</h6> <h6 class="mt-4 text-center">Tax Invoice Journal</h6>
<hr style="background:#0984e3; border: 2px solid #6c5ce7; width: 50px; margin-top: 5px;"> <hr style="background:#0984e3; border: 2px solid #6c5ce7; width: 50px; margin-top: 5px;">
@ -425,7 +436,7 @@
<section class="oe_container mt-4" style="padding:2rem 3rem 1rem"> <section class="oe_container mt-4" style="padding:2rem 3rem 1rem">
<h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Screenshots</h5> <h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Screenshots</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" />
<section class="oe_container"> <section class="oe_container">
<div id="demo" class="row carousel slide mb32" data-ride="carousel"> <div id="demo" class="row carousel slide mb32" data-ride="carousel">
<div class="carousel-inner"> <div class="carousel-inner">
@ -610,7 +621,7 @@
<section class="oe_container mt-4" style="padding:2rem 3rem 1rem"> <section class="oe_container mt-4" style="padding:2rem 3rem 1rem">
<h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Suggested Products</h5> <h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Suggested Products</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" />
<div id="demo1" class="row carousel slide" data-ride="carousel"> <div id="demo1" class="row carousel slide" data-ride="carousel">
<!-- The slideshow --> <!-- The slideshow -->
<div class="carousel-inner"> <div class="carousel-inner">
@ -636,7 +647,7 @@
<div style="border-radius:10px"> <div style="border-radius:10px">
<img class="img img-responsive center-block" <img class="img img-responsive center-block"
style="border-top-left-radius:10px; border-top-right-radius:10px" style="border-top-left-radius:10px; border-top-right-radius:10px"
src="./images/xslx_image.png"> src="./images/xlsx_image.png">
</div> </div>
</a></div> </a></div>
</div> </div>
@ -683,7 +694,7 @@
<div class="row"> <div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> <div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Our Services</h5> <h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Our Services</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" />
</div> </div>
<div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4"> <div class="col-lg-4 d-flex flex-column justify-content-center align-items-center my-4">
@ -780,14 +791,14 @@
</div> </div>
</div> </div>
</section> </section>
<!-- END OF END OF OUR SERVICES --> <!-- END OF OUR SERVICES -->
<!-- OUR INDUSTRIES --> <!-- OUR INDUSTRIES -->
<section class="container" style="margin-top: 6rem !important;"> <section class="container" style="margin-top: 6rem !important;">
<div class="row"> <div class="row">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> <div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Our Industries</h5> <h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Our Industries</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" />
</div> </div>
<div class="col-lg-3"> <div class="col-lg-3">
@ -902,7 +913,7 @@
</div> </div>
</section> </section>
<!-- END OF END OF OUR INDUSTRIES --> <!-- END OF OUR INDUSTRIES -->
<!-- FOOTER --> <!-- FOOTER -->
<!-- Footer Section --> <!-- Footer Section -->
@ -910,7 +921,7 @@
<div class="row" style="max-width:1540px;"> <div class="row" style="max-width:1540px;">
<div class="col-lg-12 d-flex flex-column justify-content-center align-items-center"> <div class="col-lg-12 d-flex flex-column justify-content-center align-items-center">
<h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Need Help?</h5> <h5 class="text-center" style="font-family: Montserrat, 'sans-serif';">Need Help?</h5>
<hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" ;> <hr style="background-color: #0984e3; border: 2px solid #0984e3; width: 50px;" />
</div> </div>
</div> </div>

9
base_accounting_kit/views/account_asset_templates.xml

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- <template id="assets_backend" name="account assets" inherit_id="web.assets_backend">-->
<!-- <xpath expr="." position="inside">-->
<!-- <link rel="stylesheet" href="/base_accounting_kit/static/src/scss/account_asset.scss"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/src/js/account_asset.js"/>-->
<!-- </xpath>-->
<!-- </template>-->
</odoo>

18
base_accounting_kit/views/assets.xml

@ -1,18 +0,0 @@
<odoo>
<!-- <template id="assets_invoice_dashboard" name="Invoice Dashboard" inherit_id="web.assets_backend">-->
<!-- <xpath expr="." position="inside">-->
<!-- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"/>-->
<!-- <link rel="stylesheet" type="text/scss" href="/base_accounting_kit/static/src/scss/style.scss"/>-->
<!-- <link rel="stylesheet" type="text/scss" href="/base_accounting_kit/static/lib/bootstrap-toggle-master/css/bootstrap-toggle.min.css"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/src/js/account_dashboard.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/src/js/payment_model.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/src/js/payment_render.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/src/js/payment_matching.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/lib/Chart.bundle.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/lib/Chart.bundle.min.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/lib/Chart.min.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/lib/Chart.js"/>-->
<!-- <script type="text/javascript" src="/base_accounting_kit/static/lib/bootstrap-toggle-master/js/bootstrap-toggle.min.js"/>-->
<!-- </xpath>-->
<!-- </template>-->
</odoo>

1
base_accounting_kit/wizard/__init__.py

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
############################################################################# #############################################################################
# #
# Cybrosys Technologies Pvt. Ltd. # Cybrosys Technologies Pvt. Ltd.

84
base_accounting_kit/wizard/account_bank_book_wizard.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
from datetime import date from datetime import date
from odoo import models, fields, api, _ from odoo import api, fields, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
@ -29,12 +29,12 @@ class BankBookWizard(models.TransientModel):
_name = 'account.bank.book.report' _name = 'account.bank.book.report'
_description = 'Account Bank Book Report' _description = 'Account Bank Book Report'
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one(
readonly=True, 'res.company', string='Company', readonly=True,
default=lambda self: self.env.company) default=lambda self: self.env.company)
target_move = fields.Selection([('posted', 'All Posted Entries'), target_move = fields.Selection(
('all', 'All Entries')], string='Target Moves', required=True, [('posted', 'All Posted Entries'), ('all', 'All Entries')],
default='posted') string='Target Moves', required=True, default='posted')
date_from = fields.Date(string='Start Date', default=date.today(), date_from = fields.Date(string='Start Date', default=date.today(),
required=True) required=True)
date_to = fields.Date(string='End Date', default=date.today(), date_to = fields.Date(string='End Date', default=date.today(),
@ -47,27 +47,27 @@ class BankBookWizard(models.TransientModel):
[('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], [('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')],
string='Sort by', string='Sort by',
required=True, default='sort_date') required=True, default='sort_date')
initial_balance = fields.Boolean(string='Include Initial Balances', initial_balance = fields.Boolean(
help='If you selected date, this field allow you to add a row to display the amount of debit/credit/balance that precedes the filter you\'ve set.') string='Include Initial Balances',
help='If you selected date, this field allow you to add a row to '
'display the amount of debit/credit/balance that precedes the '
'filter you\'ve set.')
def _get_default_account_ids(self): def _get_default_account_ids(self):
journals = self.env['account.journal'].search([('type', '=', 'bank')]) journals = self.env['account.journal'].search([('type', '=', 'bank')])
accounts = [] accounts = []
for journal in journals: for journal in journals:
accounts.append(journal.company_id.account_journal_payment_credit_account_id.id) accounts.append(
journal.company_id.account_journal_payment_credit_account_id.id)
return accounts return accounts
account_ids = fields.Many2many('account.account', account_ids = fields.Many2many(
'account_report_bankbook_account_rel', 'account.account', 'account_report_bankbook_account_rel', 'report_id',
'report_id', 'account_id', 'account_id', string='Accounts', default=_get_default_account_ids)
'Accounts', journal_ids = fields.Many2many(
default=_get_default_account_ids) 'account.journal', 'account_report_bankbook_journal_rel', 'account_id',
journal_ids = fields.Many2many('account.journal', 'journal_id', string='Journals', required=True,
'account_report_bankbook_journal_rel', default=lambda self: self.env['account.journal'].search([]))
'account_id', 'journal_id',
string='Journals', required=True,
default=lambda self: self.env[
'account.journal'].search([]))
@api.onchange('account_ids') @api.onchange('account_ids')
def onchange_account_ids(self): def onchange_account_ids(self):
@ -81,31 +81,31 @@ class BankBookWizard(models.TransientModel):
return {'domain': domain} return {'domain': domain}
def _build_contexts(self, data): def _build_contexts(self, data):
result = {} return {
result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][ 'journal_ids': data.get('form', {}).get(
'journal_ids'] or False 'journal_ids', False) or False,
result['state'] = 'target_move' in data['form'] and data['form'][ 'state': data.get('form', {}).get('target_move', '') or '',
'target_move'] or '' 'date_from': data.get('form', {}).get('date_from', False) or False,
result['date_from'] = data['form']['date_from'] or False 'date_to': data.get('form', {}).get('date_to', False) or False,
result['date_to'] = data['form']['date_to'] or False 'strict_range': True if data.get('form', {}).get(
result['strict_range'] = True if result['date_from'] else False 'date_from', False) else False
return result }
def check_report(self): def check_report(self):
self.ensure_one() self.ensure_one()
if self.initial_balance and not self.date_from: if self.initial_balance and not self.date_from:
raise UserError(_("You must choose a Start Date")) raise UserError(_("You must choose a Start Date"))
data = {} data = {
data['ids'] = self.env.context.get('active_ids', []) 'ids': self.env.context.get('active_ids', []),
data['model'] = self.env.context.get('active_model', 'ir.ui.menu') 'model': self.env.context.get('active_model', 'ir.ui.menu'),
data['form'] = self.read( 'form': self.read(
['date_from', 'date_to', 'journal_ids', 'target_move', ['date_from', 'date_to', 'journal_ids', 'target_move',
'display_account', 'display_account', 'account_ids', 'sortby',
'account_ids', 'sortby', 'initial_balance'])[0] 'initial_balance'])[0]
}
used_context = self._build_contexts(data) used_context = self._build_contexts(data)
data['form']['used_context'] = dict(used_context, data['form']['used_context'] = dict(
lang=self.env.context.get( used_context, lang=self.env.context.get('lang') or 'en_US')
'lang') or 'en_US')
return self.env.ref( return self.env.ref(
'base_accounting_kit.action_report_bank_book').report_action(self, 'base_accounting_kit.action_report_bank_book').report_action(
data=data) self, data=data)

26
base_accounting_kit/wizard/account_cash_book_wizard.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
from datetime import date from datetime import date
from odoo import models, fields, api, _ from odoo import api, fields, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
@ -32,9 +32,9 @@ class CashBookWizard(models.TransientModel):
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one('res.company', string='Company',
readonly=True, readonly=True,
default=lambda self: self.env.company) default=lambda self: self.env.company)
target_move = fields.Selection([('posted', 'All Posted Entries'), target_move = fields.Selection(
('all', 'All Entries')], string='Target Moves', required=True, [('posted', 'All Posted Entries'), ('all', 'All Entries')],
default='posted') string='Target Moves', required=True, default='posted')
date_from = fields.Date(string='Start Date', default=date.today(), date_from = fields.Date(string='Start Date', default=date.today(),
required=True) required=True)
date_to = fields.Date(string='End Date', default=date.today(), date_to = fields.Date(string='End Date', default=date.today(),
@ -57,17 +57,13 @@ class CashBookWizard(models.TransientModel):
accounts.append(journal.company_id.account_journal_payment_credit_account_id.id) accounts.append(journal.company_id.account_journal_payment_credit_account_id.id)
return accounts return accounts
account_ids = fields.Many2many('account.account', account_ids = fields.Many2many(
'account_report_cashbook_account_rel', 'account.account', 'account_report_cashbook_account_rel', 'report_id',
'report_id', 'account_id', 'account_id', string='Accounts', default=_get_default_account_ids)
'Accounts', journal_ids = fields.Many2many(
default=_get_default_account_ids) 'account.journal', 'account_report_cashbook_journal_rel', 'account_id',
journal_ids = fields.Many2many('account.journal', 'journal_id', string='Journals', required=True,
'account_report_cashbook_journal_rel', default=lambda self: self.env['account.journal'].search([]))
'account_id', 'journal_id',
string='Journals', required=True,
default=lambda self: self.env[
'account.journal'].search([]))
@api.onchange('account_ids') @api.onchange('account_ids')
def onchange_account_ids(self): def onchange_account_ids(self):

69
base_accounting_kit/wizard/account_day_book_wizard.py

@ -21,57 +21,52 @@
############################################################################# #############################################################################
from datetime import date from datetime import date
from odoo import models, fields from odoo import fields, models
class DayBookWizard(models.TransientModel): class DayBookWizard(models.TransientModel):
_name = 'account.day.book.report' _name = 'account.day.book.report'
_description = 'Account Day Book Report' _description = 'Account Day Book Report'
company_id = fields.Many2one('res.company', string='Company', company_id = fields.Many2one(
readonly=True, 'res.company', string='Company', readonly=True,
default=lambda self: self.env.company) default=lambda self: self.env.company)
journal_ids = fields.Many2many('account.journal', string='Journals', journal_ids = fields.Many2many(
required=True, 'account.journal', string='Journals', required=True,
default=lambda self: self.env[ default=lambda self: self.env['account.journal'].search([]))
'account.journal'].search([])) target_move = fields.Selection(
target_move = fields.Selection([('posted', 'All Posted Entries'), [('posted', 'All Posted Entries'), ('all', 'All Entries')],
('all', 'All Entries')], string='Target Moves', required=True, string='Target Moves', required=True, default='posted')
default='posted') account_ids = fields.Many2many(
'account.account', 'account_report_daybook_account_rel', 'report_id',
account_ids = fields.Many2many('account.account', 'account_id', string='Accounts')
'account_report_daybook_account_rel',
'report_id', 'account_id',
'Accounts')
date_from = fields.Date(string='Start Date', default=date.today(), date_from = fields.Date(string='Start Date', default=date.today(),
required=True) required=True)
date_to = fields.Date(string='End Date', default=date.today(), date_to = fields.Date(string='End Date', default=date.today(),
required=True) required=True)
def _build_contexts(self, data): def _build_contexts(self, data):
result = {} return {
result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][ 'journal_ids': data.get('form', {}).get(
'journal_ids'] or False 'journal_ids', False) or False,
result['state'] = 'target_move' in data['form'] and data['form'][ 'state': data.get('form', {}).get('target_move', '') or '',
'target_move'] or '' 'date_from': data.get('form', {}).get('date_from', False) or False,
result['date_from'] = data['form']['date_from'] or False 'date_to': data.get('form', {}).get('date_to', False) or False,
result['date_to'] = data['form']['date_to'] or False 'strict_range': True if data.get('form', {}).get(
result['strict_range'] = True if result['date_from'] else False 'date_from', False) else False
return result }
def check_report(self): def check_report(self):
self.ensure_one() self.ensure_one()
data = {} data = {
data['ids'] = self.env.context.get('active_ids', []) 'ids': self.env.context.get('active_ids', []),
data['model'] = self.env.context.get('active_model', 'ir.ui.menu') 'model': self.env.context.get('active_model', 'ir.ui.menu'),
data['form'] = \ 'form': self.read(['date_from', 'date_to', 'journal_ids',
self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'target_move', 'account_ids'])[0]
'account_ids'])[0] }
used_context = self._build_contexts(data) used_context = self._build_contexts(data)
data['form']['used_context'] = dict(used_context, data['form']['used_context'] = dict(
lang=self.env.context.get( used_context, lang=self.env.context.get('lang') or 'en_US')
'lang') or 'en_US')
return self.env.ref( return self.env.ref(
'base_accounting_kit.day_book_pdf_report').report_action(self, 'base_accounting_kit.day_book_pdf_report').report_action(
data=data) self, data=data)

18
base_accounting_kit/wizard/account_lock_date.py

@ -29,14 +29,16 @@ class AccountUpdateLockDate(models.TransientModel):
company_id = fields.Many2one(comodel_name='res.company', string="Company", company_id = fields.Many2one(comodel_name='res.company', string="Company",
required=True) required=True)
period_lock_date = fields.Date(string="Lock Date for Non-Advisers", period_lock_date = fields.Date(
help="Only users with the 'Adviser' role can edit accounts prior to " string="Lock Date for Non-Advisers",
"and inclusive of this date. Use it for period locking inside an " help="Only users with the 'Adviser' role can edit accounts prior to"
"open fiscal year, for example.") "and inclusive of this date. Use it for period locking inside an "
fiscalyear_lock_date = fields.Date(string="Lock Date", "open fiscal year, for example.")
help="No users, including Advisers, can edit accounts prior to and " fiscalyear_lock_date = fields.Date(
"inclusive of this date. Use it for fiscal year locking for " string="Lock Date",
"example.") help="No users, including Advisers, can edit accounts prior to and "
"inclusive of this date. Use it for fiscal year locking for "
"example.")
@api.model @api.model
def default_get(self, field_list): def default_get(self, field_list):

11
base_accounting_kit/wizard/account_report_common_partner.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import fields, models from odoo import fields, models
@ -28,12 +27,10 @@ class AccountingCommonPartnerReport(models.TransientModel):
_description = 'Account Common Partner Report' _description = 'Account Common Partner Report'
_inherit = "account.common.report" _inherit = "account.common.report"
result_selection = fields.Selection([('customer', 'Receivable Accounts'), result_selection = fields.Selection(
('supplier', 'Payable Accounts'), [('customer', 'Receivable Accounts'), ('supplier', 'Payable Accounts'),
('customer_supplier', ('customer_supplier', 'Receivable and Payable Accounts')],
'Receivable and Payable Accounts') string="Partner's", required=True, default='customer')
], string="Partner's", required=True,
default='customer')
def pre_print_report(self, data): def pre_print_report(self, data):
data['form'].update(self.read(['result_selection'])[0]) data['form'].update(self.read(['result_selection'])[0])

5
base_accounting_kit/wizard/aged_partner.py

@ -19,9 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
import time import time
from dateutil.relativedelta import relativedelta from dateutil.relativedelta import relativedelta
from odoo import fields, models, _ from odoo import fields, models, _
@ -40,7 +38,6 @@ class AccountAgedTrialBalance(models.TransientModel):
date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d')) date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d'))
def _print_report(self, data): def _print_report(self, data):
res = {} res = {}
data = self.pre_print_report(data) data = self.pre_print_report(data)
data['form'].update(self.read(['period_length'])[0]) data['form'].update(self.read(['period_length'])[0])
@ -49,9 +46,7 @@ class AccountAgedTrialBalance(models.TransientModel):
raise UserError(_('You must set a period length greater than 0.')) raise UserError(_('You must set a period length greater than 0.'))
if not data['form']['date_from']: if not data['form']['date_from']:
raise UserError(_('You must set a start date.')) raise UserError(_('You must set a start date.'))
start = data['form']['date_from'] start = data['form']['date_from']
for i in range(5)[::-1]: for i in range(5)[::-1]:
stop = start - relativedelta(days=period_length - 1) stop = start - relativedelta(days=period_length - 1)
res[str(i)] = { res[str(i)] = {

1
base_accounting_kit/wizard/aged_partner.xml

@ -13,7 +13,6 @@
<field name="result_selection" widget="radio"/> <field name="result_selection" widget="radio"/>
<field name="target_move" widget="radio"/> <field name="target_move" widget="radio"/>
</group> </group>
<!-- <field name="journal_ids" required="0" invisible="1"/>-->
<footer> <footer>
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/> <button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
<button string="Cancel" class="btn btn-default" special="cancel"/> <button string="Cancel" class="btn btn-default" special="cancel"/>

16
base_accounting_kit/wizard/asset_depreciation_confirmation_wizard.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import api, fields, models, _ from odoo import api, fields, models, _
@ -27,18 +26,25 @@ class AssetDepreciationConfirmationWizard(models.TransientModel):
_name = "asset.depreciation.confirmation.wizard" _name = "asset.depreciation.confirmation.wizard"
_description = "asset.depreciation.confirmation.wizard" _description = "asset.depreciation.confirmation.wizard"
date = fields.Date('Account Date', required=True, help="Choose the period for which you want to automatically post the depreciation lines of running assets", default=fields.Date.context_today) date = fields.Date(
'Account Date', required=True, default=fields.Date.context_today,
help="Choose the period for which you want to automatically post the "
"depreciation lines of running assets")
def asset_compute(self): def asset_compute(self):
self.ensure_one() self.ensure_one()
context = self._context context = self._context
created_move_ids = self.env['account.asset.asset'].compute_generated_entries(self.date, asset_type=context.get('asset_type')) created_move_ids = self.env[
'account.asset.asset'].compute_generated_entries(
self.date, asset_type=context.get('asset_type'))
return { return {
'name': _('Created Asset Moves') if context.get('asset_type') == 'purchase' else _('Created Revenue Moves'), 'name': _('Created Asset Moves') if context.get(
'asset_type') == 'purchase' else _('Created Revenue Moves'),
'view_mode': 'tree,form', 'view_mode': 'tree,form',
'res_model': 'account.move', 'res_model': 'account.move',
'view_id': False, 'view_id': False,
'domain': "[('id','in',[" + ','.join(str(id) for id in created_move_ids) + "])]", 'domain': "[('id','in',[" + ','.join(
str(id) for id in created_move_ids) + "])]",
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
} }

34
base_accounting_kit/wizard/asset_modify.py

@ -19,10 +19,10 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from lxml import etree from lxml import etree
from odoo import api, fields, models, _ from odoo import api, fields, models, _
from odoo.addons.base.models.ir_ui_view import ( from odoo.addons.base.models.ir_ui_view import (
transfer_field_to_modifiers, transfer_node_to_modifiers, transfer_modifiers_to_node, transfer_field_to_modifiers, transfer_node_to_modifiers, transfer_modifiers_to_node,
) )
@ -42,29 +42,36 @@ class AssetModify(models.TransientModel):
_description = 'Modify Asset' _description = 'Modify Asset'
name = fields.Text(string='Reason', required=True) name = fields.Text(string='Reason', required=True)
method_number = fields.Integer(string='Number of Depreciations', required=True) method_number = fields.Integer(
string='Number of Depreciations', required=True)
method_period = fields.Integer(string='Period Length') method_period = fields.Integer(string='Period Length')
method_end = fields.Date(string='Ending date') method_end = fields.Date(string='Ending date')
asset_method_time = fields.Char(compute='_get_asset_method_time', string='Asset Method Time', readonly=True) asset_method_time = fields.Char(
compute='_get_asset_method_time', string='Asset Method Time',
readonly=True)
def _get_asset_method_time(self): def _get_asset_method_time(self):
if self.env.context.get('active_id'): if self.env.context.get('active_id'):
asset = self.env['account.asset.asset'].browse(self.env.context.get('active_id')) asset = self.env['account.asset.asset'].browse(
self.env.context.get('active_id'))
self.asset_method_time = asset.method_time self.asset_method_time = asset.method_time
@api.model @api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False): def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
result = super(AssetModify, self).fields_view_get(view_id, view_type, toolbar=toolbar, submenu=submenu) result = super(AssetModify, self).fields_view_get(
view_id, view_type, toolbar=toolbar, submenu=submenu)
asset_id = self.env.context.get('active_id') asset_id = self.env.context.get('active_id')
active_model = self.env.context.get('active_model') active_model = self.env.context.get('active_model')
if active_model == 'account.asset.asset' and asset_id: if active_model == 'account.asset.asset' and asset_id:
asset = self.env['account.asset.asset'].browse(asset_id) asset = self.env['account.asset.asset'].browse(asset_id)
doc = etree.XML(result['arch']) doc = etree.XML(result['arch'])
if asset.method_time == 'number' and doc.xpath("//field[@name='method_end']"): if asset.method_time == 'number' and doc.xpath(
"//field[@name='method_end']"):
node = doc.xpath("//field[@name='method_end']")[0] node = doc.xpath("//field[@name='method_end']")[0]
node.set('invisible', '1') node.set('invisible', '1')
setup_modifiers(node, result['fields']['method_end']) setup_modifiers(node, result['fields']['method_end'])
elif asset.method_time == 'end' and doc.xpath("//field[@name='method_number']"): elif asset.method_time == 'end' and doc.xpath(
"//field[@name='method_number']"):
node = doc.xpath("//field[@name='method_number']")[0] node = doc.xpath("//field[@name='method_number']")[0]
node.set('invisible', '1') node.set('invisible', '1')
setup_modifiers(node, result['fields']['method_number']) setup_modifiers(node, result['fields']['method_number'])
@ -85,7 +92,8 @@ class AssetModify(models.TransientModel):
if 'method_end' in fields and asset.method_time == 'end': if 'method_end' in fields and asset.method_time == 'end':
res.update({'method_end': asset.method_end}) res.update({'method_end': asset.method_end})
if self.env.context.get('active_id'): if self.env.context.get('active_id'):
active_asset = self.env['account.asset.asset'].browse(self.env.context.get('active_id')) active_asset = self.env['account.asset.asset'].browse(
self.env.context.get('active_id'))
res['asset_method_time'] = active_asset.method_time res['asset_method_time'] = active_asset.method_time
return res return res
@ -107,8 +115,12 @@ class AssetModify(models.TransientModel):
} }
asset.write(asset_vals) asset.write(asset_vals)
asset.compute_depreciation_board() asset.compute_depreciation_board()
tracked_fields = self.env['account.asset.asset'].fields_get(['method_number', 'method_period', 'method_end']) tracked_fields = self.env['account.asset.asset'].fields_get(
changes, tracking_value_ids = asset._mail_track(tracked_fields, old_values) ['method_number', 'method_period', 'method_end'])
changes, tracking_value_ids = asset._mail_track(
tracked_fields, old_values)
if changes: if changes:
asset.message_post(subject=_('Depreciation board modified'), body=self.name, tracking_value_ids=tracking_value_ids) asset.message_post(
subject=_('Depreciation board modified'), body=self.name,
tracking_value_ids=tracking_value_ids)
return {'type': 'ir.actions.act_window_close'} return {'type': 'ir.actions.act_window_close'}

42
base_accounting_kit/wizard/cash_flow_report.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import api, fields, models from odoo import api, fields, models
@ -39,27 +38,30 @@ class AccountingReport(models.TransientModel):
return reports and reports[0] or False return reports and reports[0] or False
enable_filter = fields.Boolean(string='Enable Comparison') enable_filter = fields.Boolean(string='Enable Comparison')
account_report_id = fields.Many2one('account.financial.report', account_report_id = fields.Many2one(
string='Account Reports', 'account.financial.report', string='Account Reports', required=True,
required=True, default=_get_account_report)
default=_get_account_report) label_filter = fields.Char(
label_filter = fields.Char(string='Column Label', string='Column Label',
help="This label will be displayed on report to show the balance" help="This label will be displayed on report to show the balance "
" computed for the given comparison filter.") "computed for the given comparison filter.")
filter_cmp = fields.Selection( filter_cmp = fields.Selection(
[('filter_no', 'No Filters'), ('filter_date', 'Date')], [('filter_no', 'No Filters'), ('filter_date', 'Date')],
string='Filter by', required=True, default='filter_no') string='Filter by', required=True, default='filter_no')
date_from_cmp = fields.Date(string='Date Start') date_from_cmp = fields.Date(string='Date Start')
date_to_cmp = fields.Date(string='Date End') date_to_cmp = fields.Date(string='Date End')
debit_credit = fields.Boolean(string='Display Debit/Credit Columns', debit_credit = fields.Boolean(
help="This option allows you to get more details about the way your balances are computed. Because it is space consuming, we do not allow to use it while doing a comparison.") string='Display Debit/Credit Columns',
help="This option allows you to get more details about the way your "
"balances are computed. Because it is space consuming, we do not "
"allow to use it while doing a comparison.")
def _build_comparison_context(self, data): def _build_comparison_context(self, data):
result = {} result = {
result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][ 'journal_ids': data.get('form', {}).get(
'journal_ids'] or False 'journal_ids', False) or False,
result['state'] = 'target_move' in data['form'] and data['form'][ 'state': data.get('form', {}).get('target_move', '') or '',
'target_move'] or '' }
if data['form']['filter_cmp'] == 'filter_date': if data['form']['filter_cmp'] == 'filter_date':
result['date_from'] = data['form']['date_from_cmp'] result['date_from'] = data['form']['date_from_cmp']
result['date_to'] = data['form']['date_to_cmp'] result['date_to'] = data['form']['date_to_cmp']
@ -69,10 +71,9 @@ class AccountingReport(models.TransientModel):
# @api.multi # @api.multi
def check_report(self): def check_report(self):
res = super(AccountingReport, self).check_report() res = super(AccountingReport, self).check_report()
data = {} data = {'form': self.read(
data['form'] = self.read(
['account_report_id', 'date_from_cmp', 'date_to_cmp', ['account_report_id', 'date_from_cmp', 'date_to_cmp',
'journal_ids', 'filter_cmp', 'target_move'])[0] 'journal_ids', 'filter_cmp', 'target_move'])[0]}
for field in ['account_report_id']: for field in ['account_report_id']:
if isinstance(data['form'][field], tuple): if isinstance(data['form'][field], tuple):
data['form'][field] = data['form'][field][0] data['form'][field] = data['form'][field][0]
@ -86,6 +87,5 @@ class AccountingReport(models.TransientModel):
'account_report_id', 'enable_filter', 'label_filter', 'account_report_id', 'enable_filter', 'label_filter',
'target_move'])[0]) 'target_move'])[0])
return self.env.ref( return self.env.ref(
'base_accounting_kit.action_report_cash_flow').report_action(self, 'base_accounting_kit.action_report_cash_flow').report_action(
data=data, self, data=data, config=False)
config=False)

77
base_accounting_kit/wizard/financial_report.py

@ -21,7 +21,7 @@
############################################################################# #############################################################################
import re import re
from odoo import api, models, fields from odoo import api, fields, models
class FinancialReport(models.TransientModel): class FinancialReport(models.TransientModel):
@ -29,11 +29,9 @@ class FinancialReport(models.TransientModel):
_inherit = "account.common.report" _inherit = "account.common.report"
_description = "Financial Reports" _description = "Financial Reports"
view_format = fields.Selection([ view_format = fields.Selection([('vertical', 'Vertical'),
('vertical', 'Vertical'), ('horizontal', 'Horizontal')],
('horizontal', 'Horizontal')], default='vertical', string="Format")
default='vertical',
string="Format")
@api.model @api.model
def _get_account_report(self): def _get_account_report(self):
@ -45,29 +43,18 @@ class FinancialReport(models.TransientModel):
('name', 'ilike', menu)]) ('name', 'ilike', menu)])
return reports and reports[0] or False return reports and reports[0] or False
enable_filter = fields.Boolean( enable_filter = fields.Boolean(string='Enable Comparison', default=False)
string='Enable Comparison',
default=False)
account_report_id = fields.Many2one( account_report_id = fields.Many2one(
'account.financial.report', 'account.financial.report', string='Account Reports', required=True)
string='Account Reports',
required=True)
date_from = fields.Date(string='Start Date') date_from = fields.Date(string='Start Date')
date_to = fields.Date(string='End Date') date_to = fields.Date(string='End Date')
debit_credit = fields.Boolean( debit_credit = fields.Boolean(
string='Display Debit/Credit Columns', string='Display Debit/Credit Columns', default=True,
default=True, help="This option allows you to get more details about the way your "
help="This option allows you to" "balances are computed. Because it is space consuming, we do not "
" get more details about the " "allow to use it while doing a comparison.")
"way your balances are computed."
" Because it is space consuming,"
" we do not allow to use it "
"while doing a comparison.")
company_id = fields.Many2one( company_id = fields.Many2one(
'res.company', 'res.company', string='Company', index=True,
string='Company',
index=True,
default=lambda self: self.env.company.id) default=lambda self: self.env.company.id)
def view_report_pdf(self): def view_report_pdf(self):
@ -75,18 +62,17 @@ class FinancialReport(models.TransientModel):
from the wizard. Based on the values provided in the wizard, this from the wizard. Based on the values provided in the wizard, this
function will print pdf report""" function will print pdf report"""
self.ensure_one() self.ensure_one()
data = dict() data = {
data['ids'] = self.env.context.get('active_ids', []) 'ids': self.env.context.get('active_ids', []),
data['model'] = self.env.context.get('active_model', 'ir.ui.menu') 'model': self.env.context.get('active_model', 'ir.ui.menu'),
data['form'] = self.read( 'form': self.read(
['date_from', 'enable_filter', 'debit_credit', 'date_to', ['date_from', 'enable_filter', 'debit_credit', 'date_to',
'account_report_id', 'target_move', 'view_format', 'account_report_id', 'target_move', 'view_format',
'company_id'])[0] 'company_id'])[0]
}
used_context = self._build_contexts(data) used_context = self._build_contexts(data)
data['form']['used_context'] = dict( data['form']['used_context'] = dict(
used_context, used_context, lang=self.env.context.get('lang') or 'en_US')
lang=self.env.context.get('lang') or 'en_US')
report_lines = self.get_account_lines(data['form']) report_lines = self.get_account_lines(data['form'])
# find the journal items of these accounts # find the journal items of these accounts
journal_items = self.find_journal_items(report_lines, data['form']) journal_items = self.find_journal_items(report_lines, data['form'])
@ -137,8 +123,7 @@ class FinancialReport(models.TransientModel):
res = {} res = {}
for account in accounts: for account in accounts:
res[account.id] = dict((fn, 0.0) res[account.id] = dict((fn, 0.0) for fn in mapping.keys())
for fn in mapping.keys())
if accounts: if accounts:
tables, where_clause, where_params = ( tables, where_clause, where_params = (
self.env['account.move.line']._query_get()) self.env['account.move.line']._query_get())
@ -150,10 +135,8 @@ class FinancialReport(models.TransientModel):
filters = " AND ".join(wheres) filters = " AND ".join(wheres)
request = ("SELECT account_id as id, " + request = ("SELECT account_id as id, " +
', '.join(mapping.values()) + ', '.join(mapping.values()) +
" FROM " + tables + " FROM " + tables + " WHERE account_id IN %s " +
" WHERE account_id IN %s " + filters + " GROUP BY account_id")
filters +
" GROUP BY account_id")
params = (tuple(accounts._ids),) + tuple(where_params) params = (tuple(accounts._ids),) + tuple(where_params)
self.env.cr.execute(request, params) self.env.cr.execute(request, params)
for row in self.env.cr.dictfetchall(): for row in self.env.cr.dictfetchall():
@ -181,15 +164,14 @@ class FinancialReport(models.TransientModel):
res[report.id]['account'] = self._compute_account_balance( res[report.id]['account'] = self._compute_account_balance(
report.account_ids report.account_ids
) )
for value in \ for value in res[report.id]['account'].values():
res[report.id]['account'].values():
for field in fields: for field in fields:
res[report.id][field] += value.get(field) res[report.id][field] += value.get(field)
elif report.type == 'account_type': elif report.type == 'account_type':
# it's the sum the leaf accounts # it's the sum the leaf accounts
# with such an account type # with such an account type
accounts = self.env['account.account'].search([ accounts = self.env['account.account'].search([
('user_type_id', 'in', report.account_type_ids.ids)]) ('user_type_id', 'in', report.account_type_ids.ids)])
res[report.id]['account'] = self._compute_account_balance( res[report.id]['account'] = self._compute_account_balance(
accounts) accounts)
for value in res[report.id]['account'].values(): for value in res[report.id]['account'].values():
@ -223,20 +205,17 @@ class FinancialReport(models.TransientModel):
res[report_id]['comp_bal'] = value['balance'] res[report_id]['comp_bal'] = value['balance']
report_acc = res[report_id].get('account') report_acc = res[report_id].get('account')
if report_acc: if report_acc:
for account_id, val in \ for account_id, val in comparison_res[report_id].get(
comparison_res[report_id].get('account').items(): 'account').items():
report_acc[account_id]['comp_bal'] = val['balance'] report_acc[account_id]['comp_bal'] = val['balance']
for report in child_reports: for report in child_reports:
r_name = str(report.name) r_name = str(report.name)
# r_name = r_name.replace(" ", "-") + "-"
r_name = re.sub('[^0-9a-zA-Z]+', '', r_name) r_name = re.sub('[^0-9a-zA-Z]+', '', r_name)
if report.parent_id: if report.parent_id:
p_name = str(report.parent_id.name) p_name = str(report.parent_id.name)
p_name = re.sub('[^0-9a-zA-Z]+', '', p_name) + str( p_name = re.sub('[^0-9a-zA-Z]+', '', p_name) + str(
report.parent_id.id) report.parent_id.id)
# p_name = p_name.replace(" ", "-") +
# "-" + str(report.parent_id.id)
else: else:
p_name = False p_name = False
vals = { vals = {
@ -280,8 +259,6 @@ class FinancialReport(models.TransientModel):
# financial reports for Assets, liabilities...) # financial reports for Assets, liabilities...)
flag = False flag = False
account = self.env['account.account'].browse(account_id) account = self.env['account.account'].browse(account_id)
# new_r_name = str(report.name)
# new_r_name = new_r_name.replace(" ", "-") + "-"
vals = { vals = {
'account': account.id, 'account': account.id,
'a_id': account.code + re.sub('[^0-9a-zA-Z]+', 'acnt', 'a_id': account.code + re.sub('[^0-9a-zA-Z]+', 'acnt',

19
base_accounting_kit/wizard/general_ledger.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import fields, models, _ from odoo import fields, models, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
@ -29,19 +28,17 @@ class AccountReportGeneralLedger(models.TransientModel):
_name = "account.report.general.ledger" _name = "account.report.general.ledger"
_description = "General Ledger Report" _description = "General Ledger Report"
initial_balance = fields.Boolean(string='Include Initial Balances', initial_balance = fields.Boolean(
help='If you selected date, this field ' string='Include Initial Balances',
'allow you to add a row to display ' help='If you selected date, this field allow you to add a row to '
'the amount of debit/credit/balance ' 'display the amount of debit/credit/balance that precedes the '
'that precedes the filter you\'ve ' 'filter you\'ve set.')
'set.')
sortby = fields.Selection( sortby = fields.Selection(
[('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')], [('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')],
string='Sort by', required=True, default='sort_date') string='Sort by', required=True, default='sort_date')
journal_ids = fields.Many2many('account.journal', journal_ids = fields.Many2many(
'account_report_general_ledger_journal_rel', 'account.journal', 'account_report_general_ledger_journal_rel',
'account_id', 'journal_id', 'account_id', 'journal_id', string='Journals', required=True)
string='Journals', required=True)
def _print_report(self, data): def _print_report(self, data):
data = self.pre_print_report(data) data = self.pre_print_report(data)

10
base_accounting_kit/wizard/journal_audit.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import fields, models from odoo import fields, models
@ -31,11 +30,10 @@ class AccountPrintJournal(models.TransientModel):
sort_selection = fields.Selection( sort_selection = fields.Selection(
[('date', 'Date'), ('move_name', 'Journal Entry Number')], [('date', 'Date'), ('move_name', 'Journal Entry Number')],
'Entries Sorted by', required=True, default='move_name') 'Entries Sorted by', required=True, default='move_name')
journal_ids = fields.Many2many('account.journal', string='Journals', journal_ids = fields.Many2many(
required=True, 'account.journal', string='Journals', required=True,
default=lambda self: self.env[ default=lambda self: self.env['account.journal'].search(
'account.journal'].search( [('type', 'in', ['sale', 'purchase'])]))
[('type', 'in', ['sale', 'purchase'])]))
def _print_report(self, data): def _print_report(self, data):
data = self.pre_print_report(data) data = self.pre_print_report(data)

10
base_accounting_kit/wizard/partner_ledger.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import fields, models from odoo import fields, models
@ -28,10 +27,11 @@ class AccountPartnerLedger(models.TransientModel):
_inherit = "account.common.partner.report" _inherit = "account.common.partner.report"
_description = "Account Partner Ledger" _description = "Account Partner Ledger"
amount_currency = fields.Boolean("With Currency", amount_currency = fields.Boolean(
help="It adds the currency column on report if the " string="With Currency",
"currency differs from the company currency.") help="It adds the currency column on report if the currency differs "
reconciled = fields.Boolean('Reconciled Entries') "from the company currency.")
reconciled = fields.Boolean(string='Reconciled Entries')
def _print_report(self, data): def _print_report(self, data):
data = self.pre_print_report(data) data = self.pre_print_report(data)

1
base_accounting_kit/wizard/tax_report.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import models from odoo import models

9
base_accounting_kit/wizard/trial_balance.py

@ -19,7 +19,6 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from odoo import fields, models from odoo import fields, models
@ -28,11 +27,9 @@ class AccountBalanceReport(models.TransientModel):
_name = 'account.balance.report' _name = 'account.balance.report'
_description = 'Trial Balance Report' _description = 'Trial Balance Report'
journal_ids = fields.Many2many('account.journal', journal_ids = fields.Many2many(
'account_balance_report_journal_rel', 'account.journal', 'account_balance_report_journal_rel', 'account_id',
'account_id', 'journal_id', 'journal_id', string='Journals', required=True, default=[])
string='Journals', required=True,
default=[])
def _print_report(self, data): def _print_report(self, data):
data = self.pre_print_report(data) data = self.pre_print_report(data)

Loading…
Cancel
Save