Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
eeeae61
[15.0][ADD] budget_control
Saran440 Oct 17, 2023
49f49bf
[FIX] budget_control: close budget with fwd_analytic_account_id
Saran440 Jan 3, 2024
152ea17
[FIX] budget_control: check budget with sudo()
Saran440 Feb 11, 2024
99a265b
[FIX] budget_control_purchase: add precommit check budget function
Saran440 Apr 25, 2024
ba0e732
[FIX] check budget with period
Saran440 Apr 25, 2024
4861601
[FIX] error no variable
Saran440 Apr 26, 2024
1d26eaf
[FIX] budget_control: error no date commit on convert currency amount
May 2, 2024
5d0aa68
[FIX] budget_control: not check required analytic with display_type
Saran440 May 8, 2024
d177f69
[FIX] pre-commit
Saran440 Jun 7, 2024
1834dfd
[FIX] budget_control: commit budget revenue case
Saran440 Jun 7, 2024
a1f71f4
[MIG] budget_control: Migration to 16.0
Saran440 Jul 18, 2024
62437ff
[FIX] budget_control: flush module when precommit for check budget
Saran440 Aug 1, 2024
5010915
[FIX] json_popever with no visible
Saran440 Aug 14, 2024
ced4301
[FIX] budget_control: refactor analytic in budget adjustment
Saran440 Aug 15, 2024
a643b03
[ENH] credit, debit decimal
Saran440 Sep 10, 2024
dddf43c
[FIX] budget_control: update date end analytic extend
Saran440 Sep 11, 2024
7cf8ecf
[FIX] budget_control: test script carry forward
Saran440 Sep 24, 2024
24ed2ff
[FIX] budget_control: cancel carry forward first doc
Saran440 Sep 24, 2024
b79c065
[ENH] budget_control: add config control_key in company
Saran440 Sep 24, 2024
fa160e5
[IMP] budget_control: multi-company budget adjustment
Saran440 Sep 24, 2024
44e0824
[FIX] budget_control_expense: compute without tax
Saran440 Sep 24, 2024
0f288ec
[IMP] budget_control: pre-commit auto fixes
Saran440 Mar 10, 2025
0657956
[18.0][MIG] budget_control: refactor code
Saran440 Mar 28, 2025
e7596a6
[IMP] budget_control: multi-company
Saran440 Apr 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
291 changes: 291 additions & 0 deletions budget_control/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
==============
Budget Control
==============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:353c8401879120bf194a5135e6f67838a807a00dc09ec0d8388ce36d90910040
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-ecosoft--odoo%2Fbudgeting-lightgray.png?logo=github
:target: https://github.com/ecosoft-odoo/budgeting/tree/18.0/budget_control
:alt: ecosoft-odoo/budgeting

|badge1| |badge2| |badge3|

This module is the main module from a set of budget control modules.
This module alone will allow you to work in full cycle of budget control
process. Other modules, each one are the small enhancement of this
module, to fullfill additional needs. Having said that, following will
describe the full cycle of budget control already provided by this
module,

Budget Control Core Features:
-----------------------------

- **Budget Commitment (base.budget.move)**

Probably the most crucial part of budget_control.

- Budget Balance = Budget Allocated - (Budget Actuals - Budget
Commitments)

Actual amount are from account.move.line from posted invoice.
Commitments can be sales/purchase, expense, purchase request, etc.
Document required to be budget commitment can extend base.budget.move.
For example, the module budget_control_expense will create budget
commitment expense.budget.move for approved expense. Note that, in
this budget_control module, there is no extension for budget
commitment yet.

- **Budget Template (budget.template)**

A Budget Template in the budget control system serves as a framework
for controlling the budget, allowing for the budget to be managed
according to the pre-defined template. The budget template has a
relationship with the accounting, and is used to control spending
based on pre-configured accounts.

- **Budget Period (budget.period)**

Budget Period is the first thing to do for new budget year, and is
used to govern how budget will be controlled over the defined date
range, i.e.,

- Duration of budget year
- Template to control (budget.template)
- Document to do budget checking
- Analytic account in controlled
- Control Level

Although not mandatory, an organization will most likely use fiscal
year as budget period. In such case, there will be 1 budget period per
fiscal year, and multiple budget control sheet (one per analytic).

- **Budget Control Sheet (budget.control)**

Each analytic account can have one budget control sheet per budget
period. The budget control is used to allocate budget amount in a
simpler way. In the backend it simply create budget.control.line,
nothing too fancy. Once we have budget allocations, the system is
ready to perform budget check.

- **Budget Checking**

By calling function -- check_budget(), system will check whether the
confirmation of such document can result in negative budget balance.
If so, it throw error message. In this module, budget check occur
during posting of invoice and journal entry. To check budget also on
more documents, do install budget_control_xxx relevant to that
document.

- **Budget Constraint**

To make the function -- check_budget() more flexible, additional rules
or limitations can be added to the budget checking process. The system
will perform the regular budget check and will also check the
additional conditions specified in the added rules. An example of
using budget constraints can be seen from the budget_allocation
module.

- **Budget Reports**

Currently there are 2 types of report.

1. Budget Monitoring: combine all budget related transactions, and
show them in Standard Odoo BI view.
2. Actual Budget Moves: combine all actual commit transactions, and
show them in Standard Odoo BI view.

- **Budget Commitment Move Forward**

In case budget commitment is being used. Sometime user has committed
budget withing this year but not ready to use it and want to move the
commitment amount to next year budget. Budget Commitment Forward can
be use to change the budget move's date to the designated year.

- **Budget Transfer**

This module allow transferring allocated budget from one budget
control sheet to other

Extended Modules:
-----------------

Following are brief explanation of what the extended module will do.

**Budget Move extension**

These modules extend base.budget.move for other document budget
commitment.

- budget_control_expense
- budget_control_purchase
- budget_control_purchase_request
- budget_control_sale

**Budget Allocation**

This module is the main module for manage allocation (source of fund,
analytic tag and analytic account) until set budget control. and allow
create Master Data source of fund, analytic tag dimension. Users can
view source of fund monitoring report

- budget_allocation

**Tier Validation**

Extend base_tier_validation for budget control sheet

- budget_control_tier_validation

**Analytic Tag Dimension Enhancements**

When 1 dimension (analytic account) is not enough, we can use dimension
to create persistent dimension columns

- analytic_tag_dimension
- analytic_tag_dimension_enhanced

Following modules ensure that, analytic_tag_dimension will work with all
new budget control objects. These are important for reporting purposes.

- budget_allocation
- budget_allocation_expense
- budget_allocation_purchase

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

Before start using this module, following access right must be set.

- Budget User for Budget Control Sheet, Budget Report
- Budget Manager for Budget Period

Followings are sample steps to start with,

1. Create new Budget KPI

To create budget KPI using in budget template

2. Create new Budget Template

- Add new template for controlling Budget following kpi-account

3. Create new Budget Period

- Choose Budget template
- Identify date range, i.e., 1 fiscal year
- Plan Date Range, i.e., Quarter, the slot to fill allocation in
budget control will split by quarter
- Control Budget = True (if not check = not check budget for this
period)

4. Create Budget Control Sheet

To create budget control sheet, you can either create manually one by
one or by using the helper, Action > Create Budget Control Sheet

- Choose Analytic budget_control_purchase_tag_dimension
- Check All Analytic Account, this will list all analytic account
in selected groups
- Uncheck Initial Budget By Commitment, this is used only on
following year to init budget allocation if they were committed
amount carried over.
- Click "Create Budget Control Sheet", and then view the newly
created control sheets.

5. Allocate amount in Budget Control Sheets

Each analytic account will have its own sheet. Form Budget Period,
click on the icon "Budget Control Sheets" or by Menu > Budgeting >
Budget Control Sheet, to open them.

- Based on "Plan Date Range" period, Plan table will show all KPI
split by Plan Date Range
- Allocate budget amount as appropriate.
- Click Control button, state will change to Controlled.

Note: Make sure the Plan Date Rang period already has date ranges
that covers entire budget period. Once ready, you can click on "Reset
Plan" anytime.

6. Budget Reports

After some document transaction (i.e., invoice for actuals), you can
view report anytime.

- On Budget Control sheet, click on Monitoring for see this budget
report
- Menu Budgeting > Budget Monitoring, to show budget report in
standard Odoo BI view.

7. Budget Checking

As we have checked Control Budget = True in third step, checking will
occur every time an invoice is validated. You can test by validate
invoice with big amount to exceed.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/ecosoft-odoo/budgeting/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/ecosoft-odoo/budgeting/issues/new?body=module:%20budget_control%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Ecosoft

Contributors
------------

- Kitti Upariphutthiphong <kittiu@ecosoft.co.th>
- Saran Lim. <saranl@ecosoft.co.th>

Maintainers
-----------

.. |maintainer-kittiu| image:: https://github.com/kittiu.png?size=40px
:target: https://github.com/kittiu
:alt: kittiu
.. |maintainer-ru3ix-bbb| image:: https://github.com/ru3ix-bbb.png?size=40px
:target: https://github.com/ru3ix-bbb
:alt: ru3ix-bbb
.. |maintainer-Saran440| image:: https://github.com/Saran440.png?size=40px
:target: https://github.com/Saran440
:alt: Saran440

Current maintainers:

|maintainer-kittiu| |maintainer-ru3ix-bbb| |maintainer-Saran440|

This module is part of the `ecosoft-odoo/budgeting <https://github.com/ecosoft-odoo/budgeting/tree/18.0/budget_control>`_ project on GitHub.

You are welcome to contribute.
5 changes: 5 additions & 0 deletions budget_control/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
from . import report
from . import wizards
from .hooks import update_data_hooks, uninstall_hook
66 changes: 66 additions & 0 deletions budget_control/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2020 Ecosoft Co., Ltd. (http://ecosoft.co.th)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Budget Control",
"version": "18.0.1.0.0",
"category": "Accounting",
"license": "AGPL-3",
"author": "Ecosoft, Odoo Community Association (OCA)",
"website": "https://github.com/ecosoft-odoo/budgeting",
"depends": [
"account",
"date_range",
"web_widget_x2many_2d_matrix",
],
"data": [
"security/analytic_security.xml",
"security/budget_adjustment_rules.xml",
"security/budget_control_security_groups.xml",
"security/budget_control_rules.xml",
"security/budget_plan_rules.xml",
"security/budget_transfer_rules.xml",
"security/ir.model.access.csv",
"data/budget_data.xml",
"data/sequence_data.xml",
# Wizards
"wizards/analytic_budget_edit_view.xml",
"wizards/analytic_budget_info_view.xml",
"wizards/confirm_state_budget_view.xml",
"wizards/budget_commit_forward_info_view.xml",
"wizards/budget_balance_forward_info_view.xml",
"wizards/budget_plan_analytic_select_view.xml",
# Budget
"views/budget_menuitem.xml",
"views/res_config_settings_views.xml",
"views/budget_kpi_view.xml",
"views/budget_template_view.xml",
"views/budget_period_view.xml",
"views/budget_constraint_view.xml",
"views/analytic_account_views.xml",
"views/budget_plan_view.xml",
"views/budget_control_view.xml",
"views/budget_transfer_view.xml",
"views/budget_transfer_item_view.xml",
"views/budget_move_adjustment_view.xml",
"views/budget_commit_forward_view.xml",
"views/budget_balance_forward_view.xml",
# Account Module
"views/account_budget_move.xml",
"views/account_journal_view.xml",
"views/account_move_views.xml",
"report/budget_monitor_report_view.xml",
"report/budget_move_views.xml",
],
"demo": ["demo/budget_template_demo.xml"],
# "assets": {
# "web.assets_backend": [
# "budget_control/static/src/xml/budget_popover.xml",
# ],
# },
"installable": True,
"maintainers": ["kittiu", "ru3ix-bbb", "Saran440"],
"post_init_hook": "update_data_hooks",
"uninstall_hook": "uninstall_hook",
"development_status": "Alpha",
}
7 changes: 7 additions & 0 deletions budget_control/data/budget_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="decimal_budget_precision" model="decimal.precision" forcecreate="True">
<field name="name">Budget Precision</field>
<field name="digits">2</field>
</record>
</odoo>
17 changes: 17 additions & 0 deletions budget_control/data/sequence_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="seq_budget_transfer" model="ir.sequence">
<field name="name">Budget Transfer</field>
<field name="code">budget.transfer</field>
<field name="prefix">BT/%(year)s/</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
<record id="seq_budget_move_adjust" model="ir.sequence">
<field name="name">Budget Move Adjustment</field>
<field name="code">budget.move.adjustment</field>
<field name="prefix">BA/%(year)s/</field>
<field name="padding">5</field>
<field name="company_id" eval="False" />
</record>
</odoo>
Loading