' % values
- return message
-
- # `message_post` invalidates the (whole) cache
- # preprocess the assets in which messages should be posted,
- # and then post in batch will prevent the re-fetch of the same data over and over.
- assets_to_post = {}
- for line in self:
- if line.move_id and line.move_id.state == 'draft':
- partner_name = line.asset_id.partner_id.name
- currency_name = line.asset_id.currency_id.name
- msg_values = {_('Currency'): currency_name,
- _('Amount'): line.amount}
- if partner_name:
- msg_values[_('Partner')] = partner_name
- msg = _format_message(_('Depreciation line posted.'),
- msg_values)
- assets_to_post.setdefault(line.asset_id, []).append(msg)
- for asset, messages in assets_to_post.items():
- for msg in messages:
- asset.message_post(body=msg)
-
- # def unlink(self):
- # """Check if the depreciation line is linked to a posted move before deletion."""
- # for record in self:
- # if record.move_check:
- # if record.asset_id.category_id.type == 'purchase':
- # msg = _("You cannot delete posted depreciation lines.")
- # else:
- # msg = _("You cannot delete posted installment lines.")
- # raise UserError(msg)
- # return super(AccountAssetDepreciationLine, self).unlink()
diff --git a/addons/base_accounting_kit/models/account_bank_statement_line.py b/addons/base_accounting_kit/models/account_bank_statement_line.py
deleted file mode 100644
index ce97fc9..0000000
--- a/addons/base_accounting_kit/models/account_bank_statement_line.py
+++ /dev/null
@@ -1,170 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models
-from odoo.http import request
-
-
-class AccountBankStatementLine(models.Model):
- """Update the 'rowdata' field for the specified record."""
- _name = 'account.bank.statement.line'
- _inherit = ['account.bank.statement.line', 'mail.thread',
- 'mail.activity.mixin', 'analytic.mixin']
-
- lines_widget = fields.Char(string="Lines Widget")
- account_id = fields.Many2one('account.account', string='Account')
- tax_ids = fields.Many2many('account.tax')
- form_name = fields.Char()
- form_balance = fields.Monetary(currency_field='currency_id')
- rowdata = fields.Json(string="RowData")
- matchRowdata = fields.Json(string="MatchRowData")
- record_id = fields.Integer()
- company_currency_id = fields.Many2one(
- related='company_id.currency_id', readonly=True,
- )
- bank_state = fields.Selection(selection=[('invalid', 'Invalid'),
- ('valid', 'Valid'),
- ('reconciled', 'Reconciled')],
- compute='_compute_state', store=True)
- reconcile_models_widget = fields.Char()
- lines_widget_json = fields.Json(store=True)
-
- @api.model
- def update_rowdata(self, record_id):
- """Update the 'rowdata' field for the specified record."""
- request.session['record_id'] = record_id
-
- @api.model
- def update_match_row_data(self, resId):
- """Update the match row data for a specific record identified by the given resId."""
- request.session['resId'] = resId
- move_record = self.env['account.move.line'].browse(resId)
- move_record_values = {
- 'id': move_record.id,
- 'account_id': move_record.account_id.id,
- 'account_name': move_record.account_id.name,
- 'account_code': move_record.account_id.code,
- 'partner_id': move_record.partner_id,
- 'partner_name': move_record.partner_id.name,
- 'date': move_record.date,
- 'move_id': move_record.move_id,
- 'move_name': move_record.move_id.name,
- 'name': move_record.name,
- 'amount_residual_currency': move_record.amount_residual_currency,
- 'amount_residual': move_record.amount_residual,
- 'currency_id': move_record.currency_id.id,
- 'currency_symbol': move_record.currency_id.symbol
- }
- return move_record_values
-
- def button_validation(self, async_action=False):
- """Ensure the current recordset holds a single record and mark it as reconciled."""
- self.ensure_one()
- self.is_reconciled = True
- return {
- 'type': 'ir.actions.client',
- 'tag': 'reload',
- }
-
- def button_reset(self):
- """Reset the current bank statement line if it is in a 'reconciled' state."""
- self.ensure_one()
- if self.bank_state == 'reconciled':
- self.action_undo_reconciliation()
- return {
- 'type': 'ir.actions.client',
- 'tag': 'reload',
- }
-
- def button_to_check(self, async_action=True):
- """Ensure the current recordset holds a single record, validate the bank
- state, and mark the move as 'to check'."""
- self.ensure_one()
- if self.bank_state == 'valid':
- self.button_validation(async_action=async_action)
- self.move_id.to_check = True
- return {
- 'type': 'ir.actions.client',
- 'tag': 'reload',
- }
-
- def button_set_as_checked(self):
- """Mark the associated move as 'not to check' by setting 'to_check' to False."""
- self.ensure_one()
- self.move_id.to_check = False
- return {
- 'type': 'ir.actions.client',
- 'tag': 'reload',
- }
-
- @api.model
- def get_statement_line(self, record_id):
- """Retrieve and format bank statement line details based on the provided record ID."""
- statement_line_records = self.env[
- 'account.bank.statement.line'].search_read([('id', '=', record_id)])
- result_list = []
- for record in statement_line_records:
- move_id = record.get('move_id', False)
- partner_id = record.get('partner_id', False)
- date = record.get('date', False)
- amount = record.get('amount', False)
- currency_id = record.get('currency_id', False)
- payment_ref = record.get("payment_ref", False)
- bank_state = record.get("bank_state", False)
- id = record.get("id", False)
- if move_id:
- move_record = self.env['account.move.line'].search(
- [('move_id', '=', move_id[0])], limit=1)
- currency_symbol = self.env['res.currency'].browse(
- currency_id[0])
- account_id = move_record.account_id
- date_str = date.strftime('%Y-%m-%d') if date else None
- result_list.append({
- 'id': id,
- 'move_id': move_id,
- 'partner_id': partner_id,
- 'account_id': account_id.id,
- 'account_name': account_id.name,
- 'account_code': account_id.code,
- 'date': date_str,
- 'amount': amount,
- 'currency_symbol': currency_symbol.symbol,
- 'payment_ref': payment_ref,
- 'bank_state': bank_state,
- })
- # Update the account_id for the current record
- self.env['account.bank.statement.line'].browse(
- record['id']).write({'account_id': account_id.id})
- return result_list
-
- @api.depends('account_id')
- def _compute_state(self):
- """Compute the state of bank transactions based on the account's
- reconciliation status and journal settings."""
- for record in self:
- if record.is_reconciled:
- record.bank_state = 'reconciled'
- else:
- suspense_account = record.journal_id.suspense_account_id
- if suspense_account in record.account_id:
- record.bank_state = 'invalid'
- else:
- record.bank_state = 'valid'
diff --git a/addons/base_accounting_kit/models/account_followup.py b/addons/base_accounting_kit/models/account_followup.py
deleted file mode 100644
index 032ae41..0000000
--- a/addons/base_accounting_kit/models/account_followup.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class Followup(models.Model):
- """Model for managing account follow-ups."""
- _name = 'account.followup'
- _description = 'Account Follow-up'
- _rec_name = 'name'
-
- followup_line_ids = fields.One2many('followup.line', 'followup_id',
- 'Follow-up', copy=True)
- company_id = fields.Many2one('res.company', 'Company',
- default=lambda self: self.env.company)
- name = fields.Char(related='company_id.name', readonly=True)
diff --git a/addons/base_accounting_kit/models/account_journal.py b/addons/base_accounting_kit/models/account_journal.py
deleted file mode 100644
index 4b944ae..0000000
--- a/addons/base_accounting_kit/models/account_journal.py
+++ /dev/null
@@ -1,119 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models, _
-
-
-class AccountJournal(models.Model):
- """Module inherited for adding the reconcile method in the account
- journal"""
- _inherit = "account.journal"
-
- multiple_invoice_ids = fields.One2many('multiple.invoice',
- 'journal_id',
- string='Multiple Invoice')
- multiple_invoice_type = fields.Selection(
- [('text', 'Text'), ('watermark', 'Watermark')], required=True,
- default='text', string="Display Type")
- text_position = fields.Selection([
- ('header', 'Header'),
- ('footer', 'Footer'),
- ('body', 'Document Body')
- ], required=True, default='header', string='Text Position')
- body_text_position = fields.Selection([
- ('tl', 'Top Left'),
- ('tr', 'Top Right'),
- ('bl', 'Bottom Left'),
- ('br', 'Bottom Right'),
- ], default='tl', string='Body Text Position')
- text_align = fields.Selection([
- ('right', 'Right'),
- ('left', 'Left'),
- ('center', 'Center'),
- ], default='right', string='Center Align Text Position')
- layout = fields.Char(string="Layout",
- related="company_id.external_report_layout_id.key")
-
- def action_open_reconcile(self):
- """Open the reconciliation view based on the type of the account journal."""
- self.ensure_one()
- if self.type in ('bank', 'cash'):
- views = [
- (self.env.ref(
- 'base_accounting_kit.account_bank_statement_line_view_kanban').id,
- 'kanban'),
- (self.env.ref(
- 'base_accounting_kit.account_bank_statement_line_view_tree').id,
- 'list'), # Include tree view
- ]
- context = {
- 'default_journal_id': self.id,
- 'search_default_journal_id': self.id,
- }
- kanban_first = True
- name = None
- extra_domain = None
- return {
- 'name': name or _("Bank Reconciliation"),
- 'type': 'ir.actions.act_window',
- 'res_model': 'account.bank.statement.line',
- 'context': context,
- 'search_view_id': [
- self.env.ref(
- 'base_accounting_kit.account_bank_statement_line_view_search').id,
- 'search'],
- 'view_mode': 'kanban,list' if kanban_first else 'list,kanban',
- 'views': views if kanban_first else views[::-1],
- 'domain': [('state', '!=', 'cancel')] + (extra_domain or []),
- 'help': _("""
-
- Nothing to do here!
-
-
- No transactions matching your filters were found.
-
- """),
- }
- else:
- # Open reconciliation view for customers/suppliers
- action_context = {'show_mode_selector': False,
- 'company_ids': self.mapped('company_id').ids}
- if self.type == 'sale':
- action_context.update({'mode': 'customers'})
- elif self.type == 'purchase':
- action_context.update({'mode': 'suppliers'})
- return {
- 'type': 'ir.actions.client',
- 'tag': 'manual_reconciliation_view',
- 'context': action_context,
- }
-
- def action_import_wizard(self):
- """Function to open wizard"""
- return {
- 'type': 'ir.actions.act_window',
- 'view_mode': 'form',
- 'res_model': 'import.bank.statement',
- 'target': 'new',
- 'context': {
- 'default_journal_id': self.id,
- }
- }
diff --git a/addons/base_accounting_kit/models/account_move.py b/addons/base_accounting_kit/models/account_move.py
deleted file mode 100644
index e26d829..0000000
--- a/addons/base_accounting_kit/models/account_move.py
+++ /dev/null
@@ -1,115 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models, _
-from odoo.exceptions import UserError
-
-
-class AccountMove(models.Model):
- """Inherits from the account.move model for adding the depreciation
- field to the account"""
- _inherit = 'account.move'
-
- has_due = fields.Boolean(string='Has due')
- is_warning = fields.Boolean(string='Is warning')
- due_amount = fields.Float(string="Due Amount",
- related='partner_id.due_amount')
- recurring_ref = fields.Char(string='Recurring Ref')
- asset_depreciation_ids = fields.One2many('account.asset.depreciation.line',
- 'move_id',
- string='Assets Depreciation Lines')
- to_check = fields.Boolean(string='To Check', tracking=True,
- help="If this checkbox is ticked, it means that the user was not sure of all the related "
- "information at the time of the creation of the move and that the move needs to be "
- "checked again.",
- )
-
- def button_cancel(self):
- """Button action to cancel the transfer"""
- for move in self:
- for line in move.asset_depreciation_ids:
- line.move_posted_check = False
- return super(AccountMove, self).button_cancel()
-
- def post(self):
- """Supering the post method to mapped the asset depreciation records"""
- self.mapped('asset_depreciation_ids').post_lines_and_close_asset()
- return super(AccountMove, self).action_post()
-
- @api.model
- def _refund_cleanup_lines(self, lines):
- """Supering the refund cleanup lines to check the asset category """
- result = super(AccountMove, self)._refund_cleanup_lines(lines)
- for i, line in enumerate(lines):
- for name, field in line._fields.items():
- if name == 'asset_category_id':
- result[i][2][name] = False
- break
- return result
-
- def action_cancel(self):
- """Action perform to cancel the asset record"""
- res = super(AccountMove, self).action_cancel()
- self.env['account.asset.asset'].sudo().search(
- [('invoice_id', 'in', self.ids)]).write({'active': False})
- return res
-
- def action_post(self):
- """To check the selected customers due amount is exceed than blocking stage"""
- pay_type = ['out_invoice', 'out_refund', 'out_receipt']
- for rec in self:
- if rec.partner_id.active_limit and rec.move_type in pay_type \
- and rec.partner_id.enable_credit_limit:
- if rec.due_amount >= rec.partner_id.blocking_stage and rec.partner_id.blocking_stage != 0:
- raise UserError(_(
- "%s is in Blocking Stage and "
- "has a due amount of %s %s to pay") % (
- rec.partner_id.name, rec.due_amount,
- rec.currency_id.symbol))
-
- result = super(AccountMove, self).action_post()
- for inv in self:
- context = dict(self.env.context)
- # Within the context of an invoice,
- # this default value is for the type of the invoice, not the type
- # of the asset. This has to be cleaned from the context before
- # creating the asset,otherwise it tries to create the asset with
- # the type of the invoice.
- context.pop('default_type', None)
- inv.invoice_line_ids.with_context(context).asset_create()
- return result
-
- @api.onchange('partner_id')
- def check_due(self):
- """To show the due amount and warning stage"""
- if self.partner_id and self.partner_id.due_amount > 0 \
- and self.partner_id.active_limit \
- and self.partner_id.enable_credit_limit:
- self.has_due = True
- else:
- self.has_due = False
- if self.partner_id and self.partner_id.active_limit \
- and self.partner_id.enable_credit_limit:
- if self.due_amount >= self.partner_id.warning_stage:
- if self.partner_id.warning_stage != 0:
- self.is_warning = True
- else:
- self.is_warning = False
diff --git a/addons/base_accounting_kit/models/account_move_line.py b/addons/base_accounting_kit/models/account_move_line.py
deleted file mode 100644
index c869b0f..0000000
--- a/addons/base_accounting_kit/models/account_move_line.py
+++ /dev/null
@@ -1,211 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import ast
-from datetime import datetime
-from odoo import api, fields, models, _
-from odoo.exceptions import UserError
-from odoo.tools import DEFAULT_SERVER_DATE_FORMAT as DF
-from dateutil.relativedelta import relativedelta
-
-
-class AccountInvoiceLine(models.Model):
- """Define a model for account invoice lines with fields related to assets and their management."""
- _inherit = 'account.move.line'
-
- asset_category_id = fields.Many2one('account.asset.category',
- string='Asset Category')
- asset_start_date = fields.Date(string='Asset Start Date',
- compute='_get_asset_date', readonly=True,
- store=True)
- asset_end_date = fields.Date(string='Asset End Date',
- compute='_get_asset_date', readonly=True,
- store=True)
- asset_mrr = fields.Float(string='Monthly Recurring Revenue',
- compute='_get_asset_date',
- readonly=True, digits='Account',
- store=True)
-
- @api.depends('asset_category_id', 'move_id.invoice_date')
- def _get_asset_date(self):
- """Returns the asset_start_date and the asset_end_date of the Asset"""
- for record in self:
- record.asset_mrr = 0
- record.asset_start_date = False
- record.asset_end_date = False
- cat = record.asset_category_id
- if cat:
- if cat.method_number == 0 or cat.method_period == 0:
- raise UserError(_(
- 'The number of depreciations or the period length of '
- 'your asset category cannot be null.'))
- months = cat.method_number * cat.method_period
- if record.move_id in ['out_invoice', 'out_refund']:
- record.asset_mrr = record.price_subtotal_signed / months
- if record.move_id.invoice_date:
- start_date = datetime.strptime(
- str(record.move_id.invoice_date), DF).replace(day=1)
- end_date = (start_date + relativedelta(months=months,
- days=-1))
- record.asset_start_date = start_date.strftime(DF)
- record.asset_end_date = end_date.strftime(DF)
-
- def asset_create(self):
- """Create function for the asset and its associated properties"""
- for record in self:
- if record.asset_category_id:
- vals = {
- 'name': record.name,
- 'code': record.move_id.name or False,
- 'category_id': record.asset_category_id.id,
- 'value': record.price_subtotal,
- 'partner_id': record.partner_id.id,
- 'company_id': record.move_id.company_id.id,
- 'currency_id': record.move_id.company_currency_id.id,
- 'date': record.move_id.invoice_date,
- 'invoice_id': record.move_id.id,
- }
- changed_vals = record.env[
- 'account.asset.asset'].onchange_category_id_values(
- vals['category_id'])
- vals.update(changed_vals['value'])
- asset = record.env['account.asset.asset'].create(vals)
- if record.asset_category_id.open_asset:
- asset.validate()
- return True
-
- @api.depends('asset_category_id')
- def onchange_asset_category_id(self):
- """On change function based on the category and its updates the
- account status"""
- if self.move_id.move_type == 'out_invoice' and self.asset_category_id:
- self.account_id = self.asset_category_id.account_asset_id.id
- elif self.move_id.move_type == 'in_invoice' and self.asset_category_id:
- self.account_id = self.asset_category_id.account_asset_id.id
-
- @api.onchange('product_id')
- def _onchange_uom_id(self):
- """Onchange function for product that's call the UOM compute function
- and the asset category function"""
- result = super(AccountInvoiceLine, self)._compute_product_uom_id()
- self.onchange_asset_category_id()
- return result
-
- @api.depends('product_id')
- def _onchange_product_id(self):
- """Onchange product values and it's associated with the move types"""
- vals = super(AccountInvoiceLine, self)._compute_price_unit()
- if self.product_id:
- if self.move_id.move_type == 'out_invoice':
- self.asset_category_id = self.product_id.product_tmpl_id.deferred_revenue_category_id
- elif self.move_id.move_type == 'in_invoice':
- self.asset_category_id = self.product_id.product_tmpl_id.asset_category_id
- return vals
-
- def _set_additional_fields(self, invoice):
- """The function adds additional fields that based on the invoice
- move types"""
- if not self.asset_category_id:
- if invoice.type == 'out_invoice':
- self.asset_category_id = self.product_id.product_tmpl_id.deferred_revenue_category_id.id
- elif invoice.type == 'in_invoice':
- self.asset_category_id = self.product_id.product_tmpl_id.asset_category_id.id
- self.onchange_asset_category_id()
- super(AccountInvoiceLine, self)._set_additional_fields(invoice)
-
- def get_invoice_line_account(self, type, product, fpos, company):
- """"It returns the invoice line and callback"""
- return product.asset_category_id.account_asset_id or super(
- AccountInvoiceLine, self).get_invoice_line_account(type, product,
- fpos, company)
-
- @api.model
- def _query_get(self, domain=None):
- """Used to add domain constraints to the query"""
- self.check_access_rights('read')
-
- context = dict(self._context or {})
- domain = domain or []
- if not isinstance(domain, (list, tuple)):
- domain = ast.literal_eval(domain)
-
- date_field = 'date'
- if context.get('aged_balance'):
- date_field = 'date_maturity'
- if context.get('date_to'):
- domain += [(date_field, '<=', context['date_to'])]
- if context.get('date_from'):
- if not context.get('strict_range'):
- domain += ['|', (date_field, '>=', context['date_from']),
- ('account_id.include_initial_balance', '=', True)]
- elif context.get('initial_bal'):
- domain += [(date_field, '<', context['date_from'])]
- else:
- domain += [(date_field, '>=', context['date_from'])]
-
- if context.get('journal_ids'):
- domain += [('journal_id', 'in', context['journal_ids'])]
-
- state = context.get('state')
- if state and state.lower() != 'all':
- domain += [('parent_state', '=', state)]
-
- if context.get('company_id'):
- domain += [('company_id', '=', context['company_id'])]
- elif context.get('allowed_company_ids'):
- domain += [('company_id', 'in', self.env.companies.ids)]
- else:
- domain += [('company_id', '=', self.env.company.id)]
-
- if context.get('reconcile_date'):
- domain += ['|', ('reconciled', '=', False), '|',
- ('matched_debit_ids.max_date', '>', context['reconcile_date']),
- ('matched_credit_ids.max_date', '>', context['reconcile_date'])]
-
- if context.get('account_tag_ids'):
- domain += [('account_id.tag_ids', 'in', context['account_tag_ids'].ids)]
-
- if context.get('account_ids'):
- domain += [('account_id', 'in', context['account_ids'].ids)]
-
- if context.get('analytic_tag_ids'):
- domain += [('analytic_tag_ids', 'in', context['analytic_tag_ids'].ids)]
-
- if context.get('analytic_account_ids'):
- domain += [('analytic_account_id', 'in', context['analytic_account_ids'].ids)]
-
- if context.get('partner_ids'):
- domain += [('partner_id', 'in', context['partner_ids'].ids)]
-
- if context.get('partner_categories'):
- domain += [('partner_id.category_id', 'in', context['partner_categories'].ids)]
-
- where_clause = ""
- where_clause_params = []
- tables = ''
- if domain:
- domain.append(('display_type', 'not in', ('line_section', 'line_note')))
- domain.append(('parent_state', '!=', 'cancel'))
- query = self._search(domain, bypass_access=True)
- tables, from_params = query.from_clause
- where_clause, where_params = query.where_clause
- where_clause_params = from_params + where_params
- return tables, where_clause, where_clause_params
diff --git a/addons/base_accounting_kit/models/account_payment.py b/addons/base_accounting_kit/models/account_payment.py
deleted file mode 100644
index 4dd26cb..0000000
--- a/addons/base_accounting_kit/models/account_payment.py
+++ /dev/null
@@ -1,200 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models, _
-from odoo.exceptions import UserError
-
-
-class AccountRegisterPayments(models.TransientModel):
- """Inherits the account.payment.register model to add the new
- fields and functions"""
- _inherit = "account.payment.register"
-
- bank_reference = fields.Char(string="Bank Reference", copy=False)
- cheque_reference = fields.Char(string="Cheque Reference", copy=False)
- effective_date = fields.Date('Effective Date',
- help='Effective date of PDC', copy=False,
- default=False)
-
- def _prepare_payment_vals(self, invoices):
- """Its prepare the payment values for the invoice and update
- the MultiPayment"""
- res = super(AccountRegisterPayments, self)._prepare_payment_vals(
- invoices)
- # Check payment method is Check or PDC
- check_pdc_ids = self.env['account.payment.method'].search(
- [('code', 'in', ['pdc', 'check_printing'])])
- if self.payment_method_id.id in check_pdc_ids.ids:
- currency_id = self.env['res.currency'].browse(res['currency_id'])
- journal_id = self.env['account.journal'].browse(res['journal_id'])
- # Updating values in case of Multi payments
- res.update({
- 'bank_reference': self.bank_reference,
- 'cheque_reference': self.cheque_reference,
- 'check_manual_sequencing': journal_id.check_manual_sequencing,
- 'effective_date': self.effective_date,
- 'check_amount_in_words': currency_id.amount_to_text(
- res['amount']),
- })
- return res
-
- def _create_payment_vals_from_wizard(self, batch_result):
- """It super the wizard action of the create payment values and update
- the bank and cheque values"""
- res = super(AccountRegisterPayments,
- self)._create_payment_vals_from_wizard(
- batch_result)
- if self.effective_date:
- res.update({
- 'bank_reference': self.bank_reference,
- 'cheque_reference': self.cheque_reference,
- 'effective_date': self.effective_date,
- })
- return res
-
- def _create_payment_vals_from_batch(self, batch_result):
- """It super the batch action of the create payment values and update
- the bank and cheque values"""
- res = super(AccountRegisterPayments,
- self)._create_payment_vals_from_batch(
- batch_result)
- if self.effective_date:
- res.update({
- 'bank_reference': self.bank_reference,
- 'cheque_reference': self.cheque_reference,
- 'effective_date': self.effective_date,
- })
- return res
-
- def _create_payments(self):
- """USed to create a list of payments and update the bank and
- cheque reference"""
- payments = super(AccountRegisterPayments, self)._create_payments()
-
- for payment in payments:
- payment.write({
- 'bank_reference': self.bank_reference,
- 'cheque_reference': self.cheque_reference
- })
- return payments
-
-
-class AccountPayment(models.Model):
- """It inherits the account.payment model for adding new fields
- and functions"""
- _inherit = "account.payment"
-
- bank_reference = fields.Char(string="Bank Reference", copy=False)
- cheque_reference = fields.Char(string="Cheque Reference",copy=False)
- effective_date = fields.Date('Effective Date',
- help='Effective date of PDC', copy=False,
- default=False)
-
- def open_payment_matching_screen(self):
- """Open reconciliation view for customers/suppliers"""
- move_line_id = False
- for move_line in self.line_ids:
- if move_line.account_id.reconcile:
- move_line_id = move_line.id
- break
- if not self.partner_id:
- raise UserError(_("Payments without a customer can't be matched"))
- action_context = {'company_ids': [self.company_id.id], 'partner_ids': [
- self.partner_id.commercial_partner_id.id]}
- if self.partner_type == 'customer':
- action_context.update({'mode': 'customers'})
- elif self.partner_type == 'supplier':
- action_context.update({'mode': 'suppliers'})
- if move_line_id:
- action_context.update({'move_line_id': move_line_id})
- return {
- 'type': 'ir.actions.client',
- 'tag': 'manual_reconciliation_view',
- 'context': action_context,
- }
-
- def print_checks(self):
- """ Check that the recordset is valid, set the payments state to
- sent and call print_checks() """
- # Since this method can be called via a client_action_multi, we
- # need to make sure the received records are what we expect
- selfs = self.filtered(lambda r:
- r.payment_method_id.code
- in ['check_printing', 'pdc']
- and r.state != 'reconciled')
- if len(selfs) == 0:
- raise UserError(_(
- "Payments to print as a checks must have 'Check' "
- "or 'PDC' selected as payment method and "
- "not have already been reconciled"))
- if any(payment.journal_id != selfs[0].journal_id for payment in selfs):
- raise UserError(_(
- "In order to print multiple checks at once, they "
- "must belong to the same bank journal."))
-
- if not selfs[0].journal_id.check_manual_sequencing:
- # The wizard asks for the number printed on the first
- # pre-printed check so payments are attributed the
- # number of the check the'll be printed on.
- last_printed_check = selfs.search([
- ('journal_id', '=', selfs[0].journal_id.id),
- ('check_number', '!=', "0")], order="check_number desc",
- limit=1)
- next_check_number = last_printed_check and int(
- last_printed_check.check_number) + 1 or 1
- return {
- 'name': _('Print Pre-numbered Checks'),
- 'type': 'ir.actions.act_window',
- 'res_model': 'print.prenumbered.checks',
- 'view_mode': 'form',
- 'target': 'new',
- 'context': {
- 'payment_ids': self.ids,
- 'default_next_check_number': next_check_number,
- }
- }
- else:
- self.filtered(lambda r: r.state == 'draft').post()
- self.write({'state': 'sent'})
- return self.do_print_checks()
-
- def _prepare_payment_moves(self):
- """ supered function to set effective date """
- res = super(AccountPayment, self)._prepare_payment_moves()
- inbound_pdc_id = self.env.ref(
- 'base_accounting_kit.account_payment_method_pdc_in').id
- outbound_pdc_id = self.env.ref(
- 'base_accounting_kit.account_payment_method_pdc_out').id
- if self.payment_method_id.id == inbound_pdc_id or \
- self.payment_method_id.id == outbound_pdc_id \
- and self.effective_date:
- res[0]['date'] = self.effective_date
- for line in res[0]['line_ids']:
- line[2]['date_maturity'] = self.effective_date
- return res
-
- def mark_as_sent(self):
- """Updates the is_move_sent value of the payment model"""
- self.write({'is_sent': True})
-
- def unmark_as_sent(self):
- """Updates the is_move_sent value of the payment model"""
- self.write({'is_sent': False})
diff --git a/addons/base_accounting_kit/models/account_payment_method.py b/addons/base_accounting_kit/models/account_payment_method.py
deleted file mode 100644
index 4be5191..0000000
--- a/addons/base_accounting_kit/models/account_payment_method.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, models
-
-
-class AccountPaymentMethod(models.Model):
- """The class inherits the account payment method for supering the
- _get_payment_method_information function"""
- _inherit = "account.payment.method"
-
- @api.model
- def _get_payment_method_information(self):
- """Super the function to update the pdc values"""
- res = super()._get_payment_method_information()
- res['pdc'] = {'mode': 'multi', 'domain': [('type', '=', 'bank')]}
- return res
diff --git a/addons/base_accounting_kit/models/account_recurring_entries_line.py b/addons/base_accounting_kit/models/account_recurring_entries_line.py
deleted file mode 100644
index 6d48c3c..0000000
--- a/addons/base_accounting_kit/models/account_recurring_entries_line.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class GetAllRecurringEntries(models.TransientModel):
- """Model for managing account recurring entries lines."""
- _name = 'account.recurring.entries.line'
- _description = 'Account Recurring Entries Line'
-
- date = fields.Date('Date')
- template_name = fields.Char('Name')
- amount = fields.Float('Amount')
- tmpl_id = fields.Many2one('account.recurring.payments', string='id')
diff --git a/addons/base_accounting_kit/models/account_report.py b/addons/base_accounting_kit/models/account_report.py
deleted file mode 100644
index 729c7ce..0000000
--- a/addons/base_accounting_kit/models/account_report.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models
-from odoo.tools import get_lang
-
-
-class AccountCommonReport(models.Model):
- """Inherits the Account report model to add special fields and functions"""
- _inherit = "account.report"
- _description = "Account Common Report"
-
- company_id = fields.Many2one('res.company', string='Company',
- required=True, readonly=True,
- default=lambda self: self.env.company)
- journal_ids = fields.Many2many(
- comodel_name='account.journal',
- string='Journals',
- required=True,
- default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]),
- domain="[('company_id', '=', company_id)]")
- date_from = fields.Date(string='Start Date')
- date_to = fields.Date(string='End Date')
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], string='Target Moves',
- required=True, default='posted')
-
- @api.onchange('company_id')
- def _onchange_company_id(self):
- """Onchange function based on the company and updated the journals"""
- if self.company_id:
- self.journal_ids = self.env['account.journal'].search(
- [('company_id', '=', self.company_id.id)])
- else:
- self.journal_ids = self.env['account.journal'].search([])
-
- def _build_contexts(self, data):
- """Builds the context information for the given data"""
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- result['company_id'] = data['form']['company_id'][0] or False
- return result
-
- def _print_report(self, data):
- """Raise an error if the report comes checked """
- raise NotImplementedError()
-
- def check_report(self):
- """Function to check if the report comes active models and related
- values"""
- self.ensure_one()
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code)
- return self.with_context(discard_logo_check=True)._print_report(data)
diff --git a/addons/base_accounting_kit/models/followup_line.py b/addons/base_accounting_kit/models/followup_line.py
deleted file mode 100644
index ae9b120..0000000
--- a/addons/base_accounting_kit/models/followup_line.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class FollowupLine(models.Model):
- """Model for defining follow-up criteria including the action name, sequence order, due days, and related follow-ups."""
- _name = 'followup.line'
- _description = 'Follow-up Criteria'
- _order = 'delay'
-
- name = fields.Char('Follow-Up Action', required=True, translate=True)
- sequence = fields.Integer(
- help="Gives the sequence order when displaying a list of follow-up lines.")
- delay = fields.Integer('Due Days', required=True,
- help="The number of days after the due date of the invoice"
- " to wait before sending the reminder."
- " Could be negative if you want to send a polite alert beforehand.")
- followup_id = fields.Many2one('account.followup', 'Follow Ups',
- ondelete="cascade")
diff --git a/addons/base_accounting_kit/models/multiple_invoice.py b/addons/base_accounting_kit/models/multiple_invoice.py
deleted file mode 100644
index 6996f7b..0000000
--- a/addons/base_accounting_kit/models/multiple_invoice.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class MultipleInvoice(models.Model):
- """Multiple Invoice Model"""
- _name = "multiple.invoice"
- _description = 'Multiple Invoice'
- _order = "sequence"
-
- sequence = fields.Integer(string='Sequence No')
- copy_name = fields.Char(string='Invoice Copy Name')
- journal_id = fields.Many2one('account.journal', string="Journal")
diff --git a/addons/base_accounting_kit/models/multiple_invoice_layout.py b/addons/base_accounting_kit/models/multiple_invoice_layout.py
deleted file mode 100644
index d089ff8..0000000
--- a/addons/base_accounting_kit/models/multiple_invoice_layout.py
+++ /dev/null
@@ -1,158 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models
-from odoo.tools.misc import file_path
-
-try:
- import sass as libsass
-except ImportError:
- libsass = None
-
-
-class MultipleInvoiceLayout(models.TransientModel):
- """
- Customise the invoice copy document layout and display a live preview
- """
- _name = 'multiple.invoice.layout'
- _description = 'Multiple Invoice Document Layout'
-
- def _get_default_journal(self):
- """The default function to return the journal for the invoice"""
- return self.env['account.journal'].search(
- [('id', '=', self.env.context.get('active_id'))]).id
-
- company_id = fields.Many2one(
- 'res.company', default=lambda self: self.env.company, required=True)
- layout = fields.Char(related="company_id.external_report_layout_id.key")
- journal_id = fields.Many2one('account.journal', string='Journal',
- required=True, default=_get_default_journal)
- multiple_invoice_type = fields.Selection(
- related='journal_id.multiple_invoice_type', readonly=False,
- required=True)
- text_position = fields.Selection(related='journal_id.text_position',
- readonly=False, required=True,
- default='header')
- body_text_position = fields.Selection(
- related='journal_id.body_text_position',
- readonly=False)
- text_align = fields.Selection(
- related='journal_id.text_align',
- readonly=False)
- preview = fields.Html(compute='_compute_preview',
- sanitize=False,
- sanitize_tags=False,
- sanitize_attributes=False,
- sanitize_style=False,
- sanitize_form=False,
- strip_style=False,
- strip_classes=False)
-
- @api.depends('multiple_invoice_type', 'text_position', 'body_text_position',
- 'text_align')
- def _compute_preview(self):
- """ compute a qweb based preview to display on the wizard """
-
- styles = self._get_asset_style()
-
- for wizard in self:
- if wizard.company_id:
- preview_css = self._get_css_for_preview(styles, wizard.id)
- layout = self._get_layout_for_preview()
- ir_ui_view = wizard.env['ir.ui.view']
- wizard.preview = ir_ui_view._render_template(
- 'base_accounting_kit.multiple_invoice_wizard_preview',
- {'company': wizard.company_id, 'preview_css': preview_css,
- 'layout': layout,
- 'mi_type': self.multiple_invoice_type,
- 'txt_position': self.text_position,
- 'body_txt_position': self.body_text_position,
- 'txt_align': self.text_align,
- 'mi': self.env.ref(
- 'base_accounting_kit.multiple_invoice_sample_name')
- })
- else:
- wizard.preview = False
-
- def _get_asset_style(self):
- """Used to set the asset style"""
- company_styles = self.env['ir.qweb']._render(
- 'web.styles_company_report', {
- 'company_ids': self.company_id,
- }, raise_if_not_found=False)
- return company_styles
-
- @api.model
- def _get_css_for_preview(self, scss, new_id):
- """
- Compile the scss into css.
- """
- css_code = self._compile_scss(scss)
- return css_code
-
- @api.model
- def _compile_scss(self, scss_source):
- """
- This code will compile valid scss into css.
- Parameters are the same from odoo/addons/base/models/assetsbundle.py
- Simply copied and adapted slightly
- """
-
- # No scss ? still valid, returns empty css
- if not scss_source.strip():
- return ""
-
- precision = 8
- output_style = 'expanded'
- bootstrap_path = file_path('web', 'static', 'lib', 'bootstrap',
- 'scss')
- try:
- return libsass.compile(
- string=scss_source,
- include_paths=[
- bootstrap_path,
- ],
- output_style=output_style,
- precision=precision,
- )
- except libsass.CompileError as e:
- raise libsass.CompileError(e.args[0])
-
- def _get_layout_for_preview(self):
- """Returns the layout Preview for the accounting module"""
- if self.layout == 'web.external_layout_boxed':
- new_layout = 'base_accounting_kit.boxed'
-
- elif self.layout == 'web.external_layout_bold':
- new_layout = 'base_accounting_kit.bold'
-
- elif self.layout == 'web.external_layout_striped':
- new_layout = 'base_accounting_kit.striped'
-
- else:
- new_layout = 'base_accounting_kit.standard'
-
- return new_layout
-
- def document_layout_save(self):
- """meant to be overridden document_layout_save"""
- return self.env.context.get('report_action') or {
- 'type': 'ir.actions.act_window_close'}
diff --git a/addons/base_accounting_kit/models/product_template.py b/addons/base_accounting_kit/models/product_template.py
deleted file mode 100644
index f6f35da..0000000
--- a/addons/base_accounting_kit/models/product_template.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class ProductTemplate(models.Model):
- """Inherited the model for adding new fields and functions"""
- _inherit = 'product.template'
-
- asset_category_id = fields.Many2one('account.asset.category',
- string='Asset Type',
- company_dependent=True,
- ondelete="restrict")
- deferred_revenue_category_id = fields.Many2one('account.asset.category',
- string='Deferred Revenue Type',
- company_dependent=True,
- ondelete="restrict")
-
- def _get_asset_accounts(self):
- """Override method to customize asset accounts based on asset and deferred revenue categories."""
- res = super(ProductTemplate, self)._get_asset_accounts()
- if self.asset_category_id:
- res['stock_input'] = self.property_account_expense_id
- if self.deferred_revenue_category_id:
- res['stock_output'] = self.property_account_income_id
- return res
diff --git a/addons/base_accounting_kit/models/recurring_payments.py b/addons/base_accounting_kit/models/recurring_payments.py
deleted file mode 100644
index 6c62283..0000000
--- a/addons/base_accounting_kit/models/recurring_payments.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import datetime, date
-from dateutil.relativedelta import relativedelta
-from odoo import api, models, fields
-
-
-class RecurringPayments(models.Model):
- """Created the module for recurring payments"""
- _name = 'account.recurring.payments'
- _description = 'Accounting Recurring Payment'
-
- def _get_next_schedule(self):
- """Function for adding the schedule process"""
- if self.date:
- recurr_dates = []
- today = datetime.today()
- start_date = datetime.strptime(str(self.date), '%Y-%m-%d')
- while start_date <= today:
- recurr_dates.append(str(start_date.date()))
- if self.recurring_period == 'days':
- start_date += relativedelta(days=self.recurring_interval)
- elif self.recurring_period == 'weeks':
- start_date += relativedelta(weeks=self.recurring_interval)
- elif self.recurring_period == 'months':
- start_date += relativedelta(months=self.recurring_interval)
- else:
- start_date += relativedelta(years=self.recurring_interval)
- self.next_date = start_date.date()
-
- name = fields.Char(string='Name')
- debit_account = fields.Many2one('account.account', 'Debit Account',
- required=True)
- credit_account = fields.Many2one('account.account', 'Credit Account',
- required=True)
- journal_id = fields.Many2one('account.journal', 'Journal', required=True)
- analytic_account_id = fields.Many2one('account.analytic.account',
- 'Analytic Account')
- date = fields.Date('Starting Date', required=True, default=date.today())
- next_date = fields.Date('Next Schedule', compute=_get_next_schedule,
- readonly=True, copy=False)
- recurring_period = fields.Selection(selection=[('days', 'Days'),
- ('weeks', 'Weeks'),
- ('months', 'Months'),
- ('years', 'Years')],
- store=True, required=True)
- amount = fields.Float('Amount')
- description = fields.Text('Description')
- state = fields.Selection(selection=[('draft', 'Draft'),
- ('running', 'Running')],
- default='draft', string='Status')
- journal_state = fields.Selection(selection=[('draft', 'Unposted'),
- ('posted', 'Posted')],
- required=True, default='draft',
- string='Generate Journal As')
- recurring_interval = fields.Integer('Recurring Interval', default=1)
- partner_id = fields.Many2one('res.partner', 'Partner')
- pay_time = fields.Selection(selection=[('pay_now', 'Pay Directly'),
- ('pay_later', 'Pay Later')],
- store=True, required=True)
- company_id = fields.Many2one('res.company',
- default=lambda l: l.env.company.id)
- recurring_lines = fields.One2many('account.recurring.entries.line', 'tmpl_id')
-
- @api.onchange('partner_id')
- def onchange_partner_id(self):
- """Onchange partner field for updating the credit account value"""
- if self.partner_id.property_account_receivable_id:
- self.credit_account = self.partner_id.property_account_payable_id
-
- @api.model
- def _cron_generate_entries(self):
- """Generate recurring entries based on the defined schedule
- and create corresponding accounting moves."""
- data = self.env['account.recurring.payments'].search(
- [('state', '=', 'running')])
- entries = self.env['account.move'].search(
- [('recurring_ref', '!=', False)])
- journal_dates = []
- journal_codes = []
- remaining_dates = []
- for entry in entries:
- journal_dates.append(str(entry.date))
- if entry.recurring_ref:
- journal_codes.append(str(entry.recurring_ref))
- today = datetime.today()
- for line in data:
- if line.date:
- recurr_dates = []
- start_date = datetime.strptime(str(line.date), '%Y-%m-%d')
- while start_date <= today:
- recurr_dates.append(str(start_date.date()))
- if line.recurring_period == 'days':
- start_date += relativedelta(
- days=line.recurring_interval)
- elif line.recurring_period == 'weeks':
- start_date += relativedelta(
- weeks=line.recurring_interval)
- elif line.recurring_period == 'months':
- start_date += relativedelta(
- months=line.recurring_interval)
- else:
- start_date += relativedelta(
- years=line.recurring_interval)
- for rec in recurr_dates:
- recurr_code = str(line.id) + '/' + str(rec)
- if recurr_code not in journal_codes:
- remaining_dates.append({
- 'date': rec,
- 'template_name': line.name,
- 'amount': line.amount,
- 'tmpl_id': line.id,
- })
- child_ids = self.recurring_lines.create(remaining_dates)
- for line in child_ids:
- tmpl_id = line.tmpl_id
- recurr_code = str(tmpl_id.id) + '/' + str(line.date)
- line_ids = [(0, 0, {
- 'account_id': tmpl_id.credit_account.id,
- 'partner_id': tmpl_id.partner_id.id,
- 'credit': line.amount,
- # 'analytic_account_id': tmpl_id.analytic_account_id.id,
- }), (0, 0, {
- 'account_id': tmpl_id.debit_account.id,
- 'partner_id': tmpl_id.partner_id.id,
- 'debit': line.amount,
- # 'analytic_account_id': tmpl_id.analytic_account_id.id,
- })]
- vals = {
- 'date': line.date,
- 'recurring_ref': recurr_code,
- 'company_id': self.env.company.id,
- 'journal_id': tmpl_id.journal_id.id,
- 'ref': line.template_name,
- 'narration': 'Recurring entry',
- 'line_ids': line_ids
- }
- move_id = self.env['account.move'].create(vals)
- if tmpl_id.journal_state == 'posted':
- move_id.post()
diff --git a/addons/base_accounting_kit/models/res_company.py b/addons/base_accounting_kit/models/res_company.py
deleted file mode 100644
index 90a488f..0000000
--- a/addons/base_accounting_kit/models/res_company.py
+++ /dev/null
@@ -1,109 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import datetime
-import calendar
-from odoo import models, api, _
-from odoo.exceptions import RedirectWarning
-
-
-class ResCompany(models.Model):
- """Model for inheriting res_company."""
- _inherit = "res.company"
-
- @api.model_create_multi
- def create(self, vals_list):
- """Ensure fiscal year day does not exceed the maximum valid day for the selected month during record creation."""
- for vals in vals_list:
- if 'fiscalyear_last_month' in vals and 'fiscalyear_last_day' in vals:
- month = vals.get('fiscalyear_last_month')
- day = vals.get('fiscalyear_last_day')
- if month and day:
- if vals.account_opening_date:
- year = vals.account_opening_date.year
- else:
- year = datetime.now().year
- max_day = calendar.monthrange(year, int(month))[1]
- if int(day) > max_day:
- vals['fiscalyear_last_day'] = max_day
- return super(ResCompany, self).create(vals_list)
-
- def write(self, vals):
- """Auto-correct fiscal year day to a valid value when month or day is updated to prevent invalid calendar dates."""
- if 'fiscalyear_last_month' in vals or 'fiscalyear_last_day' in vals:
- month = vals.get('fiscalyear_last_month')
- day = vals.get('fiscalyear_last_day')
- if month:
- if self.account_opening_date:
- year = self.account_opening_date.year
- else:
- year = datetime.now().year
- max_day = calendar.monthrange(year, int(month))[1]
- if not day:
- if any(company.fiscalyear_last_day > max_day for company in self):
- vals['fiscalyear_last_day'] = max_day
- elif int(day) > max_day:
- vals['fiscalyear_last_day'] = max_day
-
- return super(ResCompany, self).write(vals)
-
- def _validate_locks(self, values):
- """Validate the hard lock date by checking for unposted entries and unreconciled bank statement lines."""
- if values.get('hard_lock_date'):
- draft_entries = self.env['account.move'].search([
- ('company_id', 'in', self.ids),
- ('state', '=', 'draft'),
- ('date', '<=', values['hard_lock_date'])])
- if draft_entries:
- error_msg = _('There are still unposted entries in the '
- 'period you want to lock. You should either post '
- 'or delete them.')
- action_error = {
- 'view_mode': 'list',
- 'name': 'Unposted Entries',
- 'res_model': 'account.move',
- 'type': 'ir.actions.act_window',
- 'domain': [('id', 'in', draft_entries.ids)],
- 'search_view_id': [self.env.ref('account.view_account_move_filter').id, 'search'],
- 'views': [[self.env.ref('account.view_move_tree').id, 'list'], [self.env.ref('account.view_move_form').id, 'form']],
- }
- raise RedirectWarning(error_msg, action_error, _('Show unposted entries'))
-
- unreconciled_statement_lines = self.env['account.bank.statement.line'].search([
- ('company_id', 'in', self.ids),
- ('is_reconciled', '=', False),
- ('date', '<=', values['hard_lock_date']),
- ('move_id.state', 'in', ('draft', 'posted')),
- ])
- if unreconciled_statement_lines:
- error_msg = _("There are still unreconciled bank statement lines in the period you want to lock."
- "You should either reconcile or delete them.")
- action_error = {
- 'view_mode': 'kanban',
- 'name': 'Unreconciled Transactions',
- 'res_model': 'account.bank.statement.line',
- 'type': 'ir.actions.act_window',
- 'domain': [('id', 'in', unreconciled_statement_lines.ids)],
- 'views': [[self.env.ref(
- 'base_accounting_kit.account_bank_statement_line_view_kanban').id,
- 'kanban']]
- }
- raise RedirectWarning(error_msg, action_error, _('Show Unreconciled Bank Statement Lines'))
diff --git a/addons/base_accounting_kit/models/res_config_settings.py b/addons/base_accounting_kit/models/res_config_settings.py
deleted file mode 100644
index c31fcf4..0000000
--- a/addons/base_accounting_kit/models/res_config_settings.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import models, fields, api
-
-
-class ResConfigSettings(models.TransientModel):
- """Defines a model for configuration settings with additional fields for
- managing customer credit limit and Anglo-Saxon accounting settings."""
- _inherit = 'res.config.settings'
-
- customer_credit_limit = fields.Boolean(string="Customer Credit Limit")
-
- use_anglo_saxon_accounting = fields.Boolean(string="Use Anglo-Saxon accounting", readonly=False,
- related='company_id.anglo_saxon_accounting')
- fiscalyear_last_day = fields.Integer(
- related='company_id.fiscalyear_last_day', readonly=False
- )
- fiscalyear_last_month = fields.Selection(
- related='company_id.fiscalyear_last_month', readonly=False
- )
-
- @api.model
- def get_values(self):
- """Retrieve the values for configuration settings including the
- customer credit limit from the database parameters. """
- res = super(ResConfigSettings, self).get_values()
- params = self.env['ir.config_parameter'].sudo()
- customer_credit_limit = params.get_param('customer_credit_limit',
- default=False)
- res.update(customer_credit_limit=customer_credit_limit)
- return res
-
- def set_values(self):
- """Set the customer credit limit value in the database parameters using superuser access."""
- super(ResConfigSettings, self).set_values()
- self.env['ir.config_parameter'].sudo().set_param(
- "customer_credit_limit",
- self.customer_credit_limit)
-
- @api.model
- def get_view_id(self):
- """Retrieve the ID of the view for bank reconciliation widget form."""
- view_id = self.env['ir.model.data']._xmlid_to_res_id(
- 'base_accounting_kit.view_bank_reconcile_widget_form')
- return view_id
diff --git a/addons/base_accounting_kit/models/res_partner.py b/addons/base_accounting_kit/models/res_partner.py
deleted file mode 100644
index 9d8e5a0..0000000
--- a/addons/base_accounting_kit/models/res_partner.py
+++ /dev/null
@@ -1,528 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import date, timedelta
-from odoo import api, fields, models, _
-from odoo.exceptions import UserError
-import base64
-import io
-import json
-import xlsxwriter
-from odoo.exceptions import ValidationError, UserError
-from odoo.tools.json import json_default
-
-
-class ResPartner(models.Model):
- """Inheriting res.partner"""
- _inherit = "res.partner"
-
- invoice_list = fields.One2many('account.move', 'partner_id',
- string="Invoice Details",
- readonly=True,
- domain=(
- [('payment_state', '=', 'not_paid'),
- ('move_type', '=', 'out_invoice')]))
- total_due = fields.Monetary(compute='_compute_for_followup', store=False,
- readonly=True)
- next_reminder_date = fields.Date(compute='_compute_for_followup',
- store=False, readonly=True)
- total_overdue = fields.Monetary(compute='_compute_for_followup',
- store=False, readonly=True)
- followup_status = fields.Selection(
- [('in_need_of_action', 'In need of action'),
- ('with_overdue_invoices', 'With overdue invoices'),
- ('no_action_needed', 'No action needed')],
- string='Followup status',
- )
-
- warning_stage = fields.Float(string='Warning Amount',
- help="A warning message will appear once the "
- "selected customer is crossed warning "
- "amount. Set its value to 0.00 to"
- " disable this feature")
- blocking_stage = fields.Float(string='Blocking Amount',
- help="Cannot make sales once the selected "
- "customer is crossed blocking amount."
- "Set its value to 0.00 to disable "
- "this feature")
- due_amount = fields.Float(string="Total Sale",
- compute="compute_due_amount")
- active_limit = fields.Boolean("Active Credit Limit", default=False)
-
- enable_credit_limit = fields.Boolean(string="Credit Limit Enabled",
- compute="_compute_enable_credit_limit")
-
- def _compute_for_followup(self):
- """
- Compute the fields 'total_due', 'total_overdue' , 'next_reminder_date' and 'followup_status'
- """
- for record in self:
- total_due = 0
- total_overdue = 0
- today = fields.Date.today()
- for am in record.invoice_list:
- if am.company_id == self.env.company:
- amount = am.amount_residual
- total_due += amount
-
- is_overdue = today > am.invoice_date_due if am.invoice_date_due else today > am.date
- if is_overdue:
- total_overdue += amount or 0
- min_date = record.get_min_date()
- action = record.action_after()
- if min_date:
- date_reminder = min_date + timedelta(days=action)
- if date_reminder:
- record.next_reminder_date = date_reminder
- else:
- date_reminder = today
- record.next_reminder_date = date_reminder
- if total_overdue > 0 and date_reminder > today:
- followup_status = "with_overdue_invoices"
- elif total_due > 0 and date_reminder <= today:
- followup_status = "in_need_of_action"
- else:
- followup_status = "no_action_needed"
- record.total_due = total_due
- record.total_overdue = total_overdue
- record.followup_status = followup_status
-
- def get_min_date(self):
- """Get the minimum invoice due date from the partner's invoice list."""
- today = date.today()
- for this in self:
- if this.invoice_list:
- min_list = this.invoice_list.mapped('invoice_date_due')
- while False in min_list:
- min_list.remove(False)
- return min(min_list)
- else:
- return today
-
- def get_delay(self):
- """Retrieve the delay information for follow-up lines associated with the company."""
- delay = """SELECT fl.id, fl.delay
- FROM followup_line fl
- JOIN account_followup af ON fl.followup_id = af.id
- WHERE af.company_id = %s
- ORDER BY fl.delay;
-
- """
- self._cr.execute(delay, [self.env.company.id])
- record = self._cr.dictfetchall()
-
- return record
-
- def action_after(self):
- """Retrieve the delay information for follow-up lines associated with the company and return the delay value if found."""
- lines = self.env['followup.line'].search([(
- 'followup_id.company_id', '=', self.env.company.id)])
- if lines:
- record = self.get_delay()
- for i in record:
- return i['delay']
-
- def compute_due_amount(self):
- """Compute function to compute the due amount with the
- credit and debit amount"""
- for rec in self:
- if not rec.id:
- continue
- rec.due_amount = rec.credit - rec.debit
-
- def _compute_enable_credit_limit(self):
- """ Check credit limit is enabled in account settings """
- params = self.env['ir.config_parameter'].sudo()
- customer_credit_limit = params.get_param('customer_credit_limit',
- default=False)
- for rec in self:
- rec.enable_credit_limit = True if customer_credit_limit else False
-
- @api.constrains('warning_stage', 'blocking_stage')
- def constrains_warning_stage(self):
- """Constrains functionality used to indicate or raise an
- UserError"""
- if self.active_limit and self.enable_credit_limit:
- if self.warning_stage >= self.blocking_stage:
- if self.blocking_stage > 0:
- raise UserError(_(
- "Warning amount should be less than Blocking amount"))
-
- # customer statement
-
- customer_report_ids = fields.Many2many(
- 'account.move',
- compute='_compute_customer_report_ids',
- help='Partner Invoices related to Customer')
- vendor_statement_ids = fields.Many2many(
- 'account.move',
- compute='_compute_vendor_statement_ids',
- help='Partner Bills related to Vendor')
- currency_id = fields.Many2one(
- 'res.currency',
- default=lambda self: self.env.company.currency_id.id,
- help="currency related to Customer or Vendor")
-
- def _compute_customer_report_ids(self):
- """ For computing 'invoices' of partner """
- for rec in self:
- inv_ids = self.env['account.move'].search(
- [('partner_id', '=', rec.id),
- ('move_type', '=', 'out_invoice'),
- ('payment_state', '!=', 'paid'),
- ('state', '=', 'posted')])
- rec.customer_report_ids = inv_ids
-
- def _compute_vendor_statement_ids(self):
- """ For computing 'bills' of partner """
- for rec in self:
- bills = self.env['account.move'].search(
- [('partner_id', '=', rec.id),
- ('move_type', '=', 'in_invoice'),
- ('payment_state', '!=', 'paid'),
- ('state', '=', 'posted')])
- rec.vendor_statement_ids = bills
-
- def main_query(self):
- """ Return select query """
- query = """SELECT name , invoice_date, invoice_date_due,
- amount_total_signed AS sub_total,
- amount_residual_signed AS amount_due ,
- amount_residual AS balance
- FROM account_move WHERE payment_state != 'paid'
- AND state ='posted' AND partner_id= '%s'
- AND company_id = '%s' """ % (self.id, self.env.company.id)
- return query
-
- def amount_query(self):
- """ Return query for calculating total amount """
- amount_query = """ SELECT SUM(amount_total_signed) AS total,
- SUM(amount_residual) AS balance
- FROM account_move WHERE payment_state != 'paid'
- AND state ='posted' AND partner_id= '%s'
- AND company_id = '%s' """ % (self.id, self.env.company.id)
- return amount_query
-
- def action_share_pdf(self):
- """ Action for sharing customer pdf report """
- if self.customer_report_ids:
- main_query = self.main_query()
- main_query += """ AND move_type IN ('out_invoice')"""
- amount = self.amount_query()
- amount += """ AND move_type IN ('out_invoice')"""
- self.env.cr.execute(main_query)
- main = self.env.cr.dictfetchall()
- self.env.cr.execute(amount)
- amount = self.env.cr.dictfetchall()
- data = {
- 'customer': self.display_name,
- 'street': self.street,
- 'street2': self.street2,
- 'city': self.city,
- 'state': self.state_id.name,
- 'zip': self.zip,
- 'my_data': main,
- 'total': amount[0]['total'],
- 'balance': amount[0]['balance'],
- 'currency': self.currency_id.symbol,
- }
- report = self.env['ir.actions.report'].sudo()._render_qweb_pdf(
- 'base_accounting_kit.res_partner_action', self, data=data)
- data_record = base64.b64encode(report[0])
- ir_values = {
- 'name': 'Statement Report',
- 'type': 'binary',
- 'datas': data_record,
- 'mimetype': 'application/pdf',
- 'res_model': 'res.partner'
- }
- attachment = self.env['ir.attachment'].sudo().create(ir_values)
- email_values = {
- 'email_to': self.email,
- 'subject': 'Payment Statement Report',
- 'body_html': '
Dear Mr/Miss. ' + self.name +
- '
We have attached your '
- 'payment statement. Please check
We have attached your'
- ' payment statement. Please check
'
- '
Best regards,
' + self.env.user.name,
- 'attachment_ids': [attachment.id],
- }
- mail = self.env['mail.mail'].sudo().create(email_values)
- mail.send()
- return {
- 'type': 'ir.actions.client',
- 'tag': 'display_notification',
- 'params': {
- 'message': 'Email Sent Successfully',
- 'type': 'success',
- 'sticky': False
- }
- }
- else:
- raise ValidationError('There is no statement to send')
-
diff --git a/addons/base_accounting_kit/models/sale_order.py b/addons/base_accounting_kit/models/sale_order.py
deleted file mode 100644
index 0cfb8b8..0000000
--- a/addons/base_accounting_kit/models/sale_order.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models
-from odoo.exceptions import UserError
-from odoo.tools.translate import _
-
-
-class SaleOrder(models.Model):
- """The Class inherits the sale.order model for adding the new
- fields and functions"""
- _inherit = 'sale.order'
-
- has_due = fields.Boolean(string='Has due')
- is_warning = fields.Boolean(string='Is warning')
- due_amount = fields.Float(string='Due Amount',
- related='partner_id.due_amount')
-
- def _action_confirm(self):
- """To check the selected customers due amount is exceed than
- blocking stage"""
- if self.partner_id.active_limit \
- and self.partner_id.enable_credit_limit:
- if self.due_amount >= self.partner_id.blocking_stage:
- if self.partner_id.blocking_stage != 0:
- raise UserError(_(
- "%s is in Blocking Stage and "
- "has a due amount of %s %s to pay") % (
- self.partner_id.name, self.due_amount,
- self.currency_id.symbol))
- return super(SaleOrder, self)._action_confirm()
-
- @api.onchange('partner_id')
- def check_due(self):
- """To show the due amount and warning stage"""
- if self.partner_id and self.partner_id.due_amount > 0 \
- and self.partner_id.active_limit \
- and self.partner_id.enable_credit_limit:
- self.has_due = True
- else:
- self.has_due = False
- if self.partner_id and self.partner_id.active_limit\
- and self.partner_id.enable_credit_limit:
- if self.due_amount >= self.partner_id.warning_stage:
- if self.partner_id.warning_stage != 0:
- self.is_warning = True
- else:
- self.is_warning = False
diff --git a/addons/base_accounting_kit/report/__init__.py b/addons/base_accounting_kit/report/__init__.py
deleted file mode 100644
index 828ed84..0000000
--- a/addons/base_accounting_kit/report/__init__.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from . import account_asset_report
-from . import account_bank_book
-from . import account_cash_book
-from . import account_day_book
-from . import account_report_common_account
-from . import cash_flow_report
-from . import general_ledger_report
-from . import multiple_invoice_report
-from . import report_aged_partner
-from . import report_financial
-from . import report_journal_audit
-from . import report_partner_ledger
-from . import report_tax
-from . import report_trial_balance
diff --git a/addons/base_accounting_kit/report/account_asset_report.py b/addons/base_accounting_kit/report/account_asset_report.py
deleted file mode 100644
index 44a1bc7..0000000
--- a/addons/base_accounting_kit/report/account_asset_report.py
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models, tools
-
-
-class AssetAssetReport(models.Model):
- _name = "asset.asset.report"
- _description = "Assets Analysis"
- _auto = False
-
- name = fields.Char(string='Year', required=False, readonly=True)
- date = fields.Date(readonly=True)
- depreciation_date = fields.Date(string='Depreciation Date', readonly=True)
- asset_id = fields.Many2one('account.asset.asset', string='Asset', readonly=True)
- asset_category_id = fields.Many2one('account.asset.category', string='Asset category', readonly=True)
- partner_id = fields.Many2one('res.partner', string='Partner', readonly=True)
- state = fields.Selection([('draft', 'Draft'), ('open', 'Running'), ('close', 'Close')], string='Status', readonly=True)
- depreciation_value = fields.Float(string='Amount of Depreciation Lines', readonly=True)
- installment_value = fields.Float(string='Amount of Installment Lines', readonly=True)
- move_check = fields.Boolean(string='Posted', readonly=True)
- installment_nbr = fields.Integer(string='# of Installment Lines', readonly=True)
- depreciation_nbr = fields.Integer(string='# of Depreciation Lines', readonly=True)
- gross_value = fields.Float(string='Gross Amount', readonly=True)
- posted_value = fields.Float(string='Posted Amount', readonly=True)
- unposted_value = fields.Float(string='Unposted Amount', readonly=True)
- company_id = fields.Many2one('res.company', string='Company', readonly=True)
-
- def init(self):
- tools.drop_view_if_exists(self._cr, 'asset_asset_report')
- self._cr.execute("""
- create or replace view asset_asset_report as (
- select
- min(dl.id) as id,
- dl.name as name,
- dl.depreciation_date as depreciation_date,
- a.date as date,
- (CASE WHEN dlmin.id = min(dl.id)
- THEN a.value
- ELSE 0
- END) as gross_value,
- dl.amount as depreciation_value,
- dl.amount as installment_value,
- (CASE WHEN dl.move_check
- THEN dl.amount
- ELSE 0
- END) as posted_value,
- (CASE WHEN NOT dl.move_check
- THEN dl.amount
- ELSE 0
- END) as unposted_value,
- dl.asset_id as asset_id,
- dl.move_check as move_check,
- a.category_id as asset_category_id,
- a.partner_id as partner_id,
- a.state as state,
- count(dl.*) as installment_nbr,
- count(dl.*) as depreciation_nbr,
- a.company_id as company_id
- from account_asset_depreciation_line dl
- left join account_asset_asset a on (dl.asset_id=a.id)
- left join (select min(d.id) as id,ac.id as ac_id from
- account_asset_depreciation_line as d inner join
- account_asset_asset as ac ON (ac.id=d.asset_id) group by
- ac_id) as dlmin on dlmin.ac_id=a.id
- where a.active is true
- group by
- dl.amount,dl.asset_id,dl.depreciation_date,dl.name,
- a.date, dl.move_check, a.state, a.category_id,
- a.partner_id, a.company_id,
- a.value, a.id, a.salvage_value, dlmin.id
- )""")
diff --git a/addons/base_accounting_kit/report/account_asset_report_views.xml b/addons/base_accounting_kit/report/account_asset_report_views.xml
deleted file mode 100644
index 3c25cab..0000000
--- a/addons/base_accounting_kit/report/account_asset_report_views.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
-
- asset.asset.report.view.pivot
- asset.asset.report
-
-
-
-
-
-
-
-
-
-
- asset.asset.report.view.graph
- asset.asset.report
-
-
-
-
-
-
-
-
-
-
- asset.asset.report.view.search
- asset.asset.report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Assets Analysis
- asset.asset.report
- graph,pivot
-
- [('asset_category_id.type', '=', 'purchase')]
- {'search_default_only_active': 1}
-
-
- From this report, you can have an overview on all depreciation's. The
- search bar can also be used to personalize your assets depreciation reporting.
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/account_bank_book.py b/addons/base_accounting_kit/report/account_bank_book.py
deleted file mode 100644
index 40079d2..0000000
--- a/addons/base_accounting_kit/report/account_bank_book.py
+++ /dev/null
@@ -1,175 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportBankBook(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_bank_book'
- _description = 'Bank Book Report'
-
- def _get_account_move_entry(self, accounts, init_balance, sortby,
- display_account):
- cr = self.env.cr
- move_line = self.env['account.move.line']
- move_lines = {x: [] for x in accounts.ids}
-
- # Prepare initial sql query and Get the initial move lines
- if init_balance:
- init_tables, init_where_clause, init_where_params = move_line.with_context(
- date_from=self.env.context.get('date_from'), date_to=False,
- initial_bal=True)._query_get()
- init_wheres = [""]
- if init_where_clause.strip():
- init_wheres.append(init_where_clause.strip())
- init_filters = " AND ".join(init_wheres)
- filters = init_filters.replace('account_move_line__move_id',
- 'm').replace('account_move_line',
- 'l')
- sql = ("""SELECT 0 AS lid, l.account_id AS account_id, \
- '' AS ldate, '' AS lcode, 0.0 AS amount_currency, \
- '' AS lref, 'Initial Balance' AS lname, \
- COALESCE(SUM(l.debit),0.0) AS debit, \
- COALESCE(SUM(l.credit),0.0) AS credit, \
- COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) as balance, \
- '' AS lpartner_id,\
- '' AS move_name, '' AS mmove_id, '' AS currency_code,\
- NULL AS currency_id,\
- '' AS invoice_id, '' AS invoice_type, '' AS invoice_number,\
- '' AS partner_name\
- FROM account_move_line l\
- LEFT JOIN account_move m ON (l.move_id=m.id)\
- LEFT JOIN res_currency c ON (l.currency_id=c.id)\
- LEFT JOIN res_partner p ON (l.partner_id=p.id)\
- JOIN account_journal j ON (l.journal_id=j.id)\
- WHERE l.account_id IN %s""" + filters + ' GROUP BY l.account_id')
- params = (tuple(accounts.ids),) + tuple(init_where_params)
- cr.execute(sql, params)
- for row in cr.dictfetchall():
- move_lines[row.pop('account_id')].append(row)
- sql_sort = 'l.date, l.move_id'
- if sortby == 'sort_journal_partner':
- sql_sort = 'j.code, p.name, l.move_id'
-
- # Prepare sql query base on selected parameters from wizard
- tables, where_clause, where_params = move_line._query_get()
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- filters = " AND ".join(wheres)
- filters = filters.replace('account_move_line__move_id', 'm').replace(
- 'account_move_line', 'l')
-
- # Get move lines base on sql query and Calculate the total
- # balance of move lines
- sql = ('''SELECT l.id AS lid, l.account_id \
- AS account_id, l.date AS ldate, j.code AS lcode,\
- l.currency_id, l.amount_currency, l.ref AS lref, l.name AS lname,\
- COALESCE(l.debit,0) AS debit, \
- COALESCE(l.credit,0) AS credit, \
- COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS balance,\
- m.name AS move_name, c.symbol AS \
- currency_code, p.name AS partner_name\
- FROM account_move_line l\
- JOIN account_move m ON (l.move_id=m.id)\
- LEFT JOIN res_currency c ON (l.currency_id=c.id)\
- LEFT JOIN res_partner p ON (l.partner_id=p.id)\
- JOIN account_journal j ON (l.journal_id=j.id)\
- JOIN account_account acc ON (l.account_id = acc.id) \
- WHERE l.account_id IN %s ''' + filters + ''' GROUP BY \
- l.id, l.account_id, l.date, j.code, l.currency_id, \
- l.amount_currency, l.ref, l.name, m.name, \
- c.symbol, p.name ORDER BY ''' + sql_sort)
- params = (tuple(accounts.ids),) + tuple(where_params)
- cr.execute(sql, params)
-
- for row in cr.dictfetchall():
- balance = 0
- for line in move_lines.get(row['account_id']):
- balance += line['debit'] - line['credit']
- row['balance'] += balance
- move_lines[row.pop('account_id')].append(row)
-
- # Calculate the debit, credit and balance for Accounts
- account_res = []
- for account in accounts:
- account_company = self.env.company
- currency = account.currency_id and \
- account.currency_id or account_company.currency_id
- res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance'])
- res['code'] = account.code
- res['name'] = account.name
- res['move_lines'] = move_lines[account.id]
- for line in res.get('move_lines'):
- res['debit'] += line['debit']
- res['credit'] += line['credit']
- res['balance'] = line['balance']
- if display_account == 'all':
- account_res.append(res)
- if display_account == 'movement' and res.get('move_lines'):
- account_res.append(res)
- if display_account == 'not_zero' and not currency.is_zero(
- res['balance']):
- account_res.append(res)
- return account_res
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form') or not self.env.context.get('active_model'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- model = self.env.context.get('active_model')
- docs = self.env[model].browse(self.env.context.get('active_ids', []))
- init_balance = data['form'].get('initial_balance', True)
- sortby = data['form'].get('sortby', 'sort_date')
- display_account = 'movement'
- codes = []
- if data['form'].get('journal_ids', False):
- codes = [journal.code for journal in
- self.env['account.journal'].search(
- [('id', 'in', data['form']['journal_ids'])])]
- account_ids = data['form']['account_ids']
- accounts = self.env['account.account'].search(
- [('id', 'in', account_ids)])
- if not accounts:
- journals = self.env['account.journal'].search([('type', '=', 'bank')])
- accounts = []
- for journal in journals:
- accounts.append(journal.default_account_id.id)
- accounts = self.env['account.account'].search([('id', 'in', accounts)])
-
- accounts_res = self.with_context(data['form'].get('used_context', {}))._get_account_move_entry(
- accounts,
- init_balance,
- sortby,
- display_account)
- return {
- 'doc_ids': docids,
- 'doc_model': model,
- 'data': data['form'],
- 'docs': docs,
- 'time': time,
- 'Accounts': accounts_res,
- 'print_journal': codes,
- }
diff --git a/addons/base_accounting_kit/report/account_bank_book_template.xml b/addons/base_accounting_kit/report/account_bank_book_template.xml
deleted file mode 100644
index c3b45d8..0000000
--- a/addons/base_accounting_kit/report/account_bank_book_template.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
: Bank Book Report
-
-
-
- Journals:
-
-
-
- Display Account
-
- All accounts'
- With movements
- With balance not equal to zero
-
-
-
- Target Moves:
-
All Entries
-
All Posted Entries
-
-
-
-
-
- Sorted By:
-
Date
-
Journal and Partner
-
-
-
- Date from :
-
-
-
-
- Date to :
-
-
-
-
-
-
-
-
-
Date
-
JRNL
-
Partner
-
Ref
-
Move
-
Entry Label
-
Debit
-
Credit
-
Balance
-
Currency
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/account_cash_book.py b/addons/base_accounting_kit/report/account_cash_book.py
deleted file mode 100644
index 874184c..0000000
--- a/addons/base_accounting_kit/report/account_cash_book.py
+++ /dev/null
@@ -1,220 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportCashBook(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_cash_book'
- _description = 'Cash Book Report'
-
- def _get_account_move_entry(self, accounts, init_balance, sortby, display_account):
- cr = self.env.cr
- move_line = self.env['account.move.line']
- move_lines = {x: [] for x in accounts.ids}
-
- # ------------------------------
- # 1. Initial Balance
- # ------------------------------
- if init_balance:
- init_tables, init_where_clause, init_where_params = move_line.with_context(
- date_from=self.env.context.get('date_from'),
- date_to=False,
- initial_bal=True,
- )._query_get()
-
- init_wheres = [""]
- if init_where_clause.strip():
- init_wheres.append(init_where_clause.strip())
- init_filters = " AND ".join(init_wheres)
- init_filters = init_filters.replace('account_move_line__move_id', 'm').replace(
- 'account_move_line', 'l'
- )
-
- sql = """
- SELECT 0 AS lid, l.account_id AS account_id, '' AS ldate,
- '' AS lcode, 0.0 AS amount_currency, '' AS lref,
- 'Initial Balance' AS lname,
- COALESCE(SUM(l.debit),0.0) AS debit,
- COALESCE(SUM(l.credit),0.0) AS credit,
- COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS balance,
- '' AS lpartner_id, '' AS move_name, '' AS mmove_id,
- '' AS currency_code, NULL AS currency_id,
- '' AS invoice_id, '' AS invoice_type, '' AS invoice_number,
- '' AS partner_name
- FROM account_move_line l
- LEFT JOIN account_move m ON (l.move_id=m.id)
- LEFT JOIN res_currency c ON (l.currency_id=c.id)
- LEFT JOIN res_partner p ON (l.partner_id=p.id)
- JOIN account_journal j ON (l.journal_id=j.id)
- WHERE l.account_id IN %s
- """ + init_filters + """
- GROUP BY l.account_id
- """
- params = (tuple(accounts.ids) or (0,),) + tuple(init_where_params)
- cr.execute(sql, params)
- for row in cr.dictfetchall():
- move_lines[row.pop('account_id')].append(row)
-
- # ------------------------------
- # 2. Sorting
- # ------------------------------
- sql_sort = 'l.date, l.move_id'
- if sortby == 'sort_journal_partner':
- sql_sort = 'j.code, p.name, l.move_id'
-
- # ------------------------------
- # 3. Prepare SQL filters
- # ------------------------------
- tables, where_clause, where_params = move_line._query_get()
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- filters = " AND ".join(wheres)
- filters = filters.replace('account_move_line__move_id', 'm').replace(
- 'account_move_line', 'l'
- )
-
- # ------------------------------
- # 4. Accounts fallback
- # ------------------------------
- if not accounts:
- # fallback: take receivable/payable accounts if none passed
- accounts = self.env['account.account'].search([
- ('account_type', 'in', ['asset_receivable', 'liability_payable'])
- ])
-
- if not accounts.ids:
- return [] # no accounts, no results
-
- account_ids = tuple(accounts.ids) or (0,)
- params = (account_ids,) + tuple(where_params)
-
- # ------------------------------
- # 5. Main SQL query
- # ------------------------------
- sql = """
- SELECT l.id AS lid, l.account_id AS account_id, l.date AS ldate,
- j.code AS lcode, l.currency_id, l.amount_currency, l.ref AS lref,
- l.name AS lname, COALESCE(l.debit,0) AS debit,
- COALESCE(l.credit,0) AS credit,
- COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS balance,
- m.name AS move_name, c.symbol AS currency_code, p.name AS partner_name
- FROM account_move_line l
- JOIN account_move m ON (l.move_id=m.id)
- LEFT JOIN res_currency c ON (l.currency_id=c.id)
- LEFT JOIN res_partner p ON (l.partner_id=p.id)
- JOIN account_journal j ON (l.journal_id=j.id)
- JOIN account_account acc ON (l.account_id = acc.id)
- WHERE l.account_id IN %s
- """ + filters + """
- GROUP BY l.id, l.account_id, l.date, j.code, l.currency_id,
- l.amount_currency, l.ref, l.name, m.name, c.symbol, p.name
- ORDER BY """ + sql_sort
-
- cr.execute(sql, params)
-
- # ------------------------------
- # 6. Attach lines to accounts
- # ------------------------------
- for row in cr.dictfetchall():
- balance = 0
- for line in move_lines.get(row['account_id'], []): # ✅ safe fallback
- balance += line['debit'] - line['credit']
- row['balance'] += balance
-
- acc_id = row.pop('account_id')
- if acc_id not in move_lines:
- move_lines[acc_id] = [] # ✅ ensure list exists
- move_lines[acc_id].append(row)
-
- # ------------------------------
- # 7. Build account results
- # ------------------------------
- account_res = []
- for account in accounts:
- account_company = self.env.company
- currency = account.currency_id or account_company.currency_id
- res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance'])
- res['code'] = account.code
- res['name'] = account.name
- res['move_lines'] = move_lines.get(account.id, []) # ✅ safe lookup
-
- for line in res['move_lines']:
- res['debit'] += line['debit']
- res['credit'] += line['credit']
- res['balance'] = line['balance']
-
- if display_account == 'all':
- account_res.append(res)
- elif display_account == 'movement' and res.get('move_lines'):
- account_res.append(res)
- elif display_account == 'not_zero' and not currency.is_zero(res['balance']):
- account_res.append(res)
-
- return account_res
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form') or not self.env.context.get('active_model'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- model = self.env.context.get('active_model')
- docs = self.env[model].browse(
- self.env.context.get('active_ids', []))
- init_balance = data['form'].get('initial_balance', True)
- sortby = data['form'].get('sortby', 'sort_date')
- display_account = 'movement'
- codes = []
- if data['form'].get('journal_ids', False):
- codes = [journal.code for journal in
- self.env['account.journal'].search(
- [('id', 'in', data['form']['journal_ids'])])]
- account_ids = data['form']['account_ids']
- accounts = self.env['account.account'].search(
- [('id', 'in', account_ids)])
- if not accounts:
- journals = self.env['account.journal'].search(
- [('type', '=', 'cash')])
- accounts = []
- for journal in journals:
- accounts.append(
- journal.default_account_id.id)
- accounts = self.env['account.account'].search(
- [('id', 'in', accounts)])
- accounts_res = self.with_context(
- data['form'].get('used_context', {}))._get_account_move_entry(
- accounts,
- init_balance,
- sortby,
- display_account)
- return {
- 'doc_ids': docids,
- 'doc_model': model,
- 'data': data['form'],
- 'docs': docs,
- 'time': time,
- 'Accounts': accounts_res,
- 'print_journal': codes,
- }
diff --git a/addons/base_accounting_kit/report/account_cash_book_template.xml b/addons/base_accounting_kit/report/account_cash_book_template.xml
deleted file mode 100644
index 47bd54d..0000000
--- a/addons/base_accounting_kit/report/account_cash_book_template.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
-
-
-
-
: Cash Book Report
-
-
-
- Journals:
-
-
-
- Display Account
-
-
- All accounts'
-
-
- With movements
-
-
- With balance not equal to zero
-
-
-
-
- Target Moves:
-
All Entries
-
-
All Posted
- Entries
-
-
-
-
-
-
- Sorted By:
-
Date
-
- Journal and Partner
-
-
-
-
- Date from :
-
-
-
-
- Date to :
-
-
-
-
-
-
-
-
-
Date
-
JRNL
-
Partner
-
Ref
-
Move
-
Entry Label
-
Debit
-
Credit
-
Balance
-
- Currency
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/account_day_book.py b/addons/base_accounting_kit/report/account_day_book.py
deleted file mode 100644
index d4e5393..0000000
--- a/addons/base_accounting_kit/report/account_day_book.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from datetime import timedelta, datetime
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class DayBookPdfReport(models.AbstractModel):
- _name = 'report.base_accounting_kit.day_book_report_template'
- _description = 'Day Book Report'
-
- def _get_account_move_entry(self, accounts, form_data, pass_date):
- cr = self.env.cr
- move_line = self.env['account.move.line']
- tables, where_clause, where_params = move_line._query_get()
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- if form_data['target_move'] == 'posted':
- target_move = "AND m.state = 'posted'"
- else:
- target_move = ''
- sql = ('''
- SELECT l.id AS lid, acc.name as accname, l.account_id AS
- account_id, l.date AS ldate, j.code AS lcode, l.currency_id,
- l.amount_currency, l.ref AS lref, l.name AS lname,
- COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit,
- COALESCE(SUM(l.debit),0) - COALESCE(SUM(l.credit), 0) AS
- balance,
- m.name AS move_name, c.symbol AS currency_code, p.name
- AS partner_name
- FROM account_move_line l
- JOIN account_move m ON (l.move_id=m.id)
- LEFT JOIN res_currency c ON (l.currency_id=c.id)
- LEFT JOIN res_partner p ON (l.partner_id=p.id)
- JOIN account_journal j ON (l.journal_id=j.id)
- JOIN account_account acc ON (l.account_id = acc.id)
- WHERE l.account_id IN %s AND l.journal_id IN %s '''
- + target_move + ''' AND l.date = %s
- GROUP BY l.id, l.account_id, l.date,
- j.code, l.currency_id, l.amount_currency, l.ref,
- l.name, m.name, c.symbol, p.name , acc.name
- ORDER BY l.date DESC
- ''')
- params = (
- tuple(accounts.ids), tuple(form_data['journal_ids']), pass_date)
- cr.execute(sql, params)
- data = cr.dictfetchall()
- res = {}
- debit = credit = balance = 0.00
- for line in data:
- debit += line['debit']
- credit += line['credit']
- balance += line['balance']
- res['debit'] = debit
- res['credit'] = credit
- res['balance'] = balance
- res['lines'] = data
- return res
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form') or not self.env.context.get('active_model'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- model = self.env.context.get('active_model')
- docs = self.env[model].browse(
- self.env.context.get('active_ids', []))
- form_data = data['form']
- codes = []
- if data['form'].get('journal_ids', False):
- codes = [journal.code for journal in
- self.env['account.journal'].search(
- [('id', 'in', data['form']['journal_ids'])])]
- active_acc = data['form']['account_ids']
- accounts = self.env['account.account'].search(
- [('id', 'in', active_acc)]) if data['form']['account_ids'] else \
- self.env['account.account'].search([])
-
- date_start = datetime.strptime(form_data['date_from'],
- '%Y-%m-%d').date()
- date_end = datetime.strptime(form_data['date_to'], '%Y-%m-%d').date()
- days = date_end - date_start
- dates = []
- record = []
- for i in range(days.days + 1):
- dates.append(date_start + timedelta(days=i))
- for head in dates:
- pass_date = str(head)
- accounts_res = self.with_context(
- data['form'].get('used_context', {}))._get_account_move_entry(
- accounts, form_data, pass_date)
- if accounts_res['lines']:
- record.append({
- 'date': head,
- 'debit': accounts_res['debit'],
- 'credit': accounts_res['credit'],
- 'balance': accounts_res['balance'],
- 'child_lines': accounts_res['lines']
- })
- return {
- 'doc_ids': docids,
- 'doc_model': model,
- 'data': data['form'],
- 'docs': docs,
- 'time': time,
- 'Accounts': record,
- 'print_journal': codes,
- }
diff --git a/addons/base_accounting_kit/report/account_day_book_template.xml b/addons/base_accounting_kit/report/account_day_book_template.xml
deleted file mode 100644
index 11467b8..0000000
--- a/addons/base_accounting_kit/report/account_day_book_template.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
-
-
-
-
-
-
: Day Book Report
-
-
-
- Journals:
-
-
-
- Target Moves:
-
All Entries
-
All Posted Entries
-
-
-
- Date from :
-
-
-
-
- Date to :
-
-
-
-
-
-
-
-
-
Date
-
JRNL
-
Partner
-
Ref
-
Move
-
Entry Label
-
Debit
-
Credit
-
Balance
-
Currency
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/account_report_common_account.py b/addons/base_accounting_kit/report/account_report_common_account.py
deleted file mode 100644
index bba1cd4..0000000
--- a/addons/base_accounting_kit/report/account_report_common_account.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-from odoo.tools.misc import get_lang
-
-
-class AccountCommonAccountReport(models.TransientModel):
- _name = 'account.common.account.report'
- _description = 'Account Common Account Report'
- _inherit = "account.report"
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_common_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_common_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- display_account = fields.Selection(
- [('all', 'All'), ('movement', 'With movements'),
- ('not_zero', 'With balance is not equal to 0')],
- string='Display Accounts', required=True, default='movement')
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], string='Target Moves', required=True, default='posted')
- date_from = fields.Date(string='Start Date')
- date_to = fields.Date(string='End Date')
- company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True,
- default=lambda self: self.env.company)
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- result['company_id'] = data['form']['company_id'][0] or False
- return result
-
- def _print_report(self, data):
- raise NotImplementedError()
-
- def check_report(self):
- self.ensure_one()
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code)
- return self.with_context(discard_logo_check=True)._print_report(data)
-
- def pre_print_report(self, data):
- data['form'].update(self.read(['display_account'])[0])
- return data
diff --git a/addons/base_accounting_kit/report/cash_flow_report.py b/addons/base_accounting_kit/report/cash_flow_report.py
deleted file mode 100644
index 8c21d0d..0000000
--- a/addons/base_accounting_kit/report/cash_flow_report.py
+++ /dev/null
@@ -1,215 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportFinancial(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_cash_flow'
- _description = 'Cash Flow Report'
-
- def _compute_account_balance(self, accounts):
- mapping = {
- 'balance': "COALESCE(SUM(debit),0) - COALESCE(SUM(credit), 0) as balance",
- 'debit': "COALESCE(SUM(debit), 0) as debit",
- 'credit': "COALESCE(SUM(credit), 0) as credit",
- }
-
- res = {}
- for account in accounts:
- res[account.id] = dict.fromkeys(mapping, 0.0)
- if accounts:
- tables, where_clause, where_params = self.env[
- 'account.move.line']._query_get()
- tables = tables.replace('"', '') if tables else "account_move_line"
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- filters = " AND ".join(wheres)
- request = "SELECT account_id as id, " + ', '.join(
- mapping.values()) + \
- " FROM " + tables + \
- " WHERE account_id IN %s " \
- + filters + \
- " GROUP BY account_id"
- params = (tuple(accounts._ids),) + tuple(where_params)
- self.env.cr.execute(request, params)
- for row in self.env.cr.dictfetchall():
- res[row['id']] = row
- return res
-
- def _compute_report_balance(self, reports):
- res = {}
- fields = ['credit', 'debit', 'balance']
- for report in reports:
- if report.id in res:
- continue
- res[report.id] = dict((fn, 0.0) for fn in fields)
- if report.type == 'accounts':
- # it's the sum of credit or debit
- res2 = self._compute_report_balance(report.parent_id)
- for key, value in res2.items():
- cash_in_operation = self.env.ref(
- 'base_accounting_kit.cash_in_from_operation0')
- cash_out_operation = self.env.ref(
- 'base_accounting_kit.cash_out_operation1')
- cash_in_financial = self.env.ref(
- 'base_accounting_kit.cash_in_financial0')
- cash_out_financial = self.env.ref(
- 'base_accounting_kit.cash_out_financial1')
- cash_in_investing = self.env.ref(
- 'base_accounting_kit.cash_in_investing0')
- cash_out_investing = self.env.ref(
- 'base_accounting_kit.cash_out_investing1')
- if report == cash_in_operation or report == cash_in_financial or report == cash_in_investing:
- res[report.id]['debit'] += value['debit']
- res[report.id]['balance'] += value['debit']
- elif report == cash_out_operation or report == cash_out_financial or report == cash_out_investing:
- res[report.id]['credit'] += value['credit']
- res[report.id]['balance'] += -(value['credit'])
- elif report.type == 'account_type':
- # it's the sum the leaf accounts with such an account type
- accounts = self.env['account.account'].search(
- [('account_type', 'in', report.account_type_ids)])
- res[report.id]['account'] = self._compute_account_balance(
- accounts)
- for value in res[report.id]['account'].values():
- for field in fields:
- res[report.id][field] += value.get(field)
- elif report.type == 'account_report' and report.account_report_id:
- # it's the amount of the linked
- res[report.id]['account'] = self._compute_account_balance(
- report.account_ids)
- for value in res[report.id]['account'].values():
- for field in fields:
- res[report.id][field] += value.get(field)
-
- elif report.type == 'sum':
- # it's the sum of the linked accounts
- res[report.id]['account'] = self._compute_account_balance(
- report.account_ids)
- for values in res[report.id]['account'].values():
- for field in fields:
- res[report.id][field] += values.get(field)
- return res
-
- def get_account_lines(self, data):
- lines = []
- account_report = self.env['account.financial.report'].search(
- [('id', '=', data['account_report_id'][0])])
- child_reports = account_report._get_children_by_order()
- res = self.with_context(
- data.get('used_context'))._compute_report_balance(child_reports)
- if data['enable_filter']:
- comparison_res = self.with_context(
- data.get('comparison_context'))._compute_report_balance(
- child_reports)
- for report_id, value in comparison_res.items():
- res[report_id]['comp_bal'] = value['balance']
- report_acc = res[report_id].get('account')
- if report_acc:
- for account_id, val in comparison_res[report_id].get(
- 'account').items():
- report_acc[account_id]['comp_bal'] = val['balance']
-
- for report in child_reports:
- vals = {
- 'name': report.name,
- 'balance': res[report.id]['balance'] * int(report.sign),
- 'type': 'report',
- 'level': bool(report.style_overwrite) and int(
- report.style_overwrite) or report.level,
- 'account_type': report.type or False,
- # used to underline the financial report balances
- }
- if data['debit_credit']:
- vals['debit'] = res[report.id]['debit']
- vals['credit'] = res[report.id]['credit']
-
- if data['enable_filter']:
- vals['balance_cmp'] = res[report.id]['comp_bal'] * int(
- report.sign)
-
- lines.append(vals)
- if report.display_detail == 'no_detail':
- # the rest of the loop is used to display the details of the financial report, so it's not needed here.
- continue
- if res[report.id].get('account'):
- # if res[report.id].get('debit'):
- sub_lines = []
- for account_id, value in res[report.id]['account'].items():
- # if there are accounts to display, we add them to the
- # lines with a level equals to their level in
- # the COA + 1 (to avoid having them with a too low level
- # that would conflicts with the level of data
- # financial reports for Assets, liabilities...)
- flag = False
- account = self.env['account.account'].browse(account_id)
- vals = {
- 'name': account.code + ' ' + account.name,
- 'balance': value['balance'] * int(report.sign) or 0.0,
- 'type': 'account',
- 'level': report.display_detail == 'detail_with_hierarchy' and 4,
- 'account_type': account.internal_type,
- }
- if data['debit_credit']:
- vals['debit'] = value['debit']
- vals['credit'] = value['credit']
- if not account.company_id.currency_id.is_zero(
- vals[
- 'debit']) or not account.company_id.currency_id.is_zero(
- vals['credit']):
- flag = True
- if not account.company_id.currency_id.is_zero(
- vals['balance']):
- flag = True
- if data['enable_filter']:
- vals['balance_cmp'] = value['comp_bal'] * int(
- report.sign)
- if not account.company_id.currency_id.is_zero(
- vals['balance_cmp']):
- flag = True
- if flag:
- sub_lines.append(vals)
- lines += sorted(sub_lines,
- key=lambda sub_line: sub_line['name'])
- return lines
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form') or not self.env.context.get(
- 'active_model') or not self.env.context.get('active_id'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- model = self.env.context.get('active_model')
- docs = self.env[model].browse(self.env.context.get('active_id'))
- report_lines = self.get_account_lines(data.get('form'))
- return {
- 'doc_ids': self.ids,
- 'doc_model': model,
- 'data': data['form'],
- 'docs': docs,
- 'time': time,
- 'get_account_lines': report_lines,
- }
diff --git a/addons/base_accounting_kit/report/cash_flow_report_template.xml b/addons/base_accounting_kit/report/cash_flow_report_template.xml
deleted file mode 100644
index d638933..0000000
--- a/addons/base_accounting_kit/report/cash_flow_report_template.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- Target Moves:
-
- All Entries
- All Posted Entries
-
-
-
-
- Date from :
-
-
- Date to :
-
-
-
-
-
-
-
-
- Name
-
-
- Debit
-
-
- Credit
-
-
- Balance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/general_ledger_report.py b/addons/base_accounting_kit/report/general_ledger_report.py
deleted file mode 100644
index 902854a..0000000
--- a/addons/base_accounting_kit/report/general_ledger_report.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportGeneralLedger(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_general_ledger'
- _description = 'General Ledger Report'
-
- def _get_account_move_entry(self, accounts, init_balance, sortby,
- display_account):
- """
- :param:
- accounts: the recordset of accounts
- init_balance: boolean value of initial_balance
- sortby: sorting by date or partner and journal
- display_account: type of account(receivable, payable and both)
-
- Returns a dictionary of accounts with following key and value {
- 'code': account code,
- 'name': account name,
- 'debit': sum of total debit amount,
- 'credit': sum of total credit amount,
- 'balance': total balance,
- 'amount_currency': sum of amount_currency,
- 'move_lines': list of move line
- }
- """
- cr = self.env.cr
- MoveLine = self.env['account.move.line']
- move_lines = {x: [] for x in accounts.ids}
-
- # Prepare initial sql query and Get the initial move lines
- if init_balance:
- init_tables, init_where_clause, init_where_params = MoveLine.with_context(
- date_from=self.env.context.get('date_from'), date_to=False,
- initial_bal=True)._query_get()
- init_wheres = [""]
- if init_where_clause.strip():
- init_wheres.append(init_where_clause.strip())
- init_filters = " AND ".join(init_wheres)
- filters = init_filters.replace('account_move_line__move_id',
- 'm').replace('account_move_line',
- 'l')
- sql = ("""SELECT 0 AS lid, l.account_id AS account_id, ''
- AS ldate, '' AS lcode, 0.0 AS amount_currency, '' AS lref,
- 'Initial Balance' AS lname, COALESCE(SUM(l.debit),0.0) AS debit,
- COALESCE(SUM(l.credit),0.0) AS credit, COALESCE(SUM(l.debit),0)
- - COALESCE(SUM(l.credit), 0) as balance, '' AS lpartner_id,\
- '' AS move_name, '' AS mmove_id, '' AS currency_code,\
- NULL AS currency_id,\
- '' AS invoice_id, '' AS invoice_type, '' AS invoice_number,\
- '' AS partner_name\
- FROM account_move_line l\
- LEFT JOIN account_move m ON (l.move_id=m.id)\
- LEFT JOIN res_currency c ON (l.currency_id=c.id)\
- LEFT JOIN res_partner p ON (l.partner_id=p.id)\
- LEFT JOIN account_move i ON (m.id =i.id)\
- JOIN account_journal j ON (l.journal_id=j.id)\
- WHERE l.account_id IN %s""" + filters +
- ' GROUP BY l.account_id')
- params = (tuple(accounts.ids),) + tuple(init_where_params)
- cr.execute(sql, params)
- for row in cr.dictfetchall():
- move_lines[row.pop('account_id')].append(row)
-
- sql_sort = 'l.date, l.move_id'
- if sortby == 'sort_journal_partner':
- sql_sort = 'j.code, p.name, l.move_id'
-
- # Prepare sql query base on selected parameters from wizard
- tables, where_clause, where_params = MoveLine._query_get()
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- filters = " AND ".join(wheres)
- filters = filters.replace('account_move_line__move_id', 'm').replace(
- 'account_move_line', 'l')
-
- # Get move lines base on sql query and Calculate the total balance of move lines
- sql = ('''SELECT l.id AS lid, l.account_id AS account_id,
- l.date AS ldate, j.code AS lcode, l.currency_id, l.amount_currency,
- l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit,
- COALESCE(l.credit,0) AS credit, COALESCE(SUM(l.debit),0) -
- COALESCE(SUM(l.credit), 0) AS balance,\
- m.name AS move_name, c.symbol AS currency_code, p.name AS
- partner_name\
- FROM account_move_line l\
- JOIN account_move m ON (l.move_id=m.id)\
- LEFT JOIN res_currency c ON (l.currency_id=c.id)\
- LEFT JOIN res_partner p ON (l.partner_id=p.id)\
- JOIN account_journal j ON (l.journal_id=j.id)\
- JOIN account_account acc ON (l.account_id = acc.id) \
- WHERE l.account_id IN %s ''' + filters + ''' GROUP BY l.id,
- l.account_id, l.date, j.code, l.currency_id, l.amount_currency,
- l.ref, l.name, m.name, c.symbol, p.name ORDER BY ''' + sql_sort)
- params = (tuple(accounts.ids),) + tuple(where_params)
- cr.execute(sql, params)
-
- for row in cr.dictfetchall():
- balance = 0
- for line in move_lines.get(row['account_id']):
- balance += line['debit'] - line['credit']
- row['balance'] += balance
- move_lines[row.pop('account_id')].append(row)
-
- # Calculate the debit, credit and balance for Accounts
- account_res = []
- for account in accounts:
- account_company = self.env.company
- currency = account.currency_id and account.currency_id or account_company.currency_id
- res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance'])
- res['code'] = account.code
- res['name'] = account.name
- res['move_lines'] = move_lines[account.id]
- for line in res.get('move_lines'):
- res['debit'] += line['debit']
- res['credit'] += line['credit']
- res['balance'] = line['balance']
- if display_account == 'all':
- account_res.append(res)
- if display_account == 'movement' and res.get('move_lines'):
- account_res.append(res)
- if display_account == 'not_zero' and not currency.is_zero(
- res['balance']):
- account_res.append(res)
-
- return account_res
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form') or not self.env.context.get('active_model'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- model = self.env.context.get('active_model')
- docs = self.env[model].browse(
- self.env.context.get('active_ids', []))
-
- init_balance = data['form'].get('initial_balance', True)
- sortby = data['form'].get('sortby', 'sort_date')
- display_account = data['form']['display_account']
- codes = []
- if data['form'].get('journal_ids', False):
- codes = [journal.code for journal in
- self.env['account.journal'].search(
- [('id', 'in', data['form']['journal_ids'])])]
-
- accounts = docs if model == 'account.account' else self.env[
- 'account.account'].search([])
- accounts_res = self.with_context(
- data['form'].get('used_context', {}))._get_account_move_entry(
- accounts, init_balance, sortby, display_account)
- return {
- 'doc_ids': docids,
- 'doc_model': model,
- 'data': data['form'],
- 'docs': docs,
- 'time': time,
- 'Accounts': accounts_res,
- 'print_journal': codes,
- }
diff --git a/addons/base_accounting_kit/report/general_ledger_report_template.xml b/addons/base_accounting_kit/report/general_ledger_report_template.xml
deleted file mode 100644
index ab82c73..0000000
--- a/addons/base_accounting_kit/report/general_ledger_report_template.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
: General ledger
-
-
- Journals:
-
-
-
- Display Account
-
- All accounts'
- With movements
- With balance not equal to zero
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/report_financial.py b/addons/base_accounting_kit/report/report_financial.py
deleted file mode 100644
index 9d968e9..0000000
--- a/addons/base_accounting_kit/report/report_financial.py
+++ /dev/null
@@ -1,157 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models
-
-
-# ---------------------------------------------------------
-# Account Financial Report
-# ---------------------------------------------------------
-class AccountTypes(models.Model):
- _name = "account.account.type"
-
- name = fields.Char(string='Account Type', required=True, translate=True)
- type = fields.Selection([
- ('other', 'Regular'),
- ('receivable', 'Receivable'),
- ('payable', 'Payable'),
- ('liquidity', 'Liquidity'),
- ], required=True, default='other',
- help="The 'Internal Type' is used for features available on "
- "different types of accounts: liquidity type is for cash or "
- "bank accounts" \
- ", payable/receivable is for vendor/customer accounts.")
-
-
-class AccountFinancialReport(models.Model):
- _name = "account.financial.report"
- _description = "Account Report"
- _rec_name = 'name'
-
- @api.depends('parent_id', 'parent_id.level')
- def _get_level(self):
- """Returns a dictionary with key=the ID of a record and
- value = the level of this
- record in the tree structure."""
- for report in self:
- level = 0
- if report.parent_id:
- level = report.parent_id.level + 1
- report.level = level
-
- def _get_children_by_order(self):
- """returns a recordset of all the children computed recursively,
- and sorted by sequence. Ready for the printing"""
- res = self
- children = self.search([('parent_id', 'in', self.ids)],
- order='sequence ASC')
- if children:
- for child in children:
- res += child._get_children_by_order()
- return res
-
- name = fields.Char('Report Name', required=True, translate=True)
- parent_id = fields.Many2one('account.financial.report', 'Parent')
- children_ids = fields.One2many(
- 'account.financial.report',
- 'parent_id',
- 'Account Report')
- sequence = fields.Integer('Sequence')
- level = fields.Integer(compute='_get_level', string='Level', store=True, recursive=True)
- type = fields.Selection(
- [('sum', 'View'),
- ('accounts', 'Accounts'),
- ('account_type', 'Account Type'),
- ('account_report', 'Report Value')],
- 'Type',
- default='sum')
- account_ids = fields.Many2many(
- 'account.account',
- 'account_account_financial_report',
- 'report_line_id',
- 'account_id',
- 'Accounts')
- account_report_id = fields.Many2one(
- 'account.financial.report',
- 'Report Value')
- # account_type_ids = fields.Many2many(
- # 'account.account.type',
- # 'Account Types')
- account_type_ids = fields.Selection(
- selection=[
- ("asset_receivable", "Receivable"),
- ("asset_cash", "Bank and Cash"),
- ("asset_current", "Current Assets"),
- ("asset_non_current", "Non-current Assets"),
- ("asset_prepayments", "Prepayments"),
- ("asset_fixed", "Fixed Assets"),
- ("liability_payable", "Payable"),
- ("liability_credit_card", "Credit Card"),
- ("liability_current", "Current Liabilities"),
- ("liability_non_current", "Non-current Liabilities"),
- ("equity", "Equity"),
- ("equity_unaffected", "Current Year Earnings"),
- ("income", "Income"),
- ("income_other", "Other Income"),
- ("expense", "Expenses"),
- ("expense_depreciation", "Depreciation"),
- ("expense_direct_cost", "Cost of Revenue"),
- ("off_balance", "Off-Balance Sheet"),
- ],
- string="Type",
- help="These types are defined according to your country. The type contains more information " \
- "about the account and its specificities."
- )
-
- sign = fields.Selection(
- [("-1", 'Reverse balance sign'), ("1", 'Preserve balance sign')],
- 'Sign on Reports', required=True, default="1",
- help='For accounts that are typically more'
- ' debited than credited and that you'
- ' would like to print as negative'
- ' amounts in your reports, you should'
- ' reverse the sign of the balance;'
- ' e.g.: Expense account. The same applies'
- ' for accounts that are typically more'
- ' credited than debited and that you would'
- ' like to print as positive amounts in'
- ' your reports; e.g.: Income account.')
- display_detail = fields.Selection(
- [('no_detail', 'No detail'),
- ('detail_flat', 'Display children flat'),
- ('detail_with_hierarchy', 'Display children with hierarchy')],
- 'Display details',
- default='detail_flat')
- style_overwrite = fields.Selection(
- [('0', 'Automatic formatting'),
- ('1', 'Main Title 1 (bold, underlined)'),
- ('2', 'Title 2 (bold)'),
- ('3', 'Title 3 (bold, smaller)'),
- ('4', 'Normal Text'),
- ('5', 'Italic Text (smaller)'),
- ('6', 'Smallest Text')],
- 'Financial Report Style',
- default='0',
- help="You can set up here the format you want this"
- " record to be displayed. If you leave the"
- " automatic formatting, it will be computed"
- " based on the financial reports hierarchy "
- "(auto-computed field 'level').")
diff --git a/addons/base_accounting_kit/report/report_financial_template.xml b/addons/base_accounting_kit/report/report_financial_template.xml
deleted file mode 100644
index fcbb47a..0000000
--- a/addons/base_accounting_kit/report/report_financial_template.xml
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- Target Moves:
-
- All Entries
- All Posted Entries
-
-
-
-
-
- Date from :
-
-
-
-
- Date to :
-
-
-
-
-
-
-
-
-
Name
-
Debit
-
Credit
-
Balance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Name
-
Balance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Name
-
Balance
-
- Comp
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/report_journal_audit.py b/addons/base_accounting_kit/report/report_journal_audit.py
deleted file mode 100644
index ff266cb..0000000
--- a/addons/base_accounting_kit/report/report_journal_audit.py
+++ /dev/null
@@ -1,160 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportJournal(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_journal_audit'
- _description = 'Journal Report'
-
- def lines(self, target_move, journal_ids, sort_selection, data):
- if isinstance(journal_ids, int):
- journal_ids = [journal_ids]
- move_state = ['draft', 'posted']
- if target_move == 'posted':
- move_state = ['posted']
-
- query_get_clause = self._get_query_get_clause(data)
- params = [tuple(move_state), tuple(journal_ids)] + query_get_clause[2]
- query = 'SELECT "account_move_line".id FROM ' + query_get_clause[
- 0] + (', account_move am, account_account acc WHERE '
- '"account_move_line".account_id = acc.id AND '
- '"account_move_line".move_id=am.id AND am.state IN %s AND '
- '"account_move_line".journal_id IN %s AND ') + \
- query_get_clause[1] + ' ORDER BY '
- if sort_selection == 'date':
- query += '"account_move_line".date'
- else:
- query += 'am.name'
- query += ', "account_move_line".move_id'
- self.env.cr.execute(query, tuple(params))
- ids = (x[0] for x in self.env.cr.fetchall())
- return self.env['account.move.line'].browse(ids)
-
- def _sum_debit(self, data, journal_id):
- move_state = ['draft', 'posted']
- if data['form'].get('target_move', 'all') == 'posted':
- move_state = ['posted']
-
- query_get_clause = self._get_query_get_clause(data)
- params = [tuple(move_state), tuple(journal_id.ids)] + query_get_clause[
- 2]
- self.env.cr.execute('SELECT SUM(debit) FROM ' + query_get_clause[
- 0] + ', account_move am '
- 'WHERE "account_move_line".move_id=am.id AND am.state IN %s'
- ' AND "account_move_line".journal_id IN %s AND ' +
- query_get_clause[1] + ' ',
- tuple(params))
- return self.env.cr.fetchone()[0] or 0.0
-
- def _sum_credit(self, data, journal_id):
- move_state = ['draft', 'posted']
- if data['form'].get('target_move', 'all') == 'posted':
- move_state = ['posted']
-
- query_get_clause = self._get_query_get_clause(data)
- params = [tuple(move_state), tuple(journal_id.ids)] + query_get_clause[
- 2]
- self.env.cr.execute('SELECT SUM(credit) FROM ' + query_get_clause[
- 0] + ', account_move am '
- 'WHERE "account_move_line".move_id=am.id AND am.state IN %s AND "account_move_line".journal_id IN %s AND ' +
- query_get_clause[1] + ' ',
- tuple(params))
- return self.env.cr.fetchone()[0] or 0.0
-
- def _get_taxes(self, data, journal_id):
- move_state = ['draft', 'posted']
- if data['form'].get('target_move', 'all') == 'posted':
- move_state = ['posted']
-
- query_get_clause = self._get_query_get_clause(data)
- params = [tuple(move_state), tuple(journal_id.ids)] + query_get_clause[
- 2]
- query = """
- SELECT rel.account_tax_id, SUM("account_move_line".balance) AS base_amount
- FROM account_move_line_account_tax_rel rel, """ + query_get_clause[
- 0] + """
- LEFT JOIN account_move am ON "account_move_line".move_id = am.id
- WHERE "account_move_line".id = rel.account_move_line_id
- AND am.state IN %s
- AND "account_move_line".journal_id IN %s
- AND """ + query_get_clause[1] + """
- GROUP BY rel.account_tax_id"""
- self.env.cr.execute(query, tuple(params))
- ids = []
- base_amounts = {}
- for row in self.env.cr.fetchall():
- ids.append(row[0])
- base_amounts[row[0]] = row[1]
-
- res = {}
- for tax in self.env['account.tax'].browse(ids):
- self.env.cr.execute(
- 'SELECT sum(debit - credit) FROM ' + query_get_clause[
- 0] + ', account_move am '
- 'WHERE "account_move_line".move_id=am.id AND am.state IN %s AND "account_move_line".journal_id IN %s AND ' +
- query_get_clause[1] + ' AND tax_line_id = %s',
- tuple(params + [tax.id]))
- res[tax] = {
- 'base_amount': base_amounts[tax.id],
- 'tax_amount': self.env.cr.fetchone()[0] or 0.0,
- }
- if journal_id.type == 'sale':
- # sales operation are credits
- res[tax]['base_amount'] = res[tax]['base_amount'] * -1
- res[tax]['tax_amount'] = res[tax]['tax_amount'] * -1
- return res
-
- def _get_query_get_clause(self, data):
- return self.env['account.move.line'].with_context(
- data['form'].get('used_context', {}))._query_get()
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- target_move = data['form'].get('target_move', 'all')
- sort_selection = data['form'].get('sort_selection', 'date')
-
- res = {}
- for journal in data['form']['journal_ids']:
- res[journal] = self.with_context(
- data['form'].get('used_context', {})).lines(target_move,
- journal,
- sort_selection,
- data)
- return {
- 'doc_ids': data['form']['journal_ids'],
- 'doc_model': self.env['account.journal'],
- 'data': data,
- 'docs': self.env['account.journal'].browse(
- data['form']['journal_ids']),
- 'time': time,
- 'lines': res,
- 'sum_credit': self._sum_credit,
- 'sum_debit': self._sum_debit,
- 'get_taxes': self._get_taxes,
- }
diff --git a/addons/base_accounting_kit/report/report_journal_audit_template.xml b/addons/base_accounting_kit/report/report_journal_audit_template.xml
deleted file mode 100644
index 0139c76..0000000
--- a/addons/base_accounting_kit/report/report_journal_audit_template.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Journal
-
-
-
-
-
- Company:
-
-
-
-
- Journal:
-
-
-
-
- Entries Sorted By:
-
Journal Entry Number
-
Date
-
-
-
- Target Moves:
-
All Entries
-
All Posted Entries
-
-
-
-
-
-
-
-
Move
-
Date
-
Account
-
Partner
-
Label
-
Debit
-
Credit
-
Currency
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Total
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Tax Declaration
-
-
-
Name
-
Base Amount
-
Tax Amount
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/report_partner_ledger.py b/addons/base_accounting_kit/report/report_partner_ledger.py
deleted file mode 100644
index 1696ab4..0000000
--- a/addons/base_accounting_kit/report/report_partner_ledger.py
+++ /dev/null
@@ -1,170 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportPartnerLedger(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_partnerledger'
- _description = 'Partner Ledger Report'
-
- def _lines(self, data, partner):
- full_account = []
- currency = self.env['res.currency']
- query_get_data = self.env['account.move.line'].with_context(
- data['form'].get('used_context', {}))._query_get()
- reconcile_clause = "" if data['form'][
- 'reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL '
- params = [partner.id, tuple(data['computed']['move_state']),
- tuple(data['computed']['account_ids'])] + \
- query_get_data[2]
- query = """
- SELECT "account_move_line".id, "account_move_line".date, j.code,
- acc.name as a_name, "account_move_line".ref,
- m.name as move_name, "account_move_line".name,
- "account_move_line".debit, "account_move_line".credit,
- "account_move_line".amount_currency,
- "account_move_line".currency_id, c.symbol AS currency_code
- FROM """ + query_get_data[0] + """
- LEFT JOIN account_journal j ON ("account_move_line".journal_id = j.id)
- LEFT JOIN account_account acc ON ("account_move_line".account_id = acc.id)
- LEFT JOIN res_currency c ON ("account_move_line".currency_id=c.id)
- LEFT JOIN account_move m ON (m.id="account_move_line".move_id)
- WHERE "account_move_line".partner_id = %s
- AND m.state IN %s
- AND "account_move_line".account_id IN %s AND """ + \
- query_get_data[1] + reconcile_clause + """
- ORDER BY "account_move_line".date"""
- self.env.cr.execute(query, tuple(params))
- res = self.env.cr.dictfetchall()
- sum = 0.0
- lang_code = self.env.context.get('lang') or 'en_US'
- lang = self.env['res.lang']
- lang_id = lang._lang_get(lang_code)
- date_format = lang_id.date_format
- for r in res:
- r['date'] = r['date']
- r['displayed_name'] = '-'.join(
- r[field_name] for field_name in ('move_name', 'ref', 'name')
- if r[field_name] not in (None, '', '/')
- )
- sum += r['debit'] - r['credit']
- r['progress'] = sum
- r['currency_id'] = currency.browse(r.get('currency_id'))
- full_account.append(r)
- return full_account
-
- def _sum_partner(self, data, partner, field):
- if field not in ['debit', 'credit', 'debit - credit']:
- return
- result = 0.0
- query_get_data = self.env['account.move.line'].with_context(
- data['form'].get('used_context', {}))._query_get()
- reconcile_clause = "" if data['form'][
- 'reconciled'] else ' AND "account_move_line".full_reconcile_id IS NULL '
-
- params = [partner.id, tuple(data['computed']['move_state']),
- tuple(data['computed']['account_ids'])] + \
- query_get_data[2]
- query = """SELECT sum(""" + field + """)
- FROM """ + query_get_data[0] + """, account_move AS m
- WHERE "account_move_line".partner_id = %s
- AND m.id = "account_move_line".move_id
- AND m.state IN %s
- AND account_id IN %s
- AND """ + query_get_data[1] + reconcile_clause
- self.env.cr.execute(query, tuple(params))
-
- contemp = self.env.cr.fetchone()
- if contemp is not None:
- result = contemp[0] or 0.0
- return result
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form'):
- raise UserError(_("Form content is missing, this report cannot be printed."))
-
- data['computed'] = {}
-
- obj_partner = self.env['res.partner']
- query_get_data = self.env['account.move.line'].with_context(
- data['form'].get('used_context', {}))._query_get()
-
- # move state
- data['computed']['move_state'] = ['draft', 'posted']
- if data['form'].get('target_move', 'all') == 'posted':
- data['computed']['move_state'] = ['posted']
-
- # account types
- result_selection = data['form'].get('result_selection', 'customer')
- if result_selection == 'supplier':
- data['computed']['ACCOUNT_TYPE'] = ['liability_payable']
- elif result_selection == 'customer':
- data['computed']['ACCOUNT_TYPE'] = ['asset_receivable']
- else:
- data['computed']['ACCOUNT_TYPE'] = ['liability_payable', 'asset_receivable']
-
- # fetch account ids
- self.env.cr.execute("""
- SELECT a.id
- FROM account_account a
- WHERE a.account_type IN %s
- AND a.active""", # ✅ changed here
- (tuple(data['computed']['ACCOUNT_TYPE']),)
- )
- data['computed']['account_ids'] = [a for (a,) in self.env.cr.fetchall()]
-
- # prevent empty tuple issue
- account_ids = tuple(data['computed']['account_ids']) or (0,)
- params = [tuple(data['computed']['move_state']), account_ids] + query_get_data[2]
-
- reconcile_clause = "" if data['form']['reconciled'] else \
- ' AND "account_move_line".full_reconcile_id IS NULL '
-
- query = """
- SELECT DISTINCT "account_move_line".partner_id
- FROM """ + query_get_data[0] + """, account_account AS account, account_move AS am
- WHERE "account_move_line".partner_id IS NOT NULL
- AND "account_move_line".account_id = account.id
- AND am.id = "account_move_line".move_id
- AND am.state IN %s
- AND "account_move_line".account_id IN %s
- AND account.active
- AND """ + query_get_data[1] + reconcile_clause # ✅ changed here
-
- self.env.cr.execute(query, tuple(params))
- partner_ids = [res['partner_id'] for res in self.env.cr.dictfetchall()]
-
- partners = obj_partner.browse(partner_ids)
- partners = sorted(partners, key=lambda x: (x.ref or '', x.name or ''))
-
- return {
- 'doc_ids': partner_ids,
- 'doc_model': self.env['res.partner'],
- 'data': data,
- 'docs': partners,
- 'time': time,
- 'lines': self._lines,
- 'sum_partner': self._sum_partner,
- }
diff --git a/addons/base_accounting_kit/report/report_partner_ledger_template.xml b/addons/base_accounting_kit/report/report_partner_ledger_template.xml
deleted file mode 100644
index b5c42d9..0000000
--- a/addons/base_accounting_kit/report/report_partner_ledger_template.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Partner Ledger
-
-
- Company:
-
-
-
-
- Date from :
-
-
-
-
- Date to :
-
-
-
-
- Target Moves:
-
All Entries
-
All Posted Entries
-
-
-
-
-
-
-
Date
-
JRNL
-
Ref
-
Debit
-
Credit
-
Balance
-
Currency
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/report_tax.py b/addons/base_accounting_kit/report/report_tax.py
deleted file mode 100644
index dedd72d..0000000
--- a/addons/base_accounting_kit/report/report_tax.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from _datetime import datetime
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportTax(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_tax'
- _description = 'Tax Report'
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
- return {
- 'data': data['form'],
- 'lines': self.get_lines(data.get('form')),
- }
-
- def _sql_from_amls_one(self):
- sql = """SELECT "account_move_line".tax_line_id, COALESCE(SUM("account_move_line".debit-"account_move_line".credit), 0)
- FROM %s
- WHERE %s GROUP BY "account_move_line".tax_line_id"""
- return sql
-
- def _sql_from_amls_two(self):
- sql = """SELECT r.account_tax_id, COALESCE(SUM("account_move_line".debit-"account_move_line".credit), 0)
- FROM %s
- INNER JOIN account_move_line_account_tax_rel r ON ("account_move_line".id = r.account_move_line_id)
- INNER JOIN account_tax t ON (r.account_tax_id = t.id)
- WHERE %s GROUP BY r.account_tax_id"""
- return sql
-
- def _compute_from_amls(self, options, taxes):
- # compute the tax amount
- sql = self._sql_from_amls_one()
- tables, where_clause, where_params = self.env[
- 'account.move.line']._query_get()
-
- query = sql % (tables, where_clause)
- self.env.cr.execute(query, where_params)
- results = self.env.cr.fetchall()
- for result in results:
- if result[0] in taxes:
- taxes[result[0]]['tax'] = abs(result[1])
-
- # compute the net amount
- sql2 = self._sql_from_amls_two()
- query = sql2 % (tables, where_clause)
- self.env.cr.execute(query, where_params)
- results = self.env.cr.fetchall()
- for result in results:
- if result[0] in taxes:
- taxes[result[0]]['net'] = abs(result[1])
-
- @api.model
- def get_lines(self, options):
- taxes = {}
- for tax in self.env['account.tax'].search(
- [('type_tax_use', '!=', 'none')]):
- if tax.children_tax_ids:
- for child in tax.children_tax_ids:
- if child.type_tax_use != 'none':
- continue
- taxes[child.id] = {'tax': 0, 'net': 0, 'name': child.name,
- 'type': tax.type_tax_use}
- else:
- taxes[tax.id] = {'tax': 0, 'net': 0, 'name': tax.name,
- 'type': tax.type_tax_use}
- if options['date_from'] and not options['date_to']:
- self.with_context(date_from=options['date_from'],
- strict_range=True)._compute_from_amls(options,
- taxes)
- elif options['date_to'] and not options['date_from']:
- self.with_context(date_to=options['date_to'],
- strict_range=True)._compute_from_amls(options,
- taxes)
- elif options['date_from'] and options['date_to']:
- self.with_context(date_from=options['date_from'],
- date_to=options['date_to'],
- strict_range=True)._compute_from_amls(options,
- taxes)
- else:
- date_to = str(datetime.today().date())
- self.with_context(date_to=date_to,
- strict_range=True)._compute_from_amls(options,
- taxes)
-
- groups = dict((tp, []) for tp in ['sale', 'purchase'])
- for tax in taxes.values():
- if tax['tax']:
- groups[tax['type']].append(tax)
- return groups
diff --git a/addons/base_accounting_kit/report/report_tax_template.xml b/addons/base_accounting_kit/report/report_tax_template.xml
deleted file mode 100644
index 35699bc..0000000
--- a/addons/base_accounting_kit/report/report_tax_template.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
Tax Report
-
-
- Company:
-
-
-
-
- Date from :
-
-
-
-
- Date to :
-
-
-
-
-
-
-
-
Sale
-
Net
-
Tax
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Purchase
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/report/report_trial_balance.py b/addons/base_accounting_kit/report/report_trial_balance.py
deleted file mode 100644
index 59a2a09..0000000
--- a/addons/base_accounting_kit/report/report_trial_balance.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from odoo import api, models, _
-from odoo.exceptions import UserError
-
-
-class ReportTrialBalance(models.AbstractModel):
- _name = 'report.base_accounting_kit.report_trial_balance'
- _description = 'Trial Balance Report'
-
- def _get_accounts(self, accounts, display_account):
- """ compute the balance, debit and credit for the provided accounts
- :Arguments:
- `accounts`: list of accounts record,
- `display_account`: it's used to display either all accounts or those accounts which balance is > 0
- :Returns a list of dictionary of Accounts with following key and value
- `name`: Account name,
- `code`: Account code,
- `credit`: total amount of credit,
- `debit`: total amount of debit,
- `balance`: total amount of balance,
- """
-
- account_result = {}
- # Prepare sql query base on selected parameters from wizard
- tables, where_clause, where_params = self.env[
- 'account.move.line']._query_get()
- tables = tables.replace('"', '')
- if not tables:
- tables = 'account_move_line'
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- filters = " AND ".join(wheres)
- # compute the balance, debit and credit for the provided accounts
- request = (
- "SELECT account_id AS id, SUM(debit) AS debit, "
- "SUM(credit) AS credit, (SUM(debit) - SUM(credit)) "
- "AS balance" +
- " FROM " + tables + " WHERE account_id IN %s " +
- filters + " GROUP BY account_id")
- params = (tuple(accounts.ids),) + tuple(where_params)
- self.env.cr.execute(request, params)
- for row in self.env.cr.dictfetchall():
- account_result[row.pop('id')] = row
-
- account_res = []
- for account in accounts:
- res = dict((fn, 0.0) for fn in ['credit', 'debit', 'balance'])
- account_company = self.env.company
- currency = (account.currency_id and account.currency_id or
- account_company.currency_id)
- res['code'] = account.code
- res['name'] = account.name
- if account.id in account_result:
- res['debit'] = account_result[account.id].get('debit')
- res['credit'] = account_result[account.id].get('credit')
- res['balance'] = account_result[account.id].get('balance')
- if display_account == 'all':
- account_res.append(res)
- if display_account == 'not_zero' and not currency.is_zero(
- res['balance']):
- account_res.append(res)
- if display_account == 'movement' and (
- not currency.is_zero(res['debit']) or not currency.is_zero(
- res['credit'])):
- account_res.append(res)
- return account_res
-
- @api.model
- def _get_report_values(self, docids, data=None):
- if not data.get('form') or not self.env.context.get('active_model'):
- raise UserError(
- _("Form content is missing, this report cannot be printed."))
-
- model = self.env.context.get('active_model')
- docs = self.env[model].browse(
- self.env.context.get('active_ids', []))
- display_account = data['form'].get('display_account')
- accounts = docs if model == 'account.account' else self.env[
- 'account.account'].search([])
- account_res = self.with_context(
- data['form'].get('used_context'))._get_accounts(accounts,
- display_account)
- return {
- 'doc_ids': self.ids,
- 'doc_model': model,
- 'data': data['form'],
- 'docs': docs,
- 'time': time,
- 'Accounts': account_res,
- }
diff --git a/addons/base_accounting_kit/report/report_trial_balance_template.xml b/addons/base_accounting_kit/report/report_trial_balance_template.xml
deleted file mode 100644
index e9a58f1..0000000
--- a/addons/base_accounting_kit/report/report_trial_balance_template.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
: Trial Balance
-
-
-
- Display Account:
-
-
- All accounts
-
-
- With movements
-
-
- With balance not equal to zero
-
-
- This module uses some external python dependencies :
- openpyxl, ofxparse and qifparse. Before
- installing the module install the python
- package
- first. The required python packages can be installed using the
- following commands.
-
-
- pip
- install openpyxl
- pip
- install ofxparse
- pip
- install qifparse
-
-
- If you are running Odoo in a Docker environment, you can safely install the qifparse package by
- following the steps below:
-
- 1. Create a custom Dockerfile (e.g. Dockerfile.odoo) with the following content:
- FROM odoo:19.0
-
- USER root
-
- # Install qifparse to a custom directory
- RUN pip3 install --target=/opt/qiflibs qifparse
-
- # Add that directory to PYTHONPATH
- ENV PYTHONPATH="/opt/qiflibs:$PYTHONPATH"
-
- USER odoo
- 2.Update your docker-compose.yml to use this custom Dockerfile for the web service:
- services:
- web:
- build:
- context: .
- dockerfile: Dockerfile.odoo
-
- 3. Rebuild and restart the containers:
- docker-compose build
- docker-compose up -d
-
-
-
-
-
-
-
-
-
-
Key
- Highlights
-
-
-
-
-
-
-
-
-
-
- All Financial Reports
-
Comprehensive
- financial reporting system with real-time data and
- analytics.
Reporting menu will gives the
- all Accounting Reports.
-
-
- Can see menus for getting the Account related Reports. like
- -Profit and Loss, Balance Sheet , Cash Flow, Bank Book, Cash
- Book , Day Book etc
-
-
-
-
-
-
-
Profit and Loss For the
- Accounting Report.
-
-
-
-
-
-
Balance Sheet -For the
- Accounting Report.
-
-
-
-
-
-
Cash Flow -For the Accounting
- Report.
-
-
-
-
-
-
Bank Book -For the Accounting
- Report.
-
-
-
-
-
-
Cash Book -For the Accounting
- Report.
-
-
-
-
-
-
Day Book -For the Accounting
- Report.
-
-
-
-
-
-
Aged Partner Balance- For the
- Accounting Report.
-
-
-
-
-
-
Partner Ledger- For the
- Accounting Report.
-
-
-
-
-
-
Invoice Analysis- For the
- Accounting Report.
-
-
-
-
-
-
General Ledger - For the
- Accounting Report.
-
-
-
-
-
-
Trial Balance - - For the
- Accounting Report.
-
-
-
-
-
-
Tax Report - For the Accounting
- Report.
-
-
-
-
-
-
Journal Audit - For the
- Accounting Report.
-
-
-
-
-
-
A quick option to import bank
- statement.
-
-
-
-
-
-
A wizard that allows user to upload
- file.
-
-
-
-
-
-
After importing the file user can
- view
- the statements that imported
-
-
- After importing the file user can view the statements that imported.
- (The example format for csv, xlsx, ofx and qif are added in screenshots
- folder in the module.).
-
-
-
-
-
-
-
A Quick Option To Access Customer
- Statements In Contacts
-
-
- View and manage all customer statements directly from the contact’s form view.
-
-
-
-
-
-
-
Payment Statement Report
-
-
- Generate, download, and email customer statements as PDF reports with button clicks directly
- from the contact’s form view
-
-
-
-
-
-
-
Payment Statement Report Excel
-
-
- Generate, download, and email customer statements as Excel reports with button clicks
- directly from the contact’s form view
-
Our intelligent follow-up system automates
- customer communications and
- helps maintain
- healthy cash flow through systematic engagement.
-
-
- Follow-up Features:
-
-
Automated reminder schedules
-
Customizable email templates
-
SMS integration capabilities
-
Activity tracking and reporting
-
Escalation workflows
-
-
-
-
The system intelligently prioritizes
- follow-ups based on amount, customer
- history, and
- payment patterns. Explore our latest
- design
- implementations
- for more advanced features.
-
-
-
-
-
-
-
-
-
-
- Latest Releases
-
-
-
-
-
Latest Release 19.0.2.2.0
-
-
Updt
-
-
-
- 9th Feb, 2026
-
-
-
-
-
Fixed the issues in the bank statement import of csv and ofx files.
-
- To remind customers of paying their invoices, you can
- define different actions depending on how severely
- overdue the customer is. These actions are bundled
- into follow-up levels that are triggered when the due
- date of an invoice has passed a certain
- number of days. If there are other overdue invoices for the
- same customer, the actions of the most
- overdue invoice will be executed.
-
- Define follow-up levels and their related actions
-
-
- For each step, specify the actions to be taken and delay in days. It is
- possible to use print and e-mail templates to send specific messages to
- the customer.
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/views/res_partner_views.xml b/addons/base_accounting_kit/views/res_partner_views.xml
deleted file mode 100644
index 4252329..0000000
--- a/addons/base_accounting_kit/views/res_partner_views.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
- res.partner.view.form.inherit.base.account.report
-
- res.partner
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/base_accounting_kit/wizard/__init__.py b/addons/base_accounting_kit/wizard/__init__.py
deleted file mode 100644
index d42d3e9..0000000
--- a/addons/base_accounting_kit/wizard/__init__.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from . import account_common_partner_report
-from . import account_aged_trial_balance
-from . import account_balance_report
-from . import account_bank_book_report
-from . import account_cash_book_report
-from . import account_day_book_report
-from . import account_lock_date
-from . import account_print_journal
-from . import account_report_general_ledger
-from . import account_report_partner_ledger
-from . import asset_depreciation_confirmation
-from . import asset_modify
-from . import cash_flow_report
-from . import financial_report
-from . import import_bank_statement
-from . import kit_account_tax_report
diff --git a/addons/base_accounting_kit/wizard/account_aged_trial_balance.py b/addons/base_accounting_kit/wizard/account_aged_trial_balance.py
deleted file mode 100644
index 09073ef..0000000
--- a/addons/base_accounting_kit/wizard/account_aged_trial_balance.py
+++ /dev/null
@@ -1,77 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import time
-from dateutil.relativedelta import relativedelta
-from odoo import fields, models, _
-from odoo.exceptions import UserError
-
-
-class AccountAgedTrialBalance(models.TransientModel):
- _name = 'account.aged.trial.balance'
- _inherit = 'account.common.partner.report'
- _description = 'Account Aged Trial balance Report'
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_aged_trail_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_aged_trail_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- name = fields.Char(string="Account Aged Trial balance Report", default="Account Aged Trial balance Report", required=True, translate=True)
-
- journal_ids = fields.Many2many('account.journal', string='Journals',
- required=True)
- period_length = fields.Integer(string='Period Length (days)',
- required=True, default=30)
- date_from = fields.Date(default=lambda *a: time.strftime('%Y-%m-%d'))
-
- def _print_report(self, data):
- res = {}
- data = self.pre_print_report(data)
- data['form'].update(self.read(['period_length'])[0])
- period_length = data['form']['period_length']
- if period_length <= 0:
- raise UserError(_('You must set a period length greater than 0.'))
- if not data['form']['date_from']:
- raise UserError(_('You must set a start date.'))
-
- start = data['form']['date_from']
-
- for i in range(5)[::-1]:
- stop = start - relativedelta(days=period_length - 1)
- res[str(i)] = {
- 'name': (i != 0 and (
- str((5 - (i + 1)) * period_length) + '-' + str(
- (5 - i) * period_length)) or (
- '+' + str(4 * period_length))),
- 'stop': start.strftime('%Y-%m-%d'),
- 'start': (i != 0 and stop.strftime('%Y-%m-%d') or False),
- }
- start = stop - relativedelta(days=1)
- data['form'].update(res)
- return self.env.ref(
- 'base_accounting_kit.action_report_aged_partner_balance').with_context(
- landscape=True).report_action(self, data=data)
diff --git a/addons/base_accounting_kit/wizard/account_aged_trial_balance_views.xml b/addons/base_accounting_kit/wizard/account_aged_trial_balance_views.xml
deleted file mode 100644
index 5c776ab..0000000
--- a/addons/base_accounting_kit/wizard/account_aged_trial_balance_views.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- account.aged.trial.balance.view.form
- account.aged.trial.balance
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Aged Partner Balance
- account.aged.trial.balance
- ir.actions.act_window
- list,form
-
- {}
- new
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_balance_report.py b/addons/base_accounting_kit/wizard/account_balance_report.py
deleted file mode 100644
index 7aea7a7..0000000
--- a/addons/base_accounting_kit/wizard/account_balance_report.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models, _
-
-
-class AccountBalanceReport(models.TransientModel):
- _name = 'account.balance.report'
- _inherit = "account.common.account.report"
- _description = 'Trial Balance Report'
-
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_balance_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_balance_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- name = fields.Char(string="Trial Balance", default="Trial Balance", required=True, translate=True)
- journal_ids = fields.Many2many('account.journal',
- 'account_balance_report_journal_rel',
- 'account_id', 'journal_id',
- string='Journals', required=True,
- default=[])
-
- @api.model
- def _get_report_name(self):
- period_id = self._get_selected_period_id()
- return self.env['consolidation.period'].browse(period_id)['display_name'] or _("Trial Balance")
-
- def _print_report(self, data):
- data = self.pre_print_report(data)
- records = self.env[data['model']].browse(data.get('ids', []))
- return self.env.ref(
- 'base_accounting_kit.action_report_trial_balance').report_action(
- records, data=data)
diff --git a/addons/base_accounting_kit/wizard/account_balance_report_views.xml b/addons/base_accounting_kit/wizard/account_balance_report_views.xml
deleted file mode 100644
index 8c36e07..0000000
--- a/addons/base_accounting_kit/wizard/account_balance_report_views.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
- account.balance.report.view.form.inherit.base.accounting.kit
- account.balance.report
-
-
-
-
-
-
-
-
-
-
-
- Trial Balance
- account.balance.report
- ir.actions.act_window
- form
-
- new
-
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_bank_book_report.py b/addons/base_accounting_kit/wizard/account_bank_book_report.py
deleted file mode 100644
index 7ca0a03..0000000
--- a/addons/base_accounting_kit/wizard/account_bank_book_report.py
+++ /dev/null
@@ -1,112 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import date
-from odoo import api, fields, models, _
-from odoo.exceptions import UserError
-
-
-class BankBookWizard(models.TransientModel):
- _name = 'account.bank.book.report'
- _description = 'Account Bank Book Report'
-
- company_id = fields.Many2one('res.company', string='Company',
- readonly=True,
- default=lambda self: self.env.company)
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries')],
- string='Target Moves', required=True,
- default='posted')
- date_from = fields.Date(string='Start Date', default=date.today(),
- required=True)
- date_to = fields.Date(string='End Date', default=date.today(),
- required=True)
- display_account = fields.Selection(
- [('all', 'All'), ('movement', 'With movements'),
- ('not_zero', 'With balance is not equal to 0')],
- string='Display Accounts', required=True, default='movement')
- sortby = fields.Selection(
- [('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')],
- string='Sort by', required=True, default='sort_date')
- initial_balance = fields.Boolean(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):
- journals = self.env['account.journal'].search([('type', '=', 'bank')])
- accounts = []
- for journal in journals:
- accounts.append(journal.default_account_id.id)
- return accounts
-
- account_ids = fields.Many2many('account.account',
- 'account_report_bankbook_account_rel',
- 'report_id', 'account_id',
- 'Accounts',
- default=_get_default_account_ids)
- journal_ids = fields.Many2many('account.journal',
- 'account_report_bankbook_journal_rel',
- 'account_id', 'journal_id',
- string='Journals', required=True,
- default=lambda self: self.env[
- 'account.journal'].search([]))
-
- @api.onchange('account_ids')
- def onchange_account_ids(self):
- if self.account_ids:
- journals = self.env['account.journal'].search(
- [('type', '=', 'bank')])
- accounts = []
- for journal in journals:
- accounts.append(journal.default_account_id.id)
- domain = {'account_ids': [('id', 'in', accounts)]}
- return {'domain': domain}
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][
- 'journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form'][
- 'target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- return result
-
- def check_report(self):
- self.ensure_one()
- if self.initial_balance and not self.date_from:
- raise UserError(_("You must choose a Start Date"))
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(
- ['date_from', 'date_to', 'journal_ids', 'target_move',
- 'display_account',
- 'account_ids', 'sortby', 'initial_balance'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context,
- lang=self.env.context.get(
- 'lang') or 'en_US')
- return self.env.ref(
- 'base_accounting_kit.action_report_bank_book').report_action(self,
- data=data)
diff --git a/addons/base_accounting_kit/wizard/account_bank_book_report_views.xml b/addons/base_accounting_kit/wizard/account_bank_book_report_views.xml
deleted file mode 100644
index 876c5ee..0000000
--- a/addons/base_accounting_kit/wizard/account_bank_book_report_views.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
- account.bank.book.report.view.form
- account.bank.book.report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Bank Book Report
- ir.actions.act_window
- account.bank.book.report
-
- form
- new
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_cash_book_report.py b/addons/base_accounting_kit/wizard/account_cash_book_report.py
deleted file mode 100644
index efe78e3..0000000
--- a/addons/base_accounting_kit/wizard/account_cash_book_report.py
+++ /dev/null
@@ -1,110 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import date
-from odoo import api, fields, models, _
-from odoo.exceptions import UserError
-
-
-class CashBookWizard(models.TransientModel):
- _name = 'account.cash.book.report'
- _description = 'Account Cash Book Report'
-
- company_id = fields.Many2one('res.company', string='Company',
- readonly=True,
- default=lambda self: self.env.company)
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries')], string='Target Moves', required=True,
- default='posted')
- date_from = fields.Date(string='Start Date', default=date.today(),
- required=True)
- date_to = fields.Date(string='End Date', default=date.today(),
- required=True)
- display_account = fields.Selection(
- [('all', 'All'), ('movement', 'With movements'),
- ('not_zero', 'With balance is not equal to 0')],
- string='Display Accounts', required=True, default='movement')
- sortby = fields.Selection(
- [('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')],
- string='Sort by',
- required=True, default='sort_date')
- initial_balance = fields.Boolean(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):
- journals = self.env['account.journal'].search([('type', '=', 'cash')])
- accounts = []
- for journal in journals:
- accounts.append(journal.default_account_id.id)
- return accounts
-
- account_ids = fields.Many2many('account.account',
- 'account_report_cashbook_account_rel',
- 'report_id', 'account_id',
- 'Accounts',
- default=_get_default_account_ids)
- journal_ids = fields.Many2many('account.journal',
- 'account_report_cashbook_journal_rel',
- 'account_id', 'journal_id',
- string='Journals', required=True,
- default=lambda self: self.env[
- 'account.journal'].search([]))
-
- @api.onchange('account_ids')
- def onchange_account_ids(self):
- if self.account_ids:
- journals = self.env['account.journal'].search(
- [('type', '=', 'cash')])
- accounts = []
- for journal in journals:
- accounts.append(journal.default_account_id.id)
- domain = {'account_ids': [('id', 'in', accounts)]}
- return {'domain': domain}
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][
- 'journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form'][
- 'target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- return result
-
- def check_report(self):
- self.ensure_one()
- if self.initial_balance and not self.date_from:
- raise UserError(_("You must choose a Start Date"))
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(
- ['date_from', 'date_to', 'journal_ids', 'target_move',
- 'display_account',
- 'account_ids', 'sortby', 'initial_balance'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context,
- lang=self.env.context.get(
- 'lang') or 'en_US')
- return self.env.ref(
- 'base_accounting_kit.action_report_cash_book').report_action(self,
- data=data)
diff --git a/addons/base_accounting_kit/wizard/account_cash_book_report_views.xml b/addons/base_accounting_kit/wizard/account_cash_book_report_views.xml
deleted file mode 100644
index 0f1b481..0000000
--- a/addons/base_accounting_kit/wizard/account_cash_book_report_views.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
- account.cash.book.report.view.form
- account.cash.book.report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cash Book Report
- ir.actions.act_window
- account.cash.book.report
-
- form
- new
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_common_partner_report.py b/addons/base_accounting_kit/wizard/account_common_partner_report.py
deleted file mode 100644
index c3b96d3..0000000
--- a/addons/base_accounting_kit/wizard/account_common_partner_report.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-from odoo.tools.misc import get_lang
-
-
-class AccountingCommonPartnerReport(models.TransientModel):
- _name = 'account.common.partner.report'
- _inherit = "account.report"
- _description = 'Account Common Partner Report'
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_common_parnter_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_common_parnter_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True,
- default=lambda self: self.env.company)
- journal_ids = fields.Many2many(
- comodel_name='account.journal',
- string='Journals',
- required=True,
- default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]),
- domain="[('company_id', '=', company_id)]",
- )
- date_from = fields.Date(string='Start Date')
- date_to = fields.Date(string='End Date')
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], string='Target Moves', required=True, default='posted')
-
- result_selection = fields.Selection([('customer', 'Receivable Accounts'),
- ('supplier', 'Payable Accounts'),
- ('customer_supplier',
- 'Receivable and Payable Accounts')
- ], string="Partner's", required=True,
- default='customer')
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][
- 'journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form'][
- 'target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- return result
-
- def check_report(self):
- self.ensure_one()
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code)
- return self.with_context(discard_logo_check=True)._print_report(data)
-
- def _print_report(self, data):
- data['form'].update(self.read(
- ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp',
- 'account_report_id', 'enable_filter', 'label_filter',
- 'target_move'])[0])
- return self.env.ref(
- 'base_accounting_kit.action_report_cash_flow').report_action(self,
- data=data,
- config=False)
-
- def pre_print_report(self, data):
- data['form'].update(self.read(['result_selection'])[0])
- return data
diff --git a/addons/base_accounting_kit/wizard/account_day_book_report.py b/addons/base_accounting_kit/wizard/account_day_book_report.py
deleted file mode 100644
index 38c18aa..0000000
--- a/addons/base_accounting_kit/wizard/account_day_book_report.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from datetime import date
-from odoo import fields, models
-
-
-class DayBookWizard(models.TransientModel):
- _name = 'account.day.book.report'
- _description = 'Account Day Book Report'
-
- company_id = fields.Many2one('res.company', string='Company',
- readonly=True,
- default=lambda self: self.env.company)
- journal_ids = fields.Many2many('account.journal', string='Journals',
- required=True,
- default=lambda self: self.env[
- 'account.journal'].search([]))
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries')], string='Target Moves', required=True,
- default='posted')
-
- account_ids = fields.Many2many('account.account',
- 'account_report_daybook_account_rel',
- 'report_id', 'account_id',
- 'Accounts')
-
- date_from = fields.Date(string='Start Date', default=date.today(),
- required=True)
- date_to = fields.Date(string='End Date', default=date.today(),
- required=True)
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][
- 'journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form'][
- 'target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- return result
-
- def check_report(self):
- self.ensure_one()
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = \
- self.read(['date_from', 'date_to', 'journal_ids', 'target_move',
- 'account_ids'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context,
- lang=self.env.context.get(
- 'lang') or 'en_US')
- return self.env.ref(
- 'base_accounting_kit.day_book_pdf_report').report_action(self,
- data=data)
diff --git a/addons/base_accounting_kit/wizard/account_day_book_report_views.xml b/addons/base_accounting_kit/wizard/account_day_book_report_views.xml
deleted file mode 100644
index a4ff10b..0000000
--- a/addons/base_accounting_kit/wizard/account_day_book_report_views.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- account.day.book.report.view.form
- account.day.book.report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Day Book Report
- ir.actions.act_window
- account.day.book.report
-
- form
- new
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_lock_date.py b/addons/base_accounting_kit/wizard/account_lock_date.py
deleted file mode 100644
index 8ed2783..0000000
--- a/addons/base_accounting_kit/wizard/account_lock_date.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models, SUPERUSER_ID, _
-from odoo.exceptions import UserError
-
-
-class AccountUpdateLockDate(models.TransientModel):
- _name = 'account.lock.date'
- _description = 'Lock date for accounting'
-
- company_id = fields.Many2one(comodel_name='res.company', string="Company",
- required=True)
- sale_lock_date = fields.Date(string="Sales Lock Date", help='Prevents creating and modifying invoices up to the date.')
- purchase_lock_date = fields.Date(string="Purchase Lock date", help='Prevents creating and modifying bills up to the date.')
- hard_lock_date = fields.Date(string="Lock Everyone",
- 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
- def default_get(self, field_list):
- res = super(AccountUpdateLockDate, self).default_get(field_list)
- company = self.env.company
- res.update({
- 'company_id': company.id,
- 'sale_lock_date': company.sale_lock_date,
- 'purchase_lock_date': company.purchase_lock_date,
- 'hard_lock_date': company.hard_lock_date,
- })
- return res
-
- def _check_execute_allowed(self):
- self.ensure_one()
- has_adviser_group = self.env.user.has_group(
- 'account.group_account_manager')
- if not (has_adviser_group or self.env.uid == SUPERUSER_ID):
- raise UserError(_("You are not allowed to execute this action."))
-
- def execute(self):
- self.ensure_one()
- self._check_execute_allowed()
- self.company_id.sudo().write({
- 'sale_lock_date': self.sale_lock_date,
- 'purchase_lock_date': self.purchase_lock_date,
- 'hard_lock_date': self.hard_lock_date,
- })
diff --git a/addons/base_accounting_kit/wizard/account_lock_date_views.xml b/addons/base_accounting_kit/wizard/account_lock_date_views.xml
deleted file mode 100644
index 6c85c8e..0000000
--- a/addons/base_accounting_kit/wizard/account_lock_date_views.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
- account.lock.date.view.form
- account.lock.date
-
-
-
-
-
-
- to lock invoices
-
-
-
- to lock bills
-
-
-
-
-
-
-
-
-
- Lock your Fiscal Period
- account.lock.date
- form
- new
-
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_print_journal.py b/addons/base_accounting_kit/wizard/account_print_journal.py
deleted file mode 100644
index 09aae9e..0000000
--- a/addons/base_accounting_kit/wizard/account_print_journal.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class AccountPrintJournal(models.TransientModel):
- _name = "account.print.journal"
- _inherit = "account.common.journal.report"
- _description = "Account Print Journal"
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_common_print_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_common_print_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- name = fields.Char(string="Journal Audit", default="Journal Audit", required=True, translate=True)
- sort_selection = fields.Selection(
- [('date', 'Date'), ('move_name', 'Journal Entry Number')],
- 'Entries Sorted by', required=True, default='move_name')
- journal_ids = fields.Many2many('account.journal', string='Journals',
- required=True,
- default=lambda self: self.env[
- 'account.journal'].search(
- [('type', 'in', ['sale', 'purchase'])]))
-
- def _print_report(self, data):
- data = self.pre_print_report(data)
- data['form'].update({'sort_selection': self.sort_selection})
- return self.env.ref(
- 'base_accounting_kit.action_report_journal').with_context(
- landscape=True).report_action(self, data=data)
diff --git a/addons/base_accounting_kit/wizard/account_print_journal_views.xml b/addons/base_accounting_kit/wizard/account_print_journal_views.xml
deleted file mode 100644
index c88fe6e..0000000
--- a/addons/base_accounting_kit/wizard/account_print_journal_views.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
- account.print.journal.view.form.inherit.base.accounting.kit
- account.print.journal
-
-
-
-
-
-
-
-
-
-
-
- Journals Audit
- ir.actions.act_window
- account.print.journal
- form
-
- new
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_report_general_ledger.py b/addons/base_accounting_kit/wizard/account_report_general_ledger.py
deleted file mode 100644
index b0cc579..0000000
--- a/addons/base_accounting_kit/wizard/account_report_general_ledger.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models, _
-from odoo.exceptions import UserError
-
-
-class AccountReportGeneralLedger(models.TransientModel):
- _name = "account.report.general.ledger"
- _inherit = "account.common.account.report"
- _description = "General Ledger Report"
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_report_general_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_report_general_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- name = fields.Char(string="General Ledger", default="General Ledger", required=True, translate=True)
- initial_balance = fields.Boolean(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.')
- sortby = fields.Selection(
- [('sort_date', 'Date'), ('sort_journal_partner', 'Journal & Partner')],
- string='Sort by', required=True, default='sort_date')
- journal_ids = fields.Many2many('account.journal',
- 'account_report_general_ledger_journal_rel',
- 'account_id', 'journal_id',
- string='Journals', required=True)
-
- def _print_report(self, data):
- data = self.pre_print_report(data)
- data['form'].update(self.read(['initial_balance', 'sortby'])[0])
- if data['form'].get('initial_balance') and not data['form'].get(
- 'date_from'):
- raise UserError(_("You must define a Start Date"))
- records = self.env[data['model']].browse(data.get('ids', []))
- return self.env.ref(
- 'base_accounting_kit.action_report_general_ledger').with_context(
- landscape=True).report_action(records, data=data)
diff --git a/addons/base_accounting_kit/wizard/account_report_general_ledger_views.xml b/addons/base_accounting_kit/wizard/account_report_general_ledger_views.xml
deleted file mode 100644
index 7645704..0000000
--- a/addons/base_accounting_kit/wizard/account_report_general_ledger_views.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- account.report.general.ledger.view.form.inherit.base.accounting.kit
- account.report.general.ledger
-
-
-
-
-
-
-
-
-
-
-
-
- General Ledger
- ir.actions.act_window
- account.report.general.ledger
- form
-
- new
-
- report
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/account_report_partner_ledger.py b/addons/base_accounting_kit/wizard/account_report_partner_ledger.py
deleted file mode 100644
index 9dc8611..0000000
--- a/addons/base_accounting_kit/wizard/account_report_partner_ledger.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-
-
-class AccountPartnerLedger(models.TransientModel):
- _name = "account.report.partner.ledger"
- _inherit = "account.common.partner.report"
- _description = "Account Partner Ledger"
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_report_partner_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_report_partner_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- name = fields.Char(string="Partner Ledger Report", default="Partner Ledger Report", required=True, translate=True)
- amount_currency = fields.Boolean("With Currency",
- help="It adds the currency column on report if the "
- "currency differs from the company currency.")
- reconciled = fields.Boolean('Reconciled Entries')
-
- def _print_report(self, data):
- data = self.pre_print_report(data)
- data['form'].update({'reconciled': self.reconciled,
- 'amount_currency': self.amount_currency})
- return self.env.ref(
- 'base_accounting_kit.action_report_partnerledger').report_action(
- self, data=data)
diff --git a/addons/base_accounting_kit/wizard/account_report_partner_ledger_views.xml b/addons/base_accounting_kit/wizard/account_report_partner_ledger_views.xml
deleted file mode 100644
index 42a8ca5..0000000
--- a/addons/base_accounting_kit/wizard/account_report_partner_ledger_views.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
- account.report.partner.ledger.view.form.inherit.base.accounting.kit
- account.report.partner.ledger
-
-
-
-
-
-
-
-
-
-
-
-
-
- Partner Ledger
- account.report.partner.ledger
- ir.actions.act_window
- form
-
- new
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/asset_depreciation_confirmation.py b/addons/base_accounting_kit/wizard/asset_depreciation_confirmation.py
deleted file mode 100644
index 3d876e9..0000000
--- a/addons/base_accounting_kit/wizard/asset_depreciation_confirmation.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models, _
-
-
-class AssetDepreciationConfirmationWizard(models.TransientModel):
- _name = "asset.depreciation.confirmation"
- _description = "Asset Depreciation Confirmation"
-
- 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)
-
- def asset_compute(self):
- self.ensure_one()
- context = self._context
- created_move_ids = self.env['account.asset.asset'].sudo().compute_generated_entries(self.date, asset_type=context.get('asset_type'))
- moves = self.env['account.move'].browse(created_move_ids)
- auto_post_draft_moves = moves.filtered(lambda move: move.state == 'draft' and move.auto_post)
- auto_post_draft_moves.write({'auto_post': 'at_date'})
- return {
- 'name': _('Created Asset Moves') if context.get('asset_type') == 'purchase' else _('Created Revenue Moves'),
- 'view_mode': 'list,form',
- 'res_model': 'account.move',
- 'view_id': False,
- 'domain': "[('id','in',[" + ','.join(str(id) for id in created_move_ids) + "])]",
- 'type': 'ir.actions.act_window',
- }
-
-
diff --git a/addons/base_accounting_kit/wizard/asset_depreciation_confirmation_views.xml b/addons/base_accounting_kit/wizard/asset_depreciation_confirmation_views.xml
deleted file mode 100644
index 0f2bda4..0000000
--- a/addons/base_accounting_kit/wizard/asset_depreciation_confirmation_views.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- asset.depreciation.confirmation.view.form
- asset.depreciation.confirmation
-
-
-
-
- This wizard will post installment/depreciation lines for the selected month.
- This will generate journal entries for all related installment lines on this period of asset/revenue recognition as well.
-
-
-
-
-
-
-
-
-
-
-
- Post Depreciation Lines
- asset.depreciation.confirmation
- list,form
-
- new
- {'asset_type': 'purchase'}
-
-
diff --git a/addons/base_accounting_kit/wizard/asset_modify.py b/addons/base_accounting_kit/wizard/asset_modify.py
deleted file mode 100644
index 81255ac..0000000
--- a/addons/base_accounting_kit/wizard/asset_modify.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from lxml import etree
-from odoo import api, fields, models, _
-
-
-class AssetModify(models.TransientModel):
- _name = 'asset.modify'
- _description = 'Modify Asset'
-
- name = fields.Text(string='Reason', required=True)
- method_number = fields.Integer(string='Number of Depreciations', required=True)
- method_period = fields.Integer(string='Period Length')
- method_end = fields.Date(string='Ending date')
- asset_method_time = fields.Char(compute='_get_asset_method_time',
- string='Asset Method Time', readonly=True)
-
- def _get_asset_method_time(self):
- if 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
-
- @api.model
- 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)
- asset_id = self.env.context.get('active_id')
- active_model = self.env.context.get('active_model')
- if active_model == 'account.asset.asset' and asset_id:
- asset = self.env['account.asset.asset'].browse(asset_id)
- doc = etree.XML(result['arch'])
- if asset.method_time == 'number' and doc.xpath("//field[@name='method_end']"):
- node = doc.xpath("//field[@name='method_end']")[0]
- node.set('invisible', '1')
- # setup_modifiers(node, result['fields']['method_end'])
- elif asset.method_time == 'end' and doc.xpath("//field[@name='method_number']"):
- node = doc.xpath("//field[@name='method_number']")[0]
- node.set('invisible', '1')
- # setup_modifiers(node, result['fields']['method_number'])
- result['arch'] = etree.tostring(doc, encoding='unicode')
- return result
-
- @api.model
- def default_get(self, fields):
- res = super(AssetModify, self).default_get(fields)
- asset_id = self.env.context.get('active_id')
- asset = self.env['account.asset.asset'].browse(asset_id)
- if 'name' in fields:
- res.update({'name': asset.name})
- if 'method_number' in fields and asset.method_time == 'number':
- res.update({'method_number': asset.method_number})
- if 'method_period' in fields:
- res.update({'method_period': asset.method_period})
- if 'method_end' in fields and asset.method_time == 'end':
- res.update({'method_end': asset.method_end})
- if 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
- return res
-
- def modify(self):
- """ Modifies the duration of asset for calculating depreciation
- and maintains the history of old values, in the chatter.
- """
- asset_id = self.env.context.get('active_id', False)
- asset = self.env['account.asset.asset'].browse(asset_id)
- old_values = {
- 'method_number': asset.method_number,
- 'method_period': asset.method_period,
- 'method_end': asset.method_end,
- }
- asset_vals = {
- 'method_number': self.method_number,
- 'method_period': self.method_period,
- 'method_end': self.method_end,
- }
- asset.write(asset_vals)
- asset.compute_depreciation_board()
- tracked_fields = self.env['account.asset.asset'].fields_get(['method_number', 'method_period', 'method_end'])
- changes, tracking_value_ids = asset._mail_track(tracked_fields, old_values)
- if changes:
- asset.message_post(subject=_('Depreciation board modified'), body=self.name, tracking_value_ids=tracking_value_ids)
- return {'type': 'ir.actions.act_window_close'}
diff --git a/addons/base_accounting_kit/wizard/asset_modify_views.xml b/addons/base_accounting_kit/wizard/asset_modify_views.xml
deleted file mode 100644
index 250c21f..0000000
--- a/addons/base_accounting_kit/wizard/asset_modify_views.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- asset.modify.view.form
- asset.modify
-
-
-
-
-
-
-
-
-
-
-
-
- months
-
-
-
-
-
-
-
-
-
- Modify Asset
- asset.modify
- ir.actions.act_window
- list,form
-
- new
-
-
diff --git a/addons/base_accounting_kit/wizard/cash_flow_report.py b/addons/base_accounting_kit/wizard/cash_flow_report.py
deleted file mode 100644
index 763ddaf..0000000
--- a/addons/base_accounting_kit/wizard/cash_flow_report.py
+++ /dev/null
@@ -1,128 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import api, fields, models
-
-
-class AccountingReport(models.TransientModel):
- _name = "cash.flow.report"
- _inherit = "account.report"
- _description = "Cash Flow Report"
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_cash_flow_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_cash_flow_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- name = fields.Char(string="Cash Flow Report", default="Cash Flow Report", required=True, translate=True)
- date_from = fields.Date(string='Start Date')
- date_to = fields.Date(string='End Date')
- company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, default=lambda self: self.env.company)
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], string='Target Moves', required=True, default='posted')
- journal_ids = fields.Many2many(
- comodel_name='account.journal',
- string='Journals',
- required=True,
- default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]),
- domain="[('company_id', '=', company_id)]",
- )
-
- @api.model
- def _get_account_report(self):
- reports = []
- if self._context.get('active_id'):
- menu = self.env['ir.ui.menu'].browse(
- self._context.get('active_id')).name
- reports = self.env['account.financial.report'].search(
- [('name', 'ilike', menu)])
- return reports and reports[0] or False
-
- enable_filter = fields.Boolean(string='Enable Comparison')
- account_report_id = fields.Many2one('account.financial.report',
- string='Account Reports',
- required=True,
- default=_get_account_report)
- label_filter = fields.Char(string='Column Label',
- help="This label will be displayed on report to show the balance"
- " computed for the given comparison filter.")
- filter_cmp = fields.Selection(
- [('filter_no', 'No Filters'), ('filter_date', 'Date')],
- string='Filter by', required=True, default='filter_no')
- date_from_cmp = fields.Date(string='Date Start')
- date_to_cmp = fields.Date(string='Date End')
- debit_credit = fields.Boolean(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):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][
- 'journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form'][
- 'target_move'] or ''
- if data['form']['filter_cmp'] == 'filter_date':
- result['date_from'] = data['form']['date_from_cmp']
- result['date_to'] = data['form']['date_to_cmp']
- result['strict_range'] = True
- return result
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- result['company_id'] = data['form']['company_id'][0] or False
- return result
-
- # @api.multi
- def check_report(self):
- res = super(AccountingReport, self).check_report()
- data = {}
- data['form'] = self.read(
- ['account_report_id', 'date_from_cmp', 'date_to_cmp',
- 'journal_ids', 'filter_cmp', 'target_move'])[0]
- for field in ['account_report_id']:
- if isinstance(data['form'][field], tuple):
- data['form'][field] = data['form'][field][0]
- comparison_context = self._build_comparison_context(data)
- res['data']['form']['comparison_context'] = comparison_context
- return res
-
- def _print_report(self, data):
- raise NotImplementedError()
-
- def _print_report(self, data):
- data['form'].update(self.read(
- ['date_from_cmp', 'debit_credit', 'date_to_cmp', 'filter_cmp',
- 'account_report_id', 'enable_filter', 'label_filter',
- 'target_move'])[0])
- return self.env.ref(
- 'base_accounting_kit.action_report_cash_flow').report_action(self,
- data=data,
- config=False)
diff --git a/addons/base_accounting_kit/wizard/cash_flow_report_views.xml b/addons/base_accounting_kit/wizard/cash_flow_report_views.xml
deleted file mode 100644
index 671cbd5..0000000
--- a/addons/base_accounting_kit/wizard/cash_flow_report_views.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
- cash.flow.report.view.form.inherit.base.accounting.kit
- cash.flow.report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cash Flow Statement
- cash.flow.report
- ir.actions.act_window
- form
-
- new
-
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/financial_report.py b/addons/base_accounting_kit/wizard/financial_report.py
deleted file mode 100644
index ef1f465..0000000
--- a/addons/base_accounting_kit/wizard/financial_report.py
+++ /dev/null
@@ -1,438 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-import re
-from odoo import api, models, fields
-
-
-class FinancialReport(models.TransientModel):
- _name = "financial.report"
- _inherit = "account.report"
- _description = "Financial Reports"
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_financial_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_financial_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- name = fields.Char(string="Financial Report", default="Financial Report", required=True, translate=True)
-
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], string='Target Moves', required=True, default='posted')
-
- view_format = fields.Selection([
- ('vertical', 'Vertical'),
- ('horizontal', 'Horizontal')],
- default='vertical',
- string="Format")
-
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form'][
- 'journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form'][
- 'target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- return result
-
- @api.model
- def _get_account_report(self):
- reports = []
- if self._context.get('active_id'):
- menu = self.env['ir.ui.menu'].browse(
- self._context.get('active_id')).name
- reports = self.env['account.financial.report'].search([
- ('name', 'ilike', menu)])
- return reports and reports[0] or False
-
- enable_filter = fields.Boolean(
- string='Enable Comparison',
- default=False)
- account_report_id = fields.Many2one(
- 'account.financial.report',
- string='Account Reports',
- required=True)
-
- date_from = fields.Date(string='Start Date')
- date_to = fields.Date(string='End Date')
- debit_credit = fields.Boolean(
- string='Display Debit/Credit Columns',
- default=True,
- 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.")
- company_id = fields.Many2one(
- 'res.company',
- string='Company',
- index=True,
- default=lambda self: self.env.company.id)
-
- def view_report_pdf(self):
- """This function will be executed when we click the view button
- from the wizard. Based on the values provided in the wizard, this
- function will print pdf report"""
- self.ensure_one()
- data = dict()
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(
- ['date_from', 'enable_filter', 'debit_credit', 'date_to',
- 'account_report_id', 'target_move', 'view_format',
- 'company_id'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(
- used_context,
- lang=self.env.context.get('lang') or 'en_US')
-
- report_lines = self.get_account_lines(data['form'])
- # find the journal items of these accounts
- journal_items = self.find_journal_items(report_lines, data['form'])
-
- def set_report_level(rec):
- """This function is used to set the level of each item.
- This level will be used to set the alignment in the dynamic reports."""
- level = 1
- if not rec['parent']:
- return level
- else:
- for line in report_lines:
- key = 'a_id' if line['type'] == 'account' else 'id'
- if line[key] == rec['parent']:
- return level + set_report_level(line)
-
- # finding the root
- for item in report_lines:
- item['balance'] = round(item['balance'], 2)
- if not item['parent']:
- item['level'] = 1
- parent = item
- report_name = item['name']
- id = item['id']
- report_id = item['r_id']
- else:
- item['level'] = set_report_level(item)
- currency = self._get_currency()
- data['currency'] = currency
- data['journal_items'] = journal_items
- data['report_lines'] = report_lines
- # checking view type
- return self.env.ref(
- 'base_accounting_kit.financial_report_pdf').report_action(self,
- data)
-
- def _compute_account_balance(self, accounts):
- """ compute the balance, debit
- and credit for the provided accounts
- """
- mapping = {
- 'balance':
- "COALESCE(SUM(debit),0) - COALESCE(SUM(credit), 0)"
- " as balance",
- 'debit': "COALESCE(SUM(debit), 0) as debit",
- 'credit': "COALESCE(SUM(credit), 0) as credit",
- }
-
- res = {}
- for account in accounts:
- res[account.id] = dict((fn, 0.0)
- for fn in mapping.keys())
- if accounts:
- tables, where_clause, where_params = (
- self.env['account.move.line']._query_get())
- tables = tables.replace(
- '"', '') if tables else "account_move_line"
- wheres = [""]
- if where_clause.strip():
- wheres.append(where_clause.strip())
- filters = " AND ".join(wheres)
- request = ("SELECT account_id as id, " +
- ', '.join(mapping.values()) +
- " FROM " + tables +
- " WHERE account_id IN %s " +
- filters +
- " GROUP BY account_id")
- params = (tuple(accounts._ids),) + tuple(where_params)
- self.env.cr.execute(request, params)
- for row in self.env.cr.dictfetchall():
- res[row['id']] = row
- return res
-
- def _compute_report_balance(self, reports):
- """returns a dictionary with key=the ID of a record and
- value=the credit, debit and balance amount
- computed for this record. If the record is of type :
- 'accounts' : it's the sum of the linked accounts
- 'account_type' : it's the sum of leaf accounts with
- such an account_type
- 'account_report' : it's the amount of the related report
- 'sum' : it's the sum of the children of this record
- (aka a 'view' record)"""
- res = {}
- fields = ['credit', 'debit', 'balance']
- for report in reports:
- if report.id in res:
- continue
- res[report.id] = dict((fn, 0.0) for fn in fields)
- if report.type == 'accounts':
- # it's the sum of the linked accounts
- res[report.id]['account'] = self._compute_account_balance(
- report.account_ids
- )
- for value in \
- res[report.id]['account'].values():
- for field in fields:
- res[report.id][field] += value.get(field)
- elif report.type == 'account_type':
- # it's the sum the leaf accounts
- # with such an account type
- accounts = self.env['account.account'].search([
- ('account_type', '=', report.account_type_ids)
- ])
- if report.name == "Expenses":
- accounts = self.env['account.account'].search([
- ('account_type', 'in', ["expense","expense_depreciation","expense_direct_cost"])
- ])
- if report.name == "Liability":
- accounts = self.env['account.account'].search([
- ('account_type', 'in', ["liability_payable","equity","liability_current","liability_non_current"])
- ])
- if report.name == "Assets":
- accounts = self.env['account.account'].search([
- ('account_type', 'in', ["asset_receivable","asset_cash","asset_current","asset_non_current","asset_prepayments","asset_fixed"])
- ])
-
- res[report.id]['account'] = self._compute_account_balance(
- accounts)
-
- for value in res[report.id]['account'].values():
- for field in fields:
- res[report.id][field] += value.get(field)
- elif report.type == 'account_report' and report.account_report_id:
- # it's the amount of the linked report
- res2 = self._compute_report_balance(report.account_report_id)
- for key, value in res2.items():
- for field in fields:
- res[report.id][field] += value[field]
- elif report.type == 'sum':
- # it's the sum of the children of this account.report
- res2 = self._compute_report_balance(report.children_ids)
- for key, value in res2.items():
- for field in fields:
- res[report.id][field] += value[field]
- return res
-
- def get_account_lines(self, data):
- lines = []
- account_report = self.env['account.financial.report'].search([
- ('id', '=', data['account_report_id'][0])
- ])
- child_reports = account_report._get_children_by_order()
- res = self.with_context(
- data.get('used_context'))._compute_report_balance(child_reports)
- if data['enable_filter']:
- comparison_res = self._compute_report_balance(child_reports)
- for report_id, value in comparison_res.items():
- res[report_id]['comp_bal'] = value['balance']
- report_acc = res[report_id].get('account')
- if report_acc:
- for account_id, val in \
- comparison_res[report_id].get('account').items():
- report_acc[account_id]['comp_bal'] = val['balance']
-
- for report in child_reports:
- r_name = str(report.name)
- r_name = re.sub('[^0-9a-zA-Z]+', '', r_name)
- if report.parent_id:
- p_name = str(report.parent_id.name)
- p_name = re.sub('[^0-9a-zA-Z]+', '', p_name) + str(
- report.parent_id.id)
- else:
- p_name = False
- vals = {
- 'r_id': report.id,
- 'id': r_name + str(report.id),
- 'sequence': report.sequence,
- 'parent': p_name,
- 'name': report.name,
- 'balance': res[report.id]['balance'] * int(report.sign),
- 'type': 'report',
- 'level': bool(
- report.style_overwrite) and report.style_overwrite or
- report.level,
- 'account_type': report.type or False,
- # used to underline the financial report balances
- }
- if data['debit_credit']:
- vals['debit'] = res[report.id]['debit']
- vals['credit'] = res[report.id]['credit']
-
- if data['enable_filter']:
- vals['balance_cmp'] = res[report.id]['comp_bal'] * int(
- report.sign)
-
- lines.append(vals)
- if report.display_detail == 'no_detail':
- # the rest of the loop is
- # used to display the details of the
- # financial report, so it's not needed here.
- continue
-
- if res[report.id].get('account'):
- sub_lines = []
- for account_id, value \
- in res[report.id]['account'].items():
- # if there are accounts to display,
- # we add them to the lines with a level equals
- # to their level in
- # the COA + 1 (to avoid having them with a too low level
- # that would conflicts with the level of data
- # financial reports for Assets, liabilities...)
- flag = False
- account = self.env['account.account'].browse(account_id)
- # new_r_name = str(report.name)
- # new_r_name = new_r_name.replace(" ", "-") + "-"
- vals = {
- 'account': account.id,
- 'a_id': account.code + re.sub('[^0-9a-zA-Z]+', 'acnt',
- account.name) + str(
- account.id),
- 'name': account.code + '-' + account.name,
- 'balance': value['balance'] * int(report.sign) or 0.0,
- 'type': 'account',
- 'parent': r_name + str(report.id),
- 'level': (
- report.display_detail == 'detail_with_hierarchy' and
- 4),
- 'account_type': account.account_type,
- }
- if data['debit_credit']:
- vals['debit'] = value['debit']
- vals['credit'] = value['credit']
- for company in account.company_ids:
- if not company.currency_id.is_zero(
- vals['debit']) or \
- not company.currency_id.is_zero(
- vals['credit']):
- flag = True
- for company in account.company_ids:
- if not company.currency_id.is_zero(
- vals['balance']):
- flag = True
- if data['enable_filter']:
- vals['balance_cmp'] = value['comp_bal'] * int(
- report.sign)
- for company in account.company_ids:
- if not company.currency_id.is_zero(
- vals['balance_cmp']):
- flag = True
- if flag:
- sub_lines.append(vals)
- lines += sorted(sub_lines,
- key=lambda sub_line: sub_line['name'])
- return lines
-
- def find_journal_items(self, report_lines, form):
- cr = self.env.cr
- journal_items = []
- for i in report_lines:
- if i['type'] == 'account':
- account = i['account']
- if form['target_move'] == 'posted':
- search_query = ("select aml.id, am.id as j_id, "
- "aml.account_id, aml.date, aml.name as "
- "label, am.name, (aml.debit-aml.credit) as "
- "balance, aml.debit, aml.credit, "
- "aml.partner_id from "
- "account_move_line aml "
- "join account_move am on (aml.move_id=am.id"
- " and am.state=%s) where aml.account_id=%s")
- vals = [form['target_move']]
- else:
- search_query = ("select aml.id, am.id as j_id, "
- "aml.account_id, aml.date, aml.name as "
- "label, am.name, (aml.debit-aml.credit) as "
- "balance, aml.debit, aml.credit, "
- "aml.partner_id from account_move_line aml"
- " join account_move am on "
- "(aml.move_id=am.id) where "
- "aml.account_id=%s")
- vals = []
- if form['date_from'] and form['date_to']:
- search_query += " and aml.date>=%s and aml.date<=%s"
- vals += [account, form['date_from'], form['date_to']]
- elif form['date_from']:
- search_query += " and aml.date>=%s"
- vals += [account, form['date_from']]
- elif form['date_to']:
- search_query += " and aml.date<=%s"
- vals += [account, form['date_to']]
- else:
- vals += [account]
- cr.execute(search_query, tuple(vals))
- items = cr.dictfetchall()
-
- for j in items:
- temp = j['id']
- j['id'] = re.sub('[^0-9a-zA-Z]+', '', i['name']) + str(
- temp)
- j['p_id'] = str(i['a_id'])
- j['type'] = 'journal_item'
- journal_items.append(j)
- return journal_items
-
- @api.model
- def _get_currency(self):
- journal = self.env['account.journal'].browse(
- self.env.context.get('default_journal_id', False))
- if journal.currency_id:
- return journal.currency_id.id
- return self.env.company.currency_id.symbol
-
-
-class ProfitLossPdf(models.AbstractModel):
- """ Abstract model for generating PDF report value and send to template """
-
- _name = 'report.base_accounting_kit.report_financial'
- _description = 'Financial Report'
-
- @api.model
- def _get_report_values(self, docids, data=None):
- """ Provide report values to template """
- ctx = {
- 'data': data,
- 'journal_items': data['journal_items'],
- 'report_lines': data['report_lines'],
- 'account_report': data['form']['account_report_id'][1],
- 'currency': data['currency'],
- }
- return ctx
diff --git a/addons/base_accounting_kit/wizard/financial_report_views.xml b/addons/base_accounting_kit/wizard/financial_report_views.xml
deleted file mode 100644
index 4c10404..0000000
--- a/addons/base_accounting_kit/wizard/financial_report_views.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
- financial.report.view.form
- financial.report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Profit and Loss
- financial.report
- ir.actions.act_window
- form
-
- new
-
-
-
-
- Balance Sheet
- financial.report
- ir.actions.act_window
- form
-
- new
-
-
-
-
-
-
diff --git a/addons/base_accounting_kit/wizard/import_bank_statement.py b/addons/base_accounting_kit/wizard/import_bank_statement.py
deleted file mode 100644
index 4b22a6c..0000000
--- a/addons/base_accounting_kit/wizard/import_bank_statement.py
+++ /dev/null
@@ -1,446 +0,0 @@
-# -*- coding: utf-8 -*-
-###############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Akhil Ashok (odoo@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 .
-#
-###############################################################################
-import base64
-import codecs
-import csv
-import openpyxl
-import os
-import io
-from datetime import datetime
-from io import BytesIO
-from odoo import fields, models, _
-from odoo.exceptions import ValidationError
-from ofxparse import OfxParser
-from qifparse.parser import QifParser
-
-
-class ImportBankStatement(models.TransientModel):
- """ A class to import files as bank statement """
- _name = "import.bank.statement"
- _description = "Import button"
- _rec_name = "file_name"
-
- attachment = fields.Binary(string="File", required=True,
- help="Choose the file to import")
- file_name = fields.Char(string="File Name", help="Name of the file")
- journal_id = fields.Many2one('account.journal', string="Journal ID",
- help="Journal in which the file importing")
-
- def _parse_date(self, date_str):
- """ Helper to parse date from string """
- if not date_str:
- return fields.Date.today()
-
- if isinstance(date_str, datetime):
- return date_str.date()
-
- # Remove potential quotes and whitespace
- date_str = str(date_str).strip().strip('"').strip("'")
- if not date_str:
- return fields.Date.today()
-
- # Try common formats
- for fmt in ('%Y-%m-%d', '%d/%m/%Y', '%m/%d/%Y', '%d-%m-%Y', '%Y/%m/%d'):
- try:
- return datetime.strptime(date_str, fmt).date()
- except (ValueError, TypeError):
- continue
-
- # Fallback to Odoo fields.Date.from_string
- try:
- res = fields.Date.from_string(date_str)
- if res:
- return res
- except:
- pass
-
- return fields.Date.today()
-
- def _parse_float(self, val):
- """ Helper to parse float from string with currency symbols and commas """
- if not val:
- return 0.0
- if isinstance(val, (int, float)):
- return float(val)
-
- # Remove currency symbols, quotes, commas, spaces
- clean_val = str(val).strip().replace('"', '').replace("'", "").replace(',', '').replace(' ', '')
- for symbol in ('$', '€', '£', '¥', '₹'):
- clean_val = clean_val.replace(symbol, '')
-
- # Handle accounting negative format (100.0) -> -100.0
- if clean_val.startswith('(') and clean_val.endswith(')'):
- clean_val = '-' + clean_val[1:-1]
-
- try:
- return float(clean_val)
- except (ValueError, TypeError):
- return 0.0
-
- def action_statement_import(self):
- """Function to import csv, xlsx, ofx and qif file format"""
- split_tup = os.path.splitext(self.file_name)
- if split_tup[1] == '.csv' or split_tup[1] == '.xlsx' or split_tup[
- 1] == '.ofx' or split_tup[1] == '.qif':
- if split_tup[1] == '.csv':
- try:
- file_data = base64.b64decode(self.attachment)
- file_string = file_data.decode('utf-8-sig')
- f = io.StringIO(file_string)
- reader = csv.DictReader(f)
- fieldnames = reader.fieldnames or []
- header_map = {f.strip().lower(): f for f in fieldnames}
- except Exception as e:
- raise ValidationError(_("Error reading CSV file: %s") % str(e))
-
- statement_id = False
- for row in reader:
- if not any(row.values()):
- continue
-
- def get_field(keys):
- for k in keys:
- if k.lower() in header_map:
- return row.get(header_map[k.lower()])
- return None
-
- # Mappings for common Odoo and generic bank headers
- name = get_field(['name', 'label', 'description', 'reference', 'account', 'line_ids/payment_ref', 'payment_ref'])
- amount = get_field(['amount', 'value', 'price', 'total', 'line_ids/amount'])
- partner_name = get_field(['partner', 'partner_id/name', 'contact', 'payee', 'customer', 'supplier', 'line_ids/partner_id', 'partner_id'])
- date_str = get_field(['date', 'transaction date', 'time', 'line_ids/date'])
- starting_balance = get_field(['starting balance', 'start balance', 'opening balance', 'balance_start'])
- ending_balance = get_field(['ending balance', 'balance', 'real balance', 'end balance', 'balance_end_real'])
-
- values = [v.strip() if v else '' for v in row.values()]
- keys = list(row.keys())
- mapped_indices = set()
-
- def find_column(targets, is_numeric=False, is_date=False, exclude_indices=None):
- exclude_indices = exclude_indices or set()
- for k, v in header_map.items():
- if any(t in k for t in targets):
- idx = keys.index(v)
- if idx not in exclude_indices:
- return row.get(v), idx
- if is_numeric or is_date:
- for i, val in enumerate(values):
- if i in exclude_indices: continue
- if is_numeric:
- try:
- temp = val.replace('$', '').replace(',', '').strip()
- if temp:
- float(temp)
- return val, i
- except: pass
- if is_date:
- try:
- self._parse_date(val)
- return val, i
- except: pass
- return None, -1
-
- # Heuristic backups for unmapped fields
- if amount is None:
- amount_val, idx = find_column(['amount', 'value', 'price', 'total'], is_numeric=True)
- if idx != -1:
- amount = amount_val
- mapped_indices.add(idx)
-
- if date_str is None:
- date_val, idx = find_column(['date', 'time'], is_date=True, exclude_indices=mapped_indices)
- if idx != -1:
- date_str = date_val
- mapped_indices.add(idx)
-
- if ending_balance is None:
- bal_val, idx = find_column(['balance', 'ending', 'real', 'end balance'], is_numeric=True, exclude_indices=mapped_indices)
- if idx != -1:
- ending_balance = bal_val
- mapped_indices.add(idx)
-
- if starting_balance is None:
- # Attempt to find starting balance only if multiple numeric columns exist
- numeric_count = len([v for v in values if v.replace('$', '').replace(',', '').strip().replace('.', '').isdigit()])
- bal_val, idx = find_column(['starting', 'start balance', 'opening'], is_numeric=(numeric_count > 2), exclude_indices=mapped_indices)
- if idx != -1:
- starting_balance = bal_val
- mapped_indices.add(idx)
-
- if name is None:
- for i, val in enumerate(values):
- if i in mapped_indices: continue
- try:
- float(val.replace('$', '').replace(',', '').strip())
- continue
- except:
- try:
- self._parse_date(val)
- continue
- except:
- name = val
- mapped_indices.add(i)
- break
-
- if not name and values:
- name = values[0]
-
- transaction_date = self._parse_date(date_str)
- clean_amount = self._parse_float(amount)
- clean_start_balance = self._parse_float(starting_balance)
- clean_end_balance = self._parse_float(ending_balance)
-
- # Ensure statement is balanced (End = Start + Amount) to prevent red state
- if starting_balance is not None and ending_balance is not None:
- b_start, b_end = clean_start_balance, clean_end_balance
- clean_amount = b_end - b_start
- elif ending_balance is not None:
- b_end = clean_end_balance
- b_start = b_end - clean_amount
- elif starting_balance is not None:
- b_start = clean_start_balance
- b_end = b_start + clean_amount
- else:
- b_start, b_end = 0.0, clean_amount
-
- partner = False
- if partner_name:
- partner_name = partner_name.strip()
- if partner_name.lower() in ('bank', 'cash', 'main', 'demo', 'yourcompany'):
- partner_name = False
- if partner_name:
- partner = self.env['res.partner'].search([('name', '=', partner_name)], limit=1)
- if not partner and len(partner_name) > 1 and not partner_name.isdigit():
- try:
- self._parse_date(partner_name)
- except:
- raise ValidationError(_("Partner '%s' does not exist") % partner_name)
-
- statement = self.env['account.bank.statement'].create({
- 'name': name,
- 'journal_id': self.journal_id.id,
- 'company_id': self.journal_id.company_id.id,
- 'date': transaction_date,
- 'balance_start': b_start,
- 'balance_end_real': b_end,
- 'line_ids': [(0, 0, {
- 'date': transaction_date,
- 'payment_ref': name or 'csv file',
- 'partner_id': partner.id if partner else False,
- 'journal_id': self.journal_id.id,
- 'amount': clean_amount,
- })],
- })
- statement_id = statement.id
-
- return {
- 'type': 'ir.actions.act_window',
- 'name': 'Statements',
- 'view_mode': 'list',
- 'res_model': 'account.bank.statement',
- 'res_id': statement.id,
- }
- elif split_tup[1] == '.xlsx':
- # Reading xlsx file
- try:
- order = openpyxl.load_workbook(
- filename=BytesIO(base64.b64decode(self.attachment)))
- xl_order = order.active
- except:
- raise ValidationError(_("Choose correct file"))
- for record in xl_order.iter_rows(min_row=2, max_row=None,
- min_col=None,
- max_col=None,
- values_only=True):
- line = list(record)
- # Reading the content from file
- if line[0] and line[1] and line[3]:
- partner = self.env['res.partner'].search(
- [('name', '=', line[3])])
- date_obj = self._parse_date(line[2])
- # Creating record
- if partner:
- statement = self.env[
- 'account.bank.statement'].create({
- 'name': line[0],
- 'line_ids': [
- (0, 0, {
- 'date': date_obj,
- 'payment_ref': 'xlsx file',
- 'partner_id': partner.id,
- 'journal_id': self.journal_id.id,
- 'amount': line[1],
- }),
- ],
- })
- else:
- raise ValidationError(_("Partner not exist"))
- else:
- if not line[0]:
- raise ValidationError(
- _("Account name is not set"))
- elif not line[1]:
- raise ValidationError(
- _("Amount is not set"))
- elif not line[3]:
- date_obj = self._parse_date(line[2])
- # Creating record
- statement = self.env[
- 'account.bank.statement'].create({
- 'name': line[0],
- 'line_ids': [
- (0, 0, {
- 'date': date_obj,
- 'payment_ref': 'xlsx file',
- 'journal_id': self.journal_id.id,
- 'amount': line[1],
- }),
- ],
- })
- return {
- 'type': 'ir.actions.act_window',
- 'name': 'Statements',
- 'view_mode': 'list',
- 'res_model': 'account.bank.statement',
- 'res_id': statement.id,
- }
- elif split_tup[1] == '.ofx':
- try:
- file_data = base64.b64decode(self.attachment)
- ofx_file = OfxParser.parse(io.BytesIO(file_data))
- except Exception as e:
- raise ValidationError(_("Wrong file format or parsing error: %s") % str(e))
-
- if not ofx_file.account or not ofx_file.account.statement:
- raise ValidationError(_("No account information found in OFX file."))
-
- statement_id = False
- stmt = ofx_file.account.statement
-
- # Standardize balance extraction
- ledger_bal = getattr(stmt, 'balance', getattr(stmt, 'ledger_balance', None))
- final_balance = self._parse_float(ledger_bal) if ledger_bal is not None else 0.0
-
- for transaction in stmt.transactions:
- amount = self._parse_float(transaction.amount)
- if amount == 0:
- continue
-
- # Clean labels and match partners
- label = (transaction.memo or transaction.name or transaction.payee or 'ofx transaction').strip()
- payee_name = transaction.payee.strip() if transaction.payee else False
-
- partner = False
- if payee_name:
- # Shared noise-filtering for partners
- if payee_name.lower() in ('bank', 'cash', 'main', 'demo', 'yourcompany'):
- payee_name = False
- if payee_name:
- partner = self.env['res.partner'].search([('name', '=', payee_name)], limit=1)
-
- date = self._parse_date(transaction.date)
- b_end = final_balance
- b_start = b_end - amount
-
- statement = self.env['account.bank.statement'].create({
- 'name': label,
- 'journal_id': self.journal_id.id,
- 'company_id': self.journal_id.company_id.id,
- 'date': date,
- 'balance_start': b_start,
- 'balance_end_real': b_end,
- 'line_ids': [(0, 0, {
- 'date': date,
- 'payment_ref': label,
- 'partner_id': partner.id if partner else False,
- 'journal_id': self.journal_id.id,
- 'amount': amount,
- })],
- })
- statement_id = statement.id
-
- if not statement_id:
- raise ValidationError(_("No valid transactions found in the OFX file."))
-
- return {
- 'type': 'ir.actions.act_window',
- 'name': 'Statements',
- 'view_mode': 'list',
- 'res_model': 'account.bank.statement',
- 'res_id': statement_id,
- }
-
- elif split_tup[1] == '.qif':
- try:
- file_data = base64.b64decode(self.attachment)
- file_string = file_data.decode('utf-8-sig')
- qif = QifParser().parse(io.StringIO(file_string))
- except Exception as e:
- raise ValidationError(_("Error parsing QIF file: %s") % str(e))
-
- statement_id = False
- for account in qif.get_accounts():
- for transaction in qif.get_transactions(account):
- amount = self._parse_float(transaction.amount)
- if amount == 0:
- continue
-
- date = self._parse_date(transaction.date)
- label = (transaction.payee or transaction.memo or 'qif transaction').strip()
- payee_name = transaction.payee.strip() if transaction.payee else False
-
- partner = False
- if payee_name:
- if payee_name.lower() in ('bank', 'cash', 'main', 'demo', 'yourcompany'):
- payee_name = False
- if payee_name:
- partner = self.env['res.partner'].search([('name', '=', payee_name)], limit=1)
-
- statement = self.env['account.bank.statement'].create({
- 'name': label,
- 'journal_id': self.journal_id.id,
- 'company_id': self.journal_id.company_id.id,
- 'date': date,
- 'balance_start': 0.0,
- 'balance_end_real': amount,
- 'line_ids': [(0, 0, {
- 'date': date,
- 'payment_ref': label,
- 'partner_id': partner.id if partner else False,
- 'journal_id': self.journal_id.id,
- 'amount': amount,
- })],
- })
- statement_id = statement.id
-
- if not statement_id:
- raise ValidationError(_("No valid transactions found in the QIF file."))
-
- return {
- 'type': 'ir.actions.act_window',
- 'name': 'Statements',
- 'view_mode': 'list',
- 'res_model': 'account.bank.statement',
- 'res_id': statement_id,
- }
- else:
- raise ValidationError(_("Choose correct file"))
diff --git a/addons/base_accounting_kit/wizard/import_bank_statement_views.xml b/addons/base_accounting_kit/wizard/import_bank_statement_views.xml
deleted file mode 100644
index 40c33b6..0000000
--- a/addons/base_accounting_kit/wizard/import_bank_statement_views.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
- import.bank.statement.view.form
- import.bank.statement
-
-
-
-
-
- Upload csv or xlsx or ofx or qif file format
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- import.bank.statement.view.action
- ir.actions.act_window
- import.bank.statement
- list,form
-
- new
-
-
diff --git a/addons/base_accounting_kit/wizard/kit_account_tax_report.py b/addons/base_accounting_kit/wizard/kit_account_tax_report.py
deleted file mode 100644
index db768cb..0000000
--- a/addons/base_accounting_kit/wizard/kit_account_tax_report.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# -*- coding: utf-8 -*-
-#############################################################################
-#
-# Cybrosys Technologies Pvt. Ltd.
-#
-# Copyright (C) 2025-TODAY Cybrosys Technologies()
-# Author: Cybrosys Techno Solutions()
-#
-# You can modify it under the terms of the GNU LESSER
-# GENERAL PUBLIC LICENSE (LGPL v3), Version 3.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details.
-#
-# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE
-# (LGPL v3) along with this program.
-# If not, see .
-#
-#############################################################################
-from odoo import fields, models
-from odoo.tools.misc import get_lang
-
-
-class AccountTaxReport(models.TransientModel):
- _name = 'kit.account.tax.report'
- _inherit = "account.report"
- _description = 'Tax Report'
-
- section_main_report_ids = fields.Many2many(string="Section Of",
- comodel_name='account.report',
- relation="account_tax_report_section_rel",
- column1="sub_report_id",
- column2="main_report_id")
- section_report_ids = fields.Many2many(string="Sections",
- comodel_name='account.report',
- relation="account_tax_report_section_rel",
- column1="main_report_id",
- column2="sub_report_id")
- company_id = fields.Many2one('res.company', string='Company', required=True, readonly=True, default=lambda self: self.env.company)
- name = fields.Char(string="Tax Report", default="Tax Report",
- required=True, translate=True)
- date_from = fields.Date(string='Start Date')
- date_to = fields.Date(string='End Date')
- journal_ids = fields.Many2many(
- comodel_name='account.journal',
- string='Journals',
- required=True,
- default=lambda self: self.env['account.journal'].search([('company_id', '=', self.company_id.id)]),
- domain="[('company_id', '=', company_id)]",
- )
- target_move = fields.Selection([('posted', 'All Posted Entries'),
- ('all', 'All Entries'),
- ], string='Target Moves', required=True, default='posted')
-
- def _build_contexts(self, data):
- result = {}
- result['journal_ids'] = 'journal_ids' in data['form'] and data['form']['journal_ids'] or False
- result['state'] = 'target_move' in data['form'] and data['form']['target_move'] or ''
- result['date_from'] = data['form']['date_from'] or False
- result['date_to'] = data['form']['date_to'] or False
- result['strict_range'] = True if result['date_from'] else False
- result['company_id'] = data['form']['company_id'][0] or False
- return result
-
- def check_report(self):
- self.ensure_one()
- data = {}
- data['ids'] = self.env.context.get('active_ids', [])
- data['model'] = self.env.context.get('active_model', 'ir.ui.menu')
- data['form'] = self.read(['date_from', 'date_to', 'journal_ids', 'target_move', 'company_id'])[0]
- used_context = self._build_contexts(data)
- data['form']['used_context'] = dict(used_context, lang=get_lang(self.env).code)
- return self.with_context(discard_logo_check=True)._print_report(data)
-
- def pre_print_report(self, data):
- data['form'].update(self.read(['display_account'])[0])
- return data
-
- def _print_report(self, data):
- return self.env.ref(
- 'base_accounting_kit.action_report_account_tax').report_action(
- self, data=data)
diff --git a/addons/base_accounting_kit/wizard/kit_account_tax_report_views.xml b/addons/base_accounting_kit/wizard/kit_account_tax_report_views.xml
deleted file mode 100644
index 5d0c402..0000000
--- a/addons/base_accounting_kit/wizard/kit_account_tax_report_views.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- kit.account.tax.report.view.form.inherit.base.accounting.kit
- kit.account.tax.report
-
-
-
-
-
-
-
-
- Tax Reports
- kit.account.tax.report
- ir.actions.act_window
- form
-
- {}
- new
-
-
-
-