Skip to content

Commit

Permalink
Merge PR #627 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by sbidoul
  • Loading branch information
OCA-git-bot committed Sep 10, 2024
2 parents 444c7d4 + 98deed3 commit d91905a
Show file tree
Hide file tree
Showing 22 changed files with 346 additions and 321 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
^mis_builder_budget/|
^mis_builder_demo/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
Expand Down
182 changes: 96 additions & 86 deletions mis_builder_budget/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,25 @@ MIS Builder Budget
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmis--builder-lightgray.png?logo=github
:target: https://github.com/OCA/mis-builder/tree/16.0/mis_builder_budget
:target: https://github.com/OCA/mis-builder/tree/17.0/mis_builder_budget
:alt: OCA/mis-builder
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mis-builder-16-0/mis-builder-16-0-mis_builder_budget
:target: https://translation.odoo-community.org/projects/mis-builder-17-0/mis-builder-17-0-mis_builder_budget
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/mis-builder&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/mis-builder&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Create budgets for MIS reports.

This module lets you create budgets for any MIS report. Several budgets can be
created for a given report template (ie one budget per year). Budget figures
are provided by KPI or by GL account, with different time periods. A budget can
then be selected as a data source for a MIS report column, and the report will
show the budgeted values for each KPI, adjusted for the period of the column.
This module lets you create budgets for any MIS report. Several budgets
can be created for a given report template (ie one budget per year).
Budget figures are provided by KPI or by GL account, with different time
periods. A budget can then be selected as a data source for a MIS report
column, and the report will show the budgeted values for each KPI,
adjusted for the period of the column.

**Table of contents**

Expand All @@ -44,152 +45,161 @@ show the budgeted values for each KPI, adjusted for the period of the column.
Usage
=====

There are two ways to use this module: create budgets by KPI or budgets by
GL accounts. Currently, the two methods cannot be combined in the same budget.
There are two ways to use this module: create budgets by KPI or budgets
by GL accounts. Currently, the two methods cannot be combined in the
same budget.

**Budget by KPIs**

To use this this mode, you first need to flag at least some KPI in a MIS report
to be budgetable. You also need to configure the accumulation method on the KPI
according to their type.
To use this this mode, you first need to flag at least some KPI in a MIS
report to be budgetable. You also need to configure the accumulation
method on the KPI according to their type.

The accumulation method determines how budgeted values spanning over a
time period are transformed to match the reporting period.

* Sum: values of shorter period are added, values of longest or partially overlapping
periods are adjusted pro-rata temporis (eg monetary amount such as revenue).
* Average: values of included period are averaged with a pro-rata temporis weight.
Typically used for values that do not accumulate over time (eg a number of employees).
- Sum: values of shorter period are added, values of longest or
partially overlapping periods are adjusted pro-rata temporis (eg
monetary amount such as revenue).
- Average: values of included period are averaged with a pro-rata
temporis weight. Typically used for values that do not accumulate
over time (eg a number of employees).

When KPI are configured, you need to create a budget, using the MIS Budget (by
KPIs) menu, then click on the budget items button to create or import the
budgeted amounts for all your KPI and time periods.
When KPI are configured, you need to create a budget, using the MIS
Budget (by KPIs) menu, then click on the budget items button to create
or import the budgeted amounts for all your KPI and time periods.

**Budget by GL accounts**

You can also create budgets by GL accounts. In this case, the budget is
populated with one line per GL account (and optionally analytic account and/or
tags) and time period.
populated with one line per GL account (and optionally analytic account
and/or tags) and time period.

**Add budget columns to report instances**

Finally, a column (aka period) must be added to a MIS report instance,
selecting your newly created budget as a data source. The data will be adjusted
to the reporting period when displayed. Columns can be compared by adding a
column of type "comparison" or "sum".
selecting your newly created budget as a data source. The data will be
adjusted to the reporting period when displayed. Columns can be compared
by adding a column of type "comparison" or "sum".

Known issues / Roadmap
======================

The mis_builder `roadmap <https://github.com/OCA/mis-builder/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement>`_
and `known issues <https://github.com/OCA/mis-builder/issues?q=is%3Aopen+is%3Aissue+label%3Abug>`_ can
be found on GitHub.
The mis_builder
`roadmap <https://github.com/OCA/mis-builder/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement>`__
and `known
issues <https://github.com/OCA/mis-builder/issues?q=is%3Aopen+is%3Aissue+label%3Abug>`__
can be found on GitHub.

Changelog
=========

16.0.5.0.0 (2023-04-01)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

**Features**

- Migration to 16.0.

- removal of analytic fetures because the upstream ``analytic_distribution`` mechanism
is not compatible; support may be introduced in separate module, depending on use
cases (`#472 <https://github.com/OCA/mis-builder/issues/472>`_)
- Migration to 16.0.

- removal of analytic fetures because the upstream
``analytic_distribution`` mechanism is not compatible; support may
be introduced in separate module, depending on use cases
(`#472 <https://github.com/OCA/mis-builder/issues/472>`__)

**Bugfixes**

- Fix display of budgets in presence of sub KPIs. (`#428 <https://github.com/OCA/mis-builder/issues/428>`_)

- Fix display of budgets in presence of sub KPIs.
(`#428 <https://github.com/OCA/mis-builder/issues/428>`__)

14.0.4.0.0 (2022-01-08)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

**Features**

- A label field has been added to MIS Budget by Account items. When overlap between budget
items is allowed this allows creating a budget with several contributions for a given
account. (`#382 <https://github.com/OCA/mis-builder/issues/382>`_)
- The balance field on MIS Budget by Account items is now writeable. This allows for
easier data entry and import. (`#383 <https://github.com/OCA/mis-builder/issues/383>`_)
- MIS Budget by Account can now be configured to allow budget items with overlapping
dates. Each overlapping item contributes to the budget of the corresponding period. (`#384 <https://github.com/OCA/mis-builder/issues/384>`_)

- A label field has been added to MIS Budget by Account items. When
overlap between budget items is allowed this allows creating a budget
with several contributions for a given account.
(`#382 <https://github.com/OCA/mis-builder/issues/382>`__)
- The balance field on MIS Budget by Account items is now writeable.
This allows for easier data entry and import.
(`#383 <https://github.com/OCA/mis-builder/issues/383>`__)
- MIS Budget by Account can now be configured to allow budget items
with overlapping dates. Each overlapping item contributes to the
budget of the corresponding period.
(`#384 <https://github.com/OCA/mis-builder/issues/384>`__)

14.0.3.5.1 (2021-04-06)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

**Bugfixes**

- Fix incorrect budget by account multi company security rules. (`#347 <https://github.com/OCA/mis-builder/issues/347>`_)

- Fix incorrect budget by account multi company security rules.
(`#347 <https://github.com/OCA/mis-builder/issues/347>`__)

13.0.3.5.0 (2020-03-28)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

**Features**

- Budget by GL account: allow budgeting by GL account in addition to the
existing mechanism to budget by KPI. Budget items have a begin and end
date, and when reporting a pro-rata temporis adjustment is made to match
the reporting period. (`#259 <https://github.com/OCA/mis-builder/issues/259>`_)

- Budget by GL account: allow budgeting by GL account in addition to
the existing mechanism to budget by KPI. Budget items have a begin
and end date, and when reporting a pro-rata temporis adjustment is
made to match the reporting period.
(`#259 <https://github.com/OCA/mis-builder/issues/259>`__)

13.0.3.4.0 (2020-01-??)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

Migration to odoo 13.0.

12.0.3.4.0 (2019-10-26)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

**Bugfixes**

- Consider analytic tags too when detecting overlapping budget items.
Previously only analytic account was considered, and this overlap detection
mechanism was overlooked when analytic tags were added to budget items. (`#241 <https://github.com/oca/mis-builder/issues/241>`_)

- Consider analytic tags too when detecting overlapping budget items.
Previously only analytic account was considered, and this overlap
detection mechanism was overlooked when analytic tags were added to
budget items.
(`#241 <https://github.com/oca/mis-builder/issues/241>`__)

11.0.3.3.0 (2019-01-13)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

**Features**

- Support analytic filters. (`#15 <https://github.com/oca/mis-builder/issues/15>`_)

- Support analytic filters.
(`#15 <https://github.com/oca/mis-builder/issues/15>`__)

11.0.3.2.1 (2018-06-30)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

- [IMP] Support analytic tags in budget items
(`#100 <https://github.com/OCA/mis-builder/pull/100>`_)
- [IMP] Support analytic tags in budget items
(`#100 <https://github.com/OCA/mis-builder/pull/100>`__)

11.0.3.2.0 (2018-05-02)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

- [FIX] #NAME error in out-of-order computation of non
budgetable items in budget columns
(`#68 <https://github.com/OCA/mis-builder/pull/69>`_)
- [FIX] #NAME error in out-of-order computation of non budgetable items
in budget columns
(`#68 <https://github.com/OCA/mis-builder/pull/69>`__)

11.0.3.1.1 (2018-02-04)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

Migration to Odoo 11. No new feature.
(`#67 <https://github.com/OCA/mis-builder/pull/67>`_)
(`#67 <https://github.com/OCA/mis-builder/pull/67>`__)

10.0.3.1.0 (2017-11-14)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

New features:

- [ADD] multi-company record rule for MIS Budgets
(`#27 <https://github.com/OCA/mis-builder/issues/27>`_)
- [ADD] multi-company record rule for MIS Budgets
(`#27 <https://github.com/OCA/mis-builder/issues/27>`__)

10.0.1.1.1 (2017-10-01)
~~~~~~~~~~~~~~~~~~~~~~~
-----------------------

First version.

Expand All @@ -199,29 +209,29 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/mis-builder/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/OCA/mis-builder/issues/new?body=module:%20mis_builder_budget%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/mis-builder/issues/new?body=module:%20mis_builder_budget%0Aversion:%2017.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
~~~~~~~
-------

* ACSONE SA/NV

Contributors
~~~~~~~~~~~~
------------

* Stéphane Bidoul <[email protected]>
* Adrien Peiffer <[email protected]>
* Benjamin Willig <[email protected]>
* Artem Kostyuk <[email protected]>
* Dzung Tran <[email protected]>
- Stéphane Bidoul <[email protected]>
- Adrien Peiffer <[email protected]>
- Benjamin Willig <[email protected]>
- Artem Kostyuk <[email protected]>
- Dzung Tran <[email protected]>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -241,6 +251,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbidoul|

This module is part of the `OCA/mis-builder <https://github.com/OCA/mis-builder/tree/16.0/mis_builder_budget>`_ project on GitHub.
This module is part of the `OCA/mis-builder <https://github.com/OCA/mis-builder/tree/17.0/mis_builder_budget>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
9 changes: 4 additions & 5 deletions mis_builder_budget/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

{
"name": "MIS Builder Budget",
"summary": """
Create budgets for MIS reports""",
"version": "16.0.5.0.2",
"summary": "Create budgets for MIS reports",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, " "Odoo Community Association (OCA)",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/mis-builder",
"depends": ["mis_builder", "account"],
"data": [
Expand All @@ -22,7 +21,7 @@
"security/mis_budget_by_account.xml",
"views/mis_budget_by_account.xml",
],
"installable": False,
"installable": True,
"development_status": "Production/Stable",
"maintainers": ["sbidoul"],
}
2 changes: 0 additions & 2 deletions mis_builder_budget/models/mis_budget_by_account_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ class MisBudgetByAccountItem(models.Model):
company_id = fields.Many2one(
"res.company",
related="budget_id.company_id",
readonly=True,
store=True,
)
company_currency_id = fields.Many2one(
"res.currency",
related="budget_id.company_id.currency_id",
string="Company Currency",
readonly=True,
help="Utility field to express amount currency",
store=True,
)
Expand Down
2 changes: 1 addition & 1 deletion mis_builder_budget/models/mis_budget_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MisBudgetItem(models.Model):
_order = "budget_id, date_from, seq1, seq2"

budget_id = fields.Many2one(comodel_name="mis.budget")
report_id = fields.Many2one(related="budget_id.report_id", readonly=True)
report_id = fields.Many2one(related="budget_id.report_id")
kpi_expression_id = fields.Many2one(
domain=(
"[('kpi_id.report_id', '=', report_id),"
Expand Down
6 changes: 2 additions & 4 deletions mis_builder_budget/models/mis_budget_item_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ class MisBudgetItemAbstract(models.AbstractModel):
index=True,
)
budget_date_from = fields.Date(
related="budget_id.date_from", readonly=True, string="Budget Date From"
)
budget_date_to = fields.Date(
related="budget_id.date_to", readonly=True, string="Budget Date To"
related="budget_id.date_from", string="Budget Date From"
)
budget_date_to = fields.Date(related="budget_id.date_to", string="Budget Date To")
date_range_id = fields.Many2one(
comodel_name="date.range",
domain="[('date_start', '>=', budget_date_from),"
Expand Down
5 changes: 5 additions & 0 deletions mis_builder_budget/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Stéphane Bidoul \<<[email protected]>\>
- Adrien Peiffer \<<[email protected]>\>
- Benjamin Willig \<<[email protected]>\>
- Artem Kostyuk \<<[email protected]>\>
- Dzung Tran \<<[email protected]>\>
5 changes: 0 additions & 5 deletions mis_builder_budget/readme/CONTRIBUTORS.rst

This file was deleted.

Loading

0 comments on commit d91905a

Please sign in to comment.