From 749414274886f79e9df701844bc4f5e0e1e57460 Mon Sep 17 00:00:00 2001 From: collo Date: Tue, 15 Oct 2024 08:39:59 +0300 Subject: [PATCH 01/11] quarterly period --- mis_builder_budget/__manifest__.py | 1 + mis_builder_budget/models/__init__.py | 1 + mis_builder_budget/models/fiscial_period.py | 34 +++++++++++++++++++++ mis_builder_budget/views/fiscial_period.xml | 20 ++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 mis_builder_budget/models/fiscial_period.py create mode 100644 mis_builder_budget/views/fiscial_period.xml diff --git a/mis_builder_budget/__manifest__.py b/mis_builder_budget/__manifest__.py index e08f57354..72b02208b 100644 --- a/mis_builder_budget/__manifest__.py +++ b/mis_builder_budget/__manifest__.py @@ -20,6 +20,7 @@ "views/mis_budget_by_account_item.xml", "security/mis_budget_by_account.xml", "views/mis_budget_by_account.xml", + "views/fiscial_period.xml", ], "installable": True, "development_status": "Production/Stable", diff --git a/mis_builder_budget/models/__init__.py b/mis_builder_budget/models/__init__.py index 3e2aa44d0..0a742fc48 100644 --- a/mis_builder_budget/models/__init__.py +++ b/mis_builder_budget/models/__init__.py @@ -8,3 +8,4 @@ from . import mis_report_instance from . import mis_report_instance_period from . import mis_report_kpi_expression +from . import fiscial_period diff --git a/mis_builder_budget/models/fiscial_period.py b/mis_builder_budget/models/fiscial_period.py new file mode 100644 index 000000000..58afa12f3 --- /dev/null +++ b/mis_builder_budget/models/fiscial_period.py @@ -0,0 +1,34 @@ +from odoo import models, fields, api + +class AccountFiscalPeriod(models.Model): + _inherit = 'account.fiscal.year' # Adjust based on your needs + + # Selection field to include 'Quarter' + period_type = fields.Selection( + [('monthly', 'Monthly'), ('quarterly', 'Quarterly'), ('yearly', 'Yearly')], + string="Period Type", + default='monthly', + required=True + ) + + quarter_start_date = fields.Date(string="Quarter Start Date") + quarter_end_date = fields.Date(string="Quarter End Date") + + @api.onchange('period_type') + def _onchange_period_type(self): + if self.period_type == 'quarterly': + # Auto set the quarter dates (Example: Adjust to your needs) + today = fields.Date.today() + current_month = today.month + if current_month in [1, 2, 3]: + self.quarter_start_date = fields.Date.from_string(f"{today.year}-01-01") + self.quarter_end_date = fields.Date.from_string(f"{today.year}-03-31") + elif current_month in [4, 5, 6]: + self.quarter_start_date = fields.Date.from_string(f"{today.year}-04-01") + self.quarter_end_date = fields.Date.from_string(f"{today.year}-06-30") + elif current_month in [7, 8, 9]: + self.quarter_start_date = fields.Date.from_string(f"{today.year}-07-01") + self.quarter_end_date = fields.Date.from_string(f"{today.year}-09-30") + else: + self.quarter_start_date = fields.Date.from_string(f"{today.year}-10-01") + self.quarter_end_date = fields.Date.from_string(f"{today.year}-12-31") diff --git a/mis_builder_budget/views/fiscial_period.xml b/mis_builder_budget/views/fiscial_period.xml new file mode 100644 index 000000000..cbdda9d61 --- /dev/null +++ b/mis_builder_budget/views/fiscial_period.xml @@ -0,0 +1,20 @@ + + + + + + + account.fiscal.year.form + account.fiscal.year + +
+ + + + + +
+
+
+
From 304caf968bdcbe4d3c3ba2dd29b914ae9b24ccd0 Mon Sep 17 00:00:00 2001 From: collo Date: Wed, 16 Oct 2024 06:06:11 +0300 Subject: [PATCH 02/11] pre commit checks --- mis_builder/README.rst | 790 ++++++++++---------- mis_builder_budget/models/fiscial_period.py | 15 +- mis_builder_budget/views/fiscial_period.xml | 13 +- 3 files changed, 410 insertions(+), 408 deletions(-) diff --git a/mis_builder/README.rst b/mis_builder/README.rst index e4f76938e..9a8298b48 100644 --- a/mis_builder/README.rst +++ b/mis_builder/README.rst @@ -46,30 +46,30 @@ Your preferred way to install addons will work with MIS Builder. An easy way to install it with all its dependencies is using pip: -- ``pip install --pre odoo12-addon-mis_builder`` -- then restart Odoo, update the addons list in your database, and - install the MIS Builder application. +- ``pip install --pre odoo12-addon-mis_builder`` +- then restart Odoo, update the addons list in your database, and + install the MIS Builder application. Usage ===== To configure this module, you need to: -- Go to Accounting > Configuration > MIS Reporting > MIS Report - Templates where you can create report templates by defining KPI's. - KPI's constitute the rows of your reports. Such report templates are - time independent. +- Go to Accounting > Configuration > MIS Reporting > MIS Report + Templates where you can create report templates by defining KPI's. + KPI's constitute the rows of your reports. Such report templates are + time independent. |image1| -- Then in Accounting > Reports > MIS Reporting > MIS Reports you can - create report instance by binding the templates to time periods, - hence defining the columns of your reports. +- Then in Accounting > Reports > MIS Reporting > MIS Reports you can + create report instance by binding the templates to time periods, hence + defining the columns of your reports. |image2| -- From the MIS Reports view, you can preview the report, add it to and - Odoo dashboard, and export it to PDF or Excel. +- From the MIS Reports view, you can preview the report, add it to and + Odoo dashboard, and export it to PDF or Excel. |image3| @@ -105,219 +105,216 @@ Changelog **Bugfixes** -- Restore compatibility with python 3.9 - (`#590 `__) +- Restore compatibility with python 3.9 + (`#590 `__) 16.0.5.1.8 (2024-02-08) ----------------------- **Bugfixes** -- Resolve a permission issue when creating report periods with a user - without admin rights. - (`#596 `__) +- Resolve a permission issue when creating report periods with a user + without admin rights. + (`#596 `__) 16.0.5.1.0 (2023-04-04) ----------------------- **Features** -- Improve UX by adding the option to edit the pivot date directly on - the view. +- Improve UX by adding the option to edit the pivot date directly on the + view. 16.0.5.0.0 (2023-04-01) ----------------------- **Features** -- Migration to 16.0 - - - Addition of a generic filter domain on reports and columns. - - Addition of a search bar to the widget. The corresponding search - view is configurable per report. - - Huge improvement of the widget style. This was long overdue. - - Make the MIS Report menu accessible to the Billing Administrator - group (instead of the hidden Show Full Accounting Features), to - align with the access rules and avoid giving a false sense of - security. This also makes the menu discoverable to new users. - - Removal of analytic fetures because the upstream - ``analytic_distribution`` mechanism is not compatible; support may - be introduced in separate module, depending on use cases. - - Abandon the ``mis_report_filters`` context key which had security - implication. It is replaced by a ``mis_analytic_domain`` context - key which is ANDed with other report-defined filters. - (`#472 `__) - - Rename the ``get_filter_descriptions_from_context`` method to - ``get_filter_descriptions``. This method may be overridden to - provide additional subtitles on the PDF or XLS report, - representing user-selected filters. - - The ``hide_analytic_filters`` has been replaced by - ``widget_show_filters``. - - The visibility of the settings button on the widget is now - controlled by a ``show_settings_button``. Before it was visible - only for the ``account_user`` group but this was not flexible - enough. - - The widget configuration settings are now grouped in a dedicated - ``Widget`` tab in the report configuration form. +- Migration to 16.0 + + - Addition of a generic filter domain on reports and columns. + - Addition of a search bar to the widget. The corresponding search + view is configurable per report. + - Huge improvement of the widget style. This was long overdue. + - Make the MIS Report menu accessible to the Billing Administrator + group (instead of the hidden Show Full Accounting Features), to + align with the access rules and avoid giving a false sense of + security. This also makes the menu discoverable to new users. + - Removal of analytic fetures because the upstream + ``analytic_distribution`` mechanism is not compatible; support may + be introduced in separate module, depending on use cases. + - Abandon the ``mis_report_filters`` context key which had security + implication. It is replaced by a ``mis_analytic_domain`` context key + which is ANDed with other report-defined filters. + (`#472 `__) + - Rename the ``get_filter_descriptions_from_context`` method to + ``get_filter_descriptions``. This method may be overridden to + provide additional subtitles on the PDF or XLS report, representing + user-selected filters. + - The ``hide_analytic_filters`` has been replaced by + ``widget_show_filters``. + - The visibility of the settings button on the widget is now + controlled by a ``show_settings_button``. Before it was visible only + for the ``account_user`` group but this was not flexible enough. + - The widget configuration settings are now grouped in a dedicated + ``Widget`` tab in the report configuration form. **Bugfixes** -- Fix access error when previewing or printing report. - (`#415 `__) +- Fix access error when previewing or printing report. + (`#415 `__) 15.0.4.0.5 (2022-07-19) ----------------------- **Bugfixes** -- Support users without timezone. - (`#388 `__) +- Support users without timezone. + (`#388 `__) 15.0.4.0.4 (2022-07-19) ----------------------- **Bugfixes** -- Allow deleting a report that has subreports. - (`#431 `__) +- Allow deleting a report that has subreports. + (`#431 `__) 15.0.4.0.2 (2022-02-16) ----------------------- **Bugfixes** -- Fix access right issue when clicking the "Save" button on a MIS - Report Instance form. - (`#410 `__) +- Fix access right issue when clicking the "Save" button on a MIS Report + Instance form. + (`#410 `__) 14.0.4.0.0 (2022-01-08) ----------------------- **Features** -- Remove various field size limits. - (`#332 `__) +- Remove various field size limits. + (`#332 `__) **Bugfixes** -- Support for the Odoo 13+ multi-company model. In multi-company mode, - several allowed companies can be declared on MIS Report instances, - and the report operates on the intersection of report companies and - companies selected in the user context. - (`#327 `__) - -- The ``get_additional_query_filter`` argument of ``evaluate()`` is now - propagated correctly. - (`#375 `__) - -- Use the ``parent_state`` field of ``account.move.line`` to filter - entries in ``posted`` and ``draft`` state only. Before, when - reporting in draft mode, all entries were used (i.e. there was no - filter), and that started including the cancelled entries/invoices in - Odoo 13.+. - - This change also contains a **breaking change** in the internal API. - For quite a while the ``target_move argument`` of AEP and other - methods was not used by MIS Builder itself and was kept for backward - compatibility. To avoid rippling effects of the necessary change to - use ``parent_state``, we now remove this argument. - (`#377 `__) +- Support for the Odoo 13+ multi-company model. In multi-company mode, + several allowed companies can be declared on MIS Report instances, and + the report operates on the intersection of report companies and + companies selected in the user context. + (`#327 `__) + +- The ``get_additional_query_filter`` argument of ``evaluate()`` is now + propagated correctly. + (`#375 `__) + +- Use the ``parent_state`` field of ``account.move.line`` to filter + entries in ``posted`` and ``draft`` state only. Before, when reporting + in draft mode, all entries were used (i.e. there was no filter), and + that started including the cancelled entries/invoices in Odoo 13.+. + + This change also contains a **breaking change** in the internal API. + For quite a while the ``target_move argument`` of AEP and other + methods was not used by MIS Builder itself and was kept for backward + compatibility. To avoid rippling effects of the necessary change to + use ``parent_state``, we now remove this argument. + (`#377 `__) 14.0.3.6.7 (2021-06-02) ----------------------- **Bugfixes** -- When on a MIS Report Instance, if you wanted to generate a new line - of type comparison, you couldn't currently select any existing period - to compare. This happened because the field domain was searching in a - NewId context, thus not finding a correct period. Changing the domain - and making it use a computed field with a search for the \_origin - record solves the problem. - (`#361 `__) +- When on a MIS Report Instance, if you wanted to generate a new line of + type comparison, you couldn't currently select any existing period to + compare. This happened because the field domain was searching in a + NewId context, thus not finding a correct period. Changing the domain + and making it use a computed field with a search for the \_origin + record solves the problem. + (`#361 `__) 14.0.3.6.6 (2021-04-23) ----------------------- **Bugfixes** -- Fix drilldown action name when the account model has been customized. - (`#350 `__) +- Fix drilldown action name when the account model has been customized. + (`#350 `__) 14.0.3.6.5 (2021-04-23) ----------------------- **Bugfixes** -- While duplicating a MIS report instance, comparison columns are - ignored because they would raise an error otherwise, as they keep the - old source_cmpcol_from_id and source_cmpcol_to_id from the original - record. (`#343 `__) +- While duplicating a MIS report instance, comparison columns are + ignored because they would raise an error otherwise, as they keep the + old source_cmpcol_from_id and source_cmpcol_to_id from the original + record. (`#343 `__) 14.0.3.6.4 (2021-04-06) ----------------------- **Features** -- The drilldown action name displayed on the breadcrumb has been - revised. The kpi description and the account ``display_name`` are - shown instead of the kpi's technical definition. - (`#304 `__) -- Add analytic group filters on report instance, periods and in the - interactive view. - (`#320 `__) +- The drilldown action name displayed on the breadcrumb has been + revised. The kpi description and the account ``display_name`` are + shown instead of the kpi's technical definition. + (`#304 `__) +- Add analytic group filters on report instance, periods and in the + interactive view. + (`#320 `__) 13.0.3.6.3 (2020-08-28) ----------------------- **Bugfixes** -- Having a "Compare columns" added on a KPI with an associated style - using a Factor/Divider did lead to the said factor being applied on - the percentages when exporting to XLSX. - (`#300 `__) +- Having a "Compare columns" added on a KPI with an associated style + using a Factor/Divider did lead to the said factor being applied on + the percentages when exporting to XLSX. + (`#300 `__) **Misc** -- `#280 `__, - `#296 `__ +- `#280 `__, + `#296 `__ 13.0.3.6.2 (2020-04-22) ----------------------- **Bugfixes** -- The "Settings" button is now displayed for users with the "Show full - accounting features" right when previewing a report. - (`#281 `__) +- The "Settings" button is now displayed for users with the "Show full + accounting features" right when previewing a report. + (`#281 `__) 13.0.3.6.1 (2020-04-22) ----------------------- **Bugfixes** -- Fix ``TypeError: 'module' object is not iterable`` when using budgets - by account. - (`#276 `__) +- Fix ``TypeError: 'module' object is not iterable`` when using budgets + by account. (`#276 `__) 13.0.3.6.0 (2020-03-28) ----------------------- **Features** -- Add column-level filters on analytic account and analytic tags. These - filters are combined with a AND with the report-level filters and - cannot be modified in the preview. - (`#138 `__) -- Access to KPI from other reports in KPI expressions, aka subreports. - In a report template, one can list named "subreports" (other report - templates). When evaluating expressions, you can access KPI's of - subreports with a dot-prefix notation. Example: you can define a MIS - Report for a "Balance Sheet", and then have another MIS Report - "Balance Sheet Ratios" that fetches KPI's from "Balance Sheet" to - create new KPI's for the ratios (e.g. balance_sheet.current_assets / - balance_sheet.total_assets). - (`#155 `__) +- Add column-level filters on analytic account and analytic tags. These + filters are combined with a AND with the report-level filters and + cannot be modified in the preview. + (`#138 `__) +- Access to KPI from other reports in KPI expressions, aka subreports. + In a report template, one can list named "subreports" (other report + templates). When evaluating expressions, you can access KPI's of + subreports with a dot-prefix notation. Example: you can define a MIS + Report for a "Balance Sheet", and then have another MIS Report + "Balance Sheet Ratios" that fetches KPI's from "Balance Sheet" to + create new KPI's for the ratios (e.g. balance_sheet.current_assets / + balance_sheet.total_assets). + (`#155 `__) 13.0.3.5.0 (2020-01-??) ----------------------- @@ -329,65 +326,65 @@ Migration to odoo 13.0. **Features** -- The ``account_id`` field of the model selected in 'Move lines source' - in the Period form can now be a Many2one relationship with any model - that has a ``code`` field (not only with ``account.account`` model). - To this end, the model to be used for Actuals move lines can be - configured on the report template. It can be something else than move - lines and the only constraint is that its ``account_id`` field has a - ``code`` field. - (`#149 `__) -- Add ``source_aml_model_name`` field so extension modules providing - alternative data sources can more easily customize their data source. - (`#214 `__) -- Support analytic tag filters in the backend view and preview widget. - Selecting several tags in the filter means filtering on move lines - which have *all* these tags set. This is to support the most common - use case of using tags for different dimensions. The filter also - makes a AND with the analytic account filter. - (`#228 `__) -- Display company in account details rows in multi-company mode. - (`#242 `__) +- The ``account_id`` field of the model selected in 'Move lines source' + in the Period form can now be a Many2one relationship with any model + that has a ``code`` field (not only with ``account.account`` model). + To this end, the model to be used for Actuals move lines can be + configured on the report template. It can be something else than move + lines and the only constraint is that its ``account_id`` field has a + ``code`` field. + (`#149 `__) +- Add ``source_aml_model_name`` field so extension modules providing + alternative data sources can more easily customize their data source. + (`#214 `__) +- Support analytic tag filters in the backend view and preview widget. + Selecting several tags in the filter means filtering on move lines + which have *all* these tags set. This is to support the most common + use case of using tags for different dimensions. The filter also makes + a AND with the analytic account filter. + (`#228 `__) +- Display company in account details rows in multi-company mode. + (`#242 `__) **Bugfixes** -- Propagate context to xlsx report, so the analytic account filter - works when exporting to xslx too. This also requires a fix to - ``report_xlsx`` (see - https://github.com/OCA/reporting-engine/pull/259). - (`#178 `__) -- In columns of type Sum, preserve styles for KPIs that are not - summable (eg percentage values). Before this fix, such cells were - displayed without style. - (`#219 `__) -- In Excel export, keep the percentage point suffix (pp) instead of - replacing it with %. - (`#220 `__) +- Propagate context to xlsx report, so the analytic account filter works + when exporting to xslx too. This also requires a fix to + ``report_xlsx`` (see + https://github.com/OCA/reporting-engine/pull/259). + (`#178 `__) +- In columns of type Sum, preserve styles for KPIs that are not summable + (eg percentage values). Before this fix, such cells were displayed + without style. + (`#219 `__) +- In Excel export, keep the percentage point suffix (pp) instead of + replacing it with %. + (`#220 `__) 12.0.3.4.0 (2019-07-09) ----------------------- **Features** -- New year-to-date mode for defining periods. - (`#165 `__) -- Add support for move lines with negative debit or credit. Used by - some for storno accounting. Not officially supported. - (`#175 `__) -- In Excel export, use a number format with thousands separator. The - specific separator used depends on the Excel configuration (eg - regional settings). - (`#190 `__) -- Add generation date/time at the end of the XLS export. - (`#191 `__) -- In presence of Sub KPIs, report more informative user errors when - non-multi expressions yield tuples of incorrect lenght. - (`#196 `__) +- New year-to-date mode for defining periods. + (`#165 `__) +- Add support for move lines with negative debit or credit. Used by some + for storno accounting. Not officially supported. + (`#175 `__) +- In Excel export, use a number format with thousands separator. The + specific separator used depends on the Excel configuration (eg + regional settings). + (`#190 `__) +- Add generation date/time at the end of the XLS export. + (`#191 `__) +- In presence of Sub KPIs, report more informative user errors when + non-multi expressions yield tuples of incorrect lenght. + (`#196 `__) **Bugfixes** -- Fix rendering of percentage types in Excel export. - (`#192 `__) +- Fix rendering of percentage types in Excel export. + (`#192 `__) 12.0.3.3.0 (2019-01-26) ----------------------- @@ -398,44 +395,44 @@ Migration to odoo 13.0. this requires an update to the JS widget that proved difficult to implement so far. Help welcome.* -- Analytic account filters. On a report, an analytic account can be - selected for filtering. The filter will be applied to move lines - queries. A filter box is also available in the widget to let the user - select the analytic account during report preview. - (`#15 `__) -- Control visibility of analytic filter combo box in widget. This is - useful to hide the analytic filters on reports where they do not make - sense, such as balance sheet reports. - (`#42 `__) -- Display analytic filters in the header of exported pdf and xls. - (`#44 `__) -- Replace the last old gtk icons with fontawesome icons. - (`#104 `__) -- Use active_test=False in AEP queries. This is important for reports - involving inactive taxes. This should not negatively effect existing - reports, because an accounting report must take into account all - existing move lines even if they reference objects such as taxes, - journals, accounts types that have been deactivated since their - creation. (`#107 `__) -- int(), float() and round() support for AccountingNone. - (`#108 `__) -- Allow referencing subkpis by name by writing kpi_x.subkpi_y in - expressions. - (`#114 `__) -- Add an option to control the display of the start/end dates in the - column headers. It is disabled by default (this is a change compared - to previous behaviour). - (`#118 `__) -- Add evaluate method to mis.report. This is a simplified method to - evaluate kpis of a report over a time period, without creating a - mis.report.instance. - (`#123 `__) +- Analytic account filters. On a report, an analytic account can be + selected for filtering. The filter will be applied to move lines + queries. A filter box is also available in the widget to let the user + select the analytic account during report preview. + (`#15 `__) +- Control visibility of analytic filter combo box in widget. This is + useful to hide the analytic filters on reports where they do not make + sense, such as balance sheet reports. + (`#42 `__) +- Display analytic filters in the header of exported pdf and xls. + (`#44 `__) +- Replace the last old gtk icons with fontawesome icons. + (`#104 `__) +- Use active_test=False in AEP queries. This is important for reports + involving inactive taxes. This should not negatively effect existing + reports, because an accounting report must take into account all + existing move lines even if they reference objects such as taxes, + journals, accounts types that have been deactivated since their + creation. (`#107 `__) +- int(), float() and round() support for AccountingNone. + (`#108 `__) +- Allow referencing subkpis by name by writing kpi_x.subkpi_y in + expressions. + (`#114 `__) +- Add an option to control the display of the start/end dates in the + column headers. It is disabled by default (this is a change compared + to previous behaviour). + (`#118 `__) +- Add evaluate method to mis.report. This is a simplified method to + evaluate kpis of a report over a time period, without creating a + mis.report.instance. + (`#123 `__) **Bugs** -- In the style form, hide the "Hide always" checkbox when "Hide always - inherit" is checked, as for all other syle elements. - (`#121 `__) +- In the style form, hide the "Hide always" checkbox when "Hide always + inherit" is checked, as for all other syle elements. + (`#121 `__) **Upgrading from 3.2 (breaking changes)** @@ -446,32 +443,32 @@ analytic filters, the underlying model must now have an 11.0.3.2.2 (2018-06-30) ----------------------- -- [FIX] Fix bug in company_default_get call returning id instead of - recordset (`#103 `__) -- [IMP] add "hide always" style property to make hidden KPI's (for KPI - that serve as basis for other formulas, but do not need to be - displayed). (`#46 `__) +- [FIX] Fix bug in company_default_get call returning id instead of + recordset (`#103 `__) +- [IMP] add "hide always" style property to make hidden KPI's (for KPI + that serve as basis for other formulas, but do not need to be + displayed). (`#46 `__) 11.0.3.2.1 (2018-05-29) ----------------------- -- [FIX] Missing comparison operator for AccountingNone leading to - errors in pbal computations - (`#93 `__) +- [FIX] Missing comparison operator for AccountingNone leading to errors + in pbal computations + (`#93 `__) 10.0.3.2.0 (2018-05-02) ----------------------- -- [FIX] make subkpi ordering deterministic - (`#71 `__) -- [ADD] report instance level option to disable account expansion, - enabling the creation of detailed templates while deferring the - decision of rendering the details or not to the report instance - (`#74 `__) -- [ADD] pbal and nbal accounting expressions, to sum positive and - negative balances respectively (ie ignoring accounts with negative, - resp positive balances) - (`#86 `__) +- [FIX] make subkpi ordering deterministic + (`#71 `__) +- [ADD] report instance level option to disable account expansion, + enabling the creation of detailed templates while deferring the + decision of rendering the details or not to the report instance + (`#74 `__) +- [ADD] pbal and nbal accounting expressions, to sum positive and + negative balances respectively (ie ignoring accounts with negative, + resp positive balances) + (`#86 `__) 11.0.3.1.2 (2018-02-04) ----------------------- @@ -484,125 +481,125 @@ Migration to Odoo 11. No new feature. New features: -- [ADD] month and year relative periods, easier to use than date ranges - for the most common case. - (`#2 `__) -- [ADD] multi-company consolidation support, with currency conversion - (the conversion rate date is the end of the reporting period) - (`#7 `__, - `#3 `__) -- [ADD] provide ref, datetime, dateutil, time, user in the evaluation - context of move line domains; among other things, this allows using - references to xml ids (such as account types or tax tags) when - querying move lines - (`#26 `__). -- [ADD] extended account selectors: you can now select accounts using - any domain on account.account, not only account codes - ``balp[('account_type', '=', 'asset_receivable')]`` - (`#4 `__). -- [IMP] in the report instance configuration form, the filters are now - grouped in a notebook page, this improves readability and - extensibility - (`#39 `__). +- [ADD] month and year relative periods, easier to use than date ranges + for the most common case. + (`#2 `__) +- [ADD] multi-company consolidation support, with currency conversion + (the conversion rate date is the end of the reporting period) + (`#7 `__, + `#3 `__) +- [ADD] provide ref, datetime, dateutil, time, user in the evaluation + context of move line domains; among other things, this allows using + references to xml ids (such as account types or tax tags) when + querying move lines + (`#26 `__). +- [ADD] extended account selectors: you can now select accounts using + any domain on account.account, not only account codes + ``balp[('account_type', '=', 'asset_receivable')]`` + (`#4 `__). +- [IMP] in the report instance configuration form, the filters are now + grouped in a notebook page, this improves readability and + extensibility + (`#39 `__). Bug fixes: -- [FIX] fix error when saving periods in comparison mode on newly - created (not yet saved) report instances. - `#50 `__ -- [FIX] improve display of Base Date report instance view. - `#51 `__ +- [FIX] fix error when saving periods in comparison mode on newly + created (not yet saved) report instances. + `#50 `__ +- [FIX] improve display of Base Date report instance view. + `#51 `__ Upgrading from 3.0 (breaking changes): -- Alternative move line data sources must have a company_id field. +- Alternative move line data sources must have a company_id field. 10.0.3.0.4 (2017-10-14) ----------------------- Bug fix: -- [FIX] issue with initial balance rounding. - `#30 `__ +- [FIX] issue with initial balance rounding. + `#30 `__ 10.0.3.0.3 (2017-10-03) ----------------------- Bug fix: -- [FIX] fix error saving KPI on newly created reports. - `#18 `__ +- [FIX] fix error saving KPI on newly created reports. + `#18 `__ 10.0.3.0.2 (2017-10-01) ----------------------- New features: -- [ADD] Alternative move line source per report column. This makes mis - buidler accounting expressions work on any model that has debit, - credit, account_id and date fields. Provided you can expose, say, - committed purchases, or your budget as a view with debit, credit and - account_id, this opens up a lot of possibilities -- [ADD] Comparison column source (more flexible than the previous, now - deprecated, comparison mechanism). CAVEAT: there is no automated - migration to the new mechanism. -- [ADD] Sum column source, to create columns that add/subtract other - columns. -- [ADD] mis.kpi.data abstract model as a basis for manual KPI values - supporting automatic ajustment to the reporting time period (the - basis for budget item, but could also server other purposes, such as - manually entering some KPI values, such as number of employee) -- [ADD] mis_builder_budget module providing a new budget data source -- [ADD] new "hide empty" style property -- [IMP] new AEP method to get accounts involved in an expression (this - is useful to find which KPI relate to a given P&L acount, to - implement budget control) -- [IMP] many UI improvements -- [IMP] many code style improvements and some refactoring -- [IMP] add the column date_from, date_to in expression evaluation - context, as well as time, datetime and dateutil modules +- [ADD] Alternative move line source per report column. This makes mis + buidler accounting expressions work on any model that has debit, + credit, account_id and date fields. Provided you can expose, say, + committed purchases, or your budget as a view with debit, credit and + account_id, this opens up a lot of possibilities +- [ADD] Comparison column source (more flexible than the previous, now + deprecated, comparison mechanism). CAVEAT: there is no automated + migration to the new mechanism. +- [ADD] Sum column source, to create columns that add/subtract other + columns. +- [ADD] mis.kpi.data abstract model as a basis for manual KPI values + supporting automatic ajustment to the reporting time period (the basis + for budget item, but could also server other purposes, such as + manually entering some KPI values, such as number of employee) +- [ADD] mis_builder_budget module providing a new budget data source +- [ADD] new "hide empty" style property +- [IMP] new AEP method to get accounts involved in an expression (this + is useful to find which KPI relate to a given P&L acount, to implement + budget control) +- [IMP] many UI improvements +- [IMP] many code style improvements and some refactoring +- [IMP] add the column date_from, date_to in expression evaluation + context, as well as time, datetime and dateutil modules Main bug fixes: -- [FIX] deletion of templates and reports (cascade and retricts) - (https://github.com/OCA/account-financial-reporting/issues/281) -- [FIX] copy of reports - (https://github.com/OCA/account-financial-reporting/issues/282) -- [FIX] better error message when periods have wrong/missing dates - (https://github.com/OCA/account-financial-reporting/issues/283) -- [FIX] xlsx export of string types KPI - (https://github.com/OCA/account-financial-reporting/issues/285) -- [FIX] sorting of detail by account -- [FIX] computation bug in detail by account when multiple accounting - expressions were used in a KPI -- [FIX] permission issue when adding report to dashboard with non admin - user +- [FIX] deletion of templates and reports (cascade and retricts) + (https://github.com/OCA/account-financial-reporting/issues/281) +- [FIX] copy of reports + (https://github.com/OCA/account-financial-reporting/issues/282) +- [FIX] better error message when periods have wrong/missing dates + (https://github.com/OCA/account-financial-reporting/issues/283) +- [FIX] xlsx export of string types KPI + (https://github.com/OCA/account-financial-reporting/issues/285) +- [FIX] sorting of detail by account +- [FIX] computation bug in detail by account when multiple accounting + expressions were used in a KPI +- [FIX] permission issue when adding report to dashboard with non admin + user 10.0.2.0.3 (unreleased) ----------------------- -- [IMP] more robust behaviour in presence of missing expressions -- [FIX] indent style -- [FIX] local variable 'ctx' referenced before assignment when - generating reports with no objects -- [IMP] use fontawesome icons -- [MIG] migrate to 10.0 -- [FIX] unicode error when exporting to Excel -- [IMP] provide full access to mis builder style for group Adviser. +- [IMP] more robust behaviour in presence of missing expressions +- [FIX] indent style +- [FIX] local variable 'ctx' referenced before assignment when + generating reports with no objects +- [IMP] use fontawesome icons +- [MIG] migrate to 10.0 +- [FIX] unicode error when exporting to Excel +- [IMP] provide full access to mis builder style for group Adviser. 9.0.2.0.2 (2016-09-27) ---------------------- -- [IMP] Add refresh button in mis report preview. -- [IMP] Widget code changes to allow to add fields in the widget more - easily. +- [IMP] Add refresh button in mis report preview. +- [IMP] Widget code changes to allow to add fields in the widget more + easily. 9.0.2.0.1 (2016-05-26) ---------------------- -- [IMP] remove unused argument in declare_and_compute_period() for a - cleaner API. This is a breaking API changing merged in urgency before - it is used by other modules. +- [IMP] remove unused argument in declare_and_compute_period() for a + cleaner API. This is a breaking API changing merged in urgency before + it is used by other modules. 9.0.2.0.0 (2016-05-24) ---------------------- @@ -611,72 +608,71 @@ Part of the work for this release has been done at the Sorrento sprint April 26-29, 2016. The rest (ie a major refactoring) has been done in the weeks after. -- [IMP] hide button box in edit mode on the report instance settings - form -- [FIX] Fix sum aggregation of non-stored fields - (https://github.com/OCA/account-financial-reporting/issues/178) -- [IMP] There is now a default style at the report level -- [CHG] Number display properties (rounding, prefix, suffix, factor) - are now defined in styles -- [CHG] Percentage difference are rounded to 1 digit instead of the - kpi's rounding, as the KPI rounding does not make sense in this case -- [CHG] The divider suffix (k, M, etc) is not inserted automatically - anymore because it is inconsistent when working with prefixes; you - need to add it manually in the suffix -- [IMP] AccountingExpressionProcessor now supports 'balu' expressions - to obtain the unallocated profit/loss of previous fiscal years; - get_unallocated_pl is the corresponding convenience method -- [IMP] AccountingExpressionProcessor now has easy methods to obtain - balances by account: get_balances_initial, get_balances_end, - get_balances_variation -- [IMP] there is now an auto-expand feature to automatically display a - detail by account for selected kpis -- [IMP] the kpi and period lists are now manipulated through forms - instead of directly in the tree views -- [IMP] it is now possible to create a report through a wizard, such - reports are deemed temporary and available through a "Last Reports - Generated" menu, they are garbaged collected automatically, unless - saved permanently, which can be done using a Save button -- [IMP] there is now a beginner mode to configure simple reports with - only one period -- [IMP] it is now easier to configure periods with fixed start/end - dates -- [IMP] the new sub-kpi mechanism allows the creation of columns with - multiple values, or columns with different values -- [IMP] thanks to the new style model, the Excel export is now styled -- [IMP] a new style model is now used to centralize style configuration -- [FIX] use =like instead of like to search for accounts, because the % - are added by the user in the expressions -- [FIX] Correctly compute the initial balance of income and expense - account based on the start of the fiscal year -- [IMP] Support date ranges (from OCA/server-tools/date_range) as a - more flexible alternative to fiscal periods -- v9 migration: fiscal periods are removed, account charts are removed, - consolidation accounts have been removed +- [IMP] hide button box in edit mode on the report instance settings + form +- [FIX] Fix sum aggregation of non-stored fields + (https://github.com/OCA/account-financial-reporting/issues/178) +- [IMP] There is now a default style at the report level +- [CHG] Number display properties (rounding, prefix, suffix, factor) are + now defined in styles +- [CHG] Percentage difference are rounded to 1 digit instead of the + kpi's rounding, as the KPI rounding does not make sense in this case +- [CHG] The divider suffix (k, M, etc) is not inserted automatically + anymore because it is inconsistent when working with prefixes; you + need to add it manually in the suffix +- [IMP] AccountingExpressionProcessor now supports 'balu' expressions to + obtain the unallocated profit/loss of previous fiscal years; + get_unallocated_pl is the corresponding convenience method +- [IMP] AccountingExpressionProcessor now has easy methods to obtain + balances by account: get_balances_initial, get_balances_end, + get_balances_variation +- [IMP] there is now an auto-expand feature to automatically display a + detail by account for selected kpis +- [IMP] the kpi and period lists are now manipulated through forms + instead of directly in the tree views +- [IMP] it is now possible to create a report through a wizard, such + reports are deemed temporary and available through a "Last Reports + Generated" menu, they are garbaged collected automatically, unless + saved permanently, which can be done using a Save button +- [IMP] there is now a beginner mode to configure simple reports with + only one period +- [IMP] it is now easier to configure periods with fixed start/end dates +- [IMP] the new sub-kpi mechanism allows the creation of columns with + multiple values, or columns with different values +- [IMP] thanks to the new style model, the Excel export is now styled +- [IMP] a new style model is now used to centralize style configuration +- [FIX] use =like instead of like to search for accounts, because the % + are added by the user in the expressions +- [FIX] Correctly compute the initial balance of income and expense + account based on the start of the fiscal year +- [IMP] Support date ranges (from OCA/server-tools/date_range) as a more + flexible alternative to fiscal periods +- v9 migration: fiscal periods are removed, account charts are removed, + consolidation accounts have been removed 8.0.1.0.0 (2016-04-27) ---------------------- -- The copy of a MIS Report Instance now copies period. - https://github.com/OCA/account-financial-reporting/pull/181 -- The copy of a MIS Report Template now copies KPIs and queries. - https://github.com/OCA/account-financial-reporting/pull/177 -- Usability: the default view for MIS Report instances is now the - rendered preview, and the settings are accessible through a gear icon - in the list view and a button in the preview. - https://github.com/OCA/account-financial-reporting/pull/170 -- Display blank cells instead of 0.0 when there is no data. - https://github.com/OCA/account-financial-reporting/pull/169 -- Usability: better layout of the MIS Report periods settings on small - screens. https://github.com/OCA/account-financial-reporting/pull/167 -- Include the download buttons inside the MIS Builder widget, and - refactor the widget to open the door to analytic filtering in the - previews. https://github.com/OCA/account-financial-reporting/pull/151 -- Add KPI rendering prefixes (so you can print $ in front of the - value). https://github.com/OCA/account-financial-reporting/pull/158 -- Add hooks for analytic filtering. - https://github.com/OCA/account-financial-reporting/pull/128 - https://github.com/OCA/account-financial-reporting/pull/131 +- The copy of a MIS Report Instance now copies period. + https://github.com/OCA/account-financial-reporting/pull/181 +- The copy of a MIS Report Template now copies KPIs and queries. + https://github.com/OCA/account-financial-reporting/pull/177 +- Usability: the default view for MIS Report instances is now the + rendered preview, and the settings are accessible through a gear icon + in the list view and a button in the preview. + https://github.com/OCA/account-financial-reporting/pull/170 +- Display blank cells instead of 0.0 when there is no data. + https://github.com/OCA/account-financial-reporting/pull/169 +- Usability: better layout of the MIS Report periods settings on small + screens. https://github.com/OCA/account-financial-reporting/pull/167 +- Include the download buttons inside the MIS Builder widget, and + refactor the widget to open the door to analytic filtering in the + previews. https://github.com/OCA/account-financial-reporting/pull/151 +- Add KPI rendering prefixes (so you can print $ in front of the value). + https://github.com/OCA/account-financial-reporting/pull/158 +- Add hooks for analytic filtering. + https://github.com/OCA/account-financial-reporting/pull/128 + https://github.com/OCA/account-financial-reporting/pull/131 8.0.0.2.0 --------- @@ -704,35 +700,35 @@ Authors Contributors ------------ -- Stéphane Bidoul -- Laetitia Gangloff -- Adrien Peiffer -- Alexis de Lattre -- Alexandre Fayolle -- Jordi Ballester -- Thomas Binsfeld -- Giovanni Capalbo -- Marco Calcagni -- Sébastien Beau -- Laurent Mignon -- Luc De Meyer -- Benjamin Willig -- Martronic SA -- nicomacr -- Juan Jose Scarafia -- Richard deMeester -- Eric Caudal -- Andrea Stirpe -- Maxence Groine -- Arnaud Pineux -- Ernesto Tejeda -- Pedro M. Baeza -- Alexey Pelykh -- Jairo Llopis (https://www.moduon.team/) -- Dzung Tran -- Hoang Diep -- Miquel Pascual -- Antoni Marroig +- Stéphane Bidoul +- Laetitia Gangloff +- Adrien Peiffer +- Alexis de Lattre +- Alexandre Fayolle +- Jordi Ballester +- Thomas Binsfeld +- Giovanni Capalbo +- Marco Calcagni +- Sébastien Beau +- Laurent Mignon +- Luc De Meyer +- Benjamin Willig +- Martronic SA +- nicomacr +- Juan Jose Scarafia +- Richard deMeester +- Eric Caudal +- Andrea Stirpe +- Maxence Groine +- Arnaud Pineux +- Ernesto Tejeda +- Pedro M. Baeza +- Alexey Pelykh +- Jairo Llopis (https://www.moduon.team/) +- Dzung Tran +- Hoang Diep +- Miquel Pascual +- Antoni Marroig Maintainers ----------- diff --git a/mis_builder_budget/models/fiscial_period.py b/mis_builder_budget/models/fiscial_period.py index 58afa12f3..d6a7c4884 100644 --- a/mis_builder_budget/models/fiscial_period.py +++ b/mis_builder_budget/models/fiscial_period.py @@ -1,22 +1,23 @@ -from odoo import models, fields, api +from odoo import api, fields, models + class AccountFiscalPeriod(models.Model): - _inherit = 'account.fiscal.year' # Adjust based on your needs + _inherit = "account.fiscal.year" # Adjust based on your needs # Selection field to include 'Quarter' period_type = fields.Selection( - [('monthly', 'Monthly'), ('quarterly', 'Quarterly'), ('yearly', 'Yearly')], + [("monthly", "Monthly"), ("quarterly", "Quarterly"), ("yearly", "Yearly")], string="Period Type", - default='monthly', - required=True + default="monthly", + required=True, ) quarter_start_date = fields.Date(string="Quarter Start Date") quarter_end_date = fields.Date(string="Quarter End Date") - @api.onchange('period_type') + @api.onchange("period_type") def _onchange_period_type(self): - if self.period_type == 'quarterly': + if self.period_type == "quarterly": # Auto set the quarter dates (Example: Adjust to your needs) today = fields.Date.today() current_month = today.month diff --git a/mis_builder_budget/views/fiscial_period.xml b/mis_builder_budget/views/fiscial_period.xml index cbdda9d61..40b421ea0 100644 --- a/mis_builder_budget/views/fiscial_period.xml +++ b/mis_builder_budget/views/fiscial_period.xml @@ -1,7 +1,6 @@ - @@ -10,9 +9,15 @@
- - - + + +
From be2d7e58af843fbcc7418453f366b74a8896e05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Wed, 16 Oct 2024 18:26:53 +0200 Subject: [PATCH 03/11] [IMP] update dotfiles --- .copier-answers.yml | 3 ++- .gitignore | 4 ++++ .pre-commit-config.yaml | 32 ++++++++++++++++++++++---------- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index f5f56ef83..4e86a8a24 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,9 +1,10 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.24 +_commit: v1.27 _src_path: git+https://github.com/OCA/oca-addons-repo-template additional_ruff_rules: [] ci: GitHub convert_readme_fragments_to_markdown: true +enable_checklog_odoo: false generate_requirements_txt: true github_check_license: true github_ci_extra_env: {} diff --git a/.gitignore b/.gitignore index 2b045db39..6ec07a054 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,9 @@ var/ *.egg *.eggs +# Windows installers +*.msi + # Debian packages *.deb @@ -33,6 +36,7 @@ var/ # MacOS packages *.dmg +*.pkg # Installer logs pip-log.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b12aaf20..5ad6e3a55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ exclude: | # Files and folders generated by bots, to avoid loops ^setup/|/static/description/index\.html$| # We don't want to mess with tool-generated files - .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -39,7 +39,7 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/sbidoul/whool - rev: v0.5 + rev: v1.2 hooks: - id: whool-init - repo: https://github.com/oca/maintainer-tools @@ -64,25 +64,37 @@ repos: hooks: - id: oca-checks-odoo-module - id: oca-checks-po - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + args: + - --disable=po-pretty-format + - repo: local hooks: - id: prettier name: prettier (with plugin-xml) + entry: prettier + args: + - --write + - --list-different + - --ignore-unknown + types: [text] + files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ + language: node additional_dependencies: - "prettier@2.7.1" - "@prettier/plugin-xml@2.2.0" - args: - - --plugin=@prettier/plugin-xml - files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.24.0 + - repo: local hooks: - id: eslint - verbose: true + name: eslint + entry: eslint args: - --color - --fix + verbose: true + types: [javascript] + language: node + additional_dependencies: + - "eslint@8.24.0" + - "eslint-plugin-jsdoc@" - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: From f616a3efd2a5160eabcd0e746a02eacb0d4c2426 Mon Sep 17 00:00:00 2001 From: collo Date: Mon, 21 Oct 2024 08:11:19 +0300 Subject: [PATCH 04/11] quartely period added to allow users search based on tree and serach views --- odoo | 1 + odoo.conf | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 160000 odoo create mode 100644 odoo.conf diff --git a/odoo b/odoo new file mode 160000 index 000000000..5b2c88de9 --- /dev/null +++ b/odoo @@ -0,0 +1 @@ +Subproject commit 5b2c88de99a7cfe633d756624b2b5fff07534a3a diff --git a/odoo.conf b/odoo.conf new file mode 100644 index 000000000..735a61541 --- /dev/null +++ b/odoo.conf @@ -0,0 +1,9 @@ +[options] +; This is the password that allows database operations: +; admin_passwd = admin +db_host = localhost +db_port = 5432 +db_user = collo +db_password = 12345 +;addons_path = C:\Users\collo\mis-builder\odoo\addons +default_productivity_apps = True From a903d9280db715b3867246e4337cc702241ddb51 Mon Sep 17 00:00:00 2001 From: collo Date: Mon, 21 Oct 2024 08:36:23 +0300 Subject: [PATCH 05/11] quarterly period with views --- odoo | 1 - odoo.conf | 9 --------- 2 files changed, 10 deletions(-) delete mode 160000 odoo delete mode 100644 odoo.conf diff --git a/odoo b/odoo deleted file mode 160000 index 5b2c88de9..000000000 --- a/odoo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b2c88de99a7cfe633d756624b2b5fff07534a3a diff --git a/odoo.conf b/odoo.conf deleted file mode 100644 index 735a61541..000000000 --- a/odoo.conf +++ /dev/null @@ -1,9 +0,0 @@ -[options] -; This is the password that allows database operations: -; admin_passwd = admin -db_host = localhost -db_port = 5432 -db_user = collo -db_password = 12345 -;addons_path = C:\Users\collo\mis-builder\odoo\addons -default_productivity_apps = True From 0ed79a339317950d8935456bb9b912f7b0e814d8 Mon Sep 17 00:00:00 2001 From: collo Date: Mon, 21 Oct 2024 08:53:03 +0300 Subject: [PATCH 06/11] quarterly period --- mis_builder/README.rst | 790 ++++++++++---------- mis_builder_budget/models/fiscial_period.py | 15 +- mis_builder_budget/views/fiscial_period.xml | 13 +- 3 files changed, 410 insertions(+), 408 deletions(-) diff --git a/mis_builder/README.rst b/mis_builder/README.rst index e4f76938e..9a8298b48 100644 --- a/mis_builder/README.rst +++ b/mis_builder/README.rst @@ -46,30 +46,30 @@ Your preferred way to install addons will work with MIS Builder. An easy way to install it with all its dependencies is using pip: -- ``pip install --pre odoo12-addon-mis_builder`` -- then restart Odoo, update the addons list in your database, and - install the MIS Builder application. +- ``pip install --pre odoo12-addon-mis_builder`` +- then restart Odoo, update the addons list in your database, and + install the MIS Builder application. Usage ===== To configure this module, you need to: -- Go to Accounting > Configuration > MIS Reporting > MIS Report - Templates where you can create report templates by defining KPI's. - KPI's constitute the rows of your reports. Such report templates are - time independent. +- Go to Accounting > Configuration > MIS Reporting > MIS Report + Templates where you can create report templates by defining KPI's. + KPI's constitute the rows of your reports. Such report templates are + time independent. |image1| -- Then in Accounting > Reports > MIS Reporting > MIS Reports you can - create report instance by binding the templates to time periods, - hence defining the columns of your reports. +- Then in Accounting > Reports > MIS Reporting > MIS Reports you can + create report instance by binding the templates to time periods, hence + defining the columns of your reports. |image2| -- From the MIS Reports view, you can preview the report, add it to and - Odoo dashboard, and export it to PDF or Excel. +- From the MIS Reports view, you can preview the report, add it to and + Odoo dashboard, and export it to PDF or Excel. |image3| @@ -105,219 +105,216 @@ Changelog **Bugfixes** -- Restore compatibility with python 3.9 - (`#590 `__) +- Restore compatibility with python 3.9 + (`#590 `__) 16.0.5.1.8 (2024-02-08) ----------------------- **Bugfixes** -- Resolve a permission issue when creating report periods with a user - without admin rights. - (`#596 `__) +- Resolve a permission issue when creating report periods with a user + without admin rights. + (`#596 `__) 16.0.5.1.0 (2023-04-04) ----------------------- **Features** -- Improve UX by adding the option to edit the pivot date directly on - the view. +- Improve UX by adding the option to edit the pivot date directly on the + view. 16.0.5.0.0 (2023-04-01) ----------------------- **Features** -- Migration to 16.0 - - - Addition of a generic filter domain on reports and columns. - - Addition of a search bar to the widget. The corresponding search - view is configurable per report. - - Huge improvement of the widget style. This was long overdue. - - Make the MIS Report menu accessible to the Billing Administrator - group (instead of the hidden Show Full Accounting Features), to - align with the access rules and avoid giving a false sense of - security. This also makes the menu discoverable to new users. - - Removal of analytic fetures because the upstream - ``analytic_distribution`` mechanism is not compatible; support may - be introduced in separate module, depending on use cases. - - Abandon the ``mis_report_filters`` context key which had security - implication. It is replaced by a ``mis_analytic_domain`` context - key which is ANDed with other report-defined filters. - (`#472 `__) - - Rename the ``get_filter_descriptions_from_context`` method to - ``get_filter_descriptions``. This method may be overridden to - provide additional subtitles on the PDF or XLS report, - representing user-selected filters. - - The ``hide_analytic_filters`` has been replaced by - ``widget_show_filters``. - - The visibility of the settings button on the widget is now - controlled by a ``show_settings_button``. Before it was visible - only for the ``account_user`` group but this was not flexible - enough. - - The widget configuration settings are now grouped in a dedicated - ``Widget`` tab in the report configuration form. +- Migration to 16.0 + + - Addition of a generic filter domain on reports and columns. + - Addition of a search bar to the widget. The corresponding search + view is configurable per report. + - Huge improvement of the widget style. This was long overdue. + - Make the MIS Report menu accessible to the Billing Administrator + group (instead of the hidden Show Full Accounting Features), to + align with the access rules and avoid giving a false sense of + security. This also makes the menu discoverable to new users. + - Removal of analytic fetures because the upstream + ``analytic_distribution`` mechanism is not compatible; support may + be introduced in separate module, depending on use cases. + - Abandon the ``mis_report_filters`` context key which had security + implication. It is replaced by a ``mis_analytic_domain`` context key + which is ANDed with other report-defined filters. + (`#472 `__) + - Rename the ``get_filter_descriptions_from_context`` method to + ``get_filter_descriptions``. This method may be overridden to + provide additional subtitles on the PDF or XLS report, representing + user-selected filters. + - The ``hide_analytic_filters`` has been replaced by + ``widget_show_filters``. + - The visibility of the settings button on the widget is now + controlled by a ``show_settings_button``. Before it was visible only + for the ``account_user`` group but this was not flexible enough. + - The widget configuration settings are now grouped in a dedicated + ``Widget`` tab in the report configuration form. **Bugfixes** -- Fix access error when previewing or printing report. - (`#415 `__) +- Fix access error when previewing or printing report. + (`#415 `__) 15.0.4.0.5 (2022-07-19) ----------------------- **Bugfixes** -- Support users without timezone. - (`#388 `__) +- Support users without timezone. + (`#388 `__) 15.0.4.0.4 (2022-07-19) ----------------------- **Bugfixes** -- Allow deleting a report that has subreports. - (`#431 `__) +- Allow deleting a report that has subreports. + (`#431 `__) 15.0.4.0.2 (2022-02-16) ----------------------- **Bugfixes** -- Fix access right issue when clicking the "Save" button on a MIS - Report Instance form. - (`#410 `__) +- Fix access right issue when clicking the "Save" button on a MIS Report + Instance form. + (`#410 `__) 14.0.4.0.0 (2022-01-08) ----------------------- **Features** -- Remove various field size limits. - (`#332 `__) +- Remove various field size limits. + (`#332 `__) **Bugfixes** -- Support for the Odoo 13+ multi-company model. In multi-company mode, - several allowed companies can be declared on MIS Report instances, - and the report operates on the intersection of report companies and - companies selected in the user context. - (`#327 `__) - -- The ``get_additional_query_filter`` argument of ``evaluate()`` is now - propagated correctly. - (`#375 `__) - -- Use the ``parent_state`` field of ``account.move.line`` to filter - entries in ``posted`` and ``draft`` state only. Before, when - reporting in draft mode, all entries were used (i.e. there was no - filter), and that started including the cancelled entries/invoices in - Odoo 13.+. - - This change also contains a **breaking change** in the internal API. - For quite a while the ``target_move argument`` of AEP and other - methods was not used by MIS Builder itself and was kept for backward - compatibility. To avoid rippling effects of the necessary change to - use ``parent_state``, we now remove this argument. - (`#377 `__) +- Support for the Odoo 13+ multi-company model. In multi-company mode, + several allowed companies can be declared on MIS Report instances, and + the report operates on the intersection of report companies and + companies selected in the user context. + (`#327 `__) + +- The ``get_additional_query_filter`` argument of ``evaluate()`` is now + propagated correctly. + (`#375 `__) + +- Use the ``parent_state`` field of ``account.move.line`` to filter + entries in ``posted`` and ``draft`` state only. Before, when reporting + in draft mode, all entries were used (i.e. there was no filter), and + that started including the cancelled entries/invoices in Odoo 13.+. + + This change also contains a **breaking change** in the internal API. + For quite a while the ``target_move argument`` of AEP and other + methods was not used by MIS Builder itself and was kept for backward + compatibility. To avoid rippling effects of the necessary change to + use ``parent_state``, we now remove this argument. + (`#377 `__) 14.0.3.6.7 (2021-06-02) ----------------------- **Bugfixes** -- When on a MIS Report Instance, if you wanted to generate a new line - of type comparison, you couldn't currently select any existing period - to compare. This happened because the field domain was searching in a - NewId context, thus not finding a correct period. Changing the domain - and making it use a computed field with a search for the \_origin - record solves the problem. - (`#361 `__) +- When on a MIS Report Instance, if you wanted to generate a new line of + type comparison, you couldn't currently select any existing period to + compare. This happened because the field domain was searching in a + NewId context, thus not finding a correct period. Changing the domain + and making it use a computed field with a search for the \_origin + record solves the problem. + (`#361 `__) 14.0.3.6.6 (2021-04-23) ----------------------- **Bugfixes** -- Fix drilldown action name when the account model has been customized. - (`#350 `__) +- Fix drilldown action name when the account model has been customized. + (`#350 `__) 14.0.3.6.5 (2021-04-23) ----------------------- **Bugfixes** -- While duplicating a MIS report instance, comparison columns are - ignored because they would raise an error otherwise, as they keep the - old source_cmpcol_from_id and source_cmpcol_to_id from the original - record. (`#343 `__) +- While duplicating a MIS report instance, comparison columns are + ignored because they would raise an error otherwise, as they keep the + old source_cmpcol_from_id and source_cmpcol_to_id from the original + record. (`#343 `__) 14.0.3.6.4 (2021-04-06) ----------------------- **Features** -- The drilldown action name displayed on the breadcrumb has been - revised. The kpi description and the account ``display_name`` are - shown instead of the kpi's technical definition. - (`#304 `__) -- Add analytic group filters on report instance, periods and in the - interactive view. - (`#320 `__) +- The drilldown action name displayed on the breadcrumb has been + revised. The kpi description and the account ``display_name`` are + shown instead of the kpi's technical definition. + (`#304 `__) +- Add analytic group filters on report instance, periods and in the + interactive view. + (`#320 `__) 13.0.3.6.3 (2020-08-28) ----------------------- **Bugfixes** -- Having a "Compare columns" added on a KPI with an associated style - using a Factor/Divider did lead to the said factor being applied on - the percentages when exporting to XLSX. - (`#300 `__) +- Having a "Compare columns" added on a KPI with an associated style + using a Factor/Divider did lead to the said factor being applied on + the percentages when exporting to XLSX. + (`#300 `__) **Misc** -- `#280 `__, - `#296 `__ +- `#280 `__, + `#296 `__ 13.0.3.6.2 (2020-04-22) ----------------------- **Bugfixes** -- The "Settings" button is now displayed for users with the "Show full - accounting features" right when previewing a report. - (`#281 `__) +- The "Settings" button is now displayed for users with the "Show full + accounting features" right when previewing a report. + (`#281 `__) 13.0.3.6.1 (2020-04-22) ----------------------- **Bugfixes** -- Fix ``TypeError: 'module' object is not iterable`` when using budgets - by account. - (`#276 `__) +- Fix ``TypeError: 'module' object is not iterable`` when using budgets + by account. (`#276 `__) 13.0.3.6.0 (2020-03-28) ----------------------- **Features** -- Add column-level filters on analytic account and analytic tags. These - filters are combined with a AND with the report-level filters and - cannot be modified in the preview. - (`#138 `__) -- Access to KPI from other reports in KPI expressions, aka subreports. - In a report template, one can list named "subreports" (other report - templates). When evaluating expressions, you can access KPI's of - subreports with a dot-prefix notation. Example: you can define a MIS - Report for a "Balance Sheet", and then have another MIS Report - "Balance Sheet Ratios" that fetches KPI's from "Balance Sheet" to - create new KPI's for the ratios (e.g. balance_sheet.current_assets / - balance_sheet.total_assets). - (`#155 `__) +- Add column-level filters on analytic account and analytic tags. These + filters are combined with a AND with the report-level filters and + cannot be modified in the preview. + (`#138 `__) +- Access to KPI from other reports in KPI expressions, aka subreports. + In a report template, one can list named "subreports" (other report + templates). When evaluating expressions, you can access KPI's of + subreports with a dot-prefix notation. Example: you can define a MIS + Report for a "Balance Sheet", and then have another MIS Report + "Balance Sheet Ratios" that fetches KPI's from "Balance Sheet" to + create new KPI's for the ratios (e.g. balance_sheet.current_assets / + balance_sheet.total_assets). + (`#155 `__) 13.0.3.5.0 (2020-01-??) ----------------------- @@ -329,65 +326,65 @@ Migration to odoo 13.0. **Features** -- The ``account_id`` field of the model selected in 'Move lines source' - in the Period form can now be a Many2one relationship with any model - that has a ``code`` field (not only with ``account.account`` model). - To this end, the model to be used for Actuals move lines can be - configured on the report template. It can be something else than move - lines and the only constraint is that its ``account_id`` field has a - ``code`` field. - (`#149 `__) -- Add ``source_aml_model_name`` field so extension modules providing - alternative data sources can more easily customize their data source. - (`#214 `__) -- Support analytic tag filters in the backend view and preview widget. - Selecting several tags in the filter means filtering on move lines - which have *all* these tags set. This is to support the most common - use case of using tags for different dimensions. The filter also - makes a AND with the analytic account filter. - (`#228 `__) -- Display company in account details rows in multi-company mode. - (`#242 `__) +- The ``account_id`` field of the model selected in 'Move lines source' + in the Period form can now be a Many2one relationship with any model + that has a ``code`` field (not only with ``account.account`` model). + To this end, the model to be used for Actuals move lines can be + configured on the report template. It can be something else than move + lines and the only constraint is that its ``account_id`` field has a + ``code`` field. + (`#149 `__) +- Add ``source_aml_model_name`` field so extension modules providing + alternative data sources can more easily customize their data source. + (`#214 `__) +- Support analytic tag filters in the backend view and preview widget. + Selecting several tags in the filter means filtering on move lines + which have *all* these tags set. This is to support the most common + use case of using tags for different dimensions. The filter also makes + a AND with the analytic account filter. + (`#228 `__) +- Display company in account details rows in multi-company mode. + (`#242 `__) **Bugfixes** -- Propagate context to xlsx report, so the analytic account filter - works when exporting to xslx too. This also requires a fix to - ``report_xlsx`` (see - https://github.com/OCA/reporting-engine/pull/259). - (`#178 `__) -- In columns of type Sum, preserve styles for KPIs that are not - summable (eg percentage values). Before this fix, such cells were - displayed without style. - (`#219 `__) -- In Excel export, keep the percentage point suffix (pp) instead of - replacing it with %. - (`#220 `__) +- Propagate context to xlsx report, so the analytic account filter works + when exporting to xslx too. This also requires a fix to + ``report_xlsx`` (see + https://github.com/OCA/reporting-engine/pull/259). + (`#178 `__) +- In columns of type Sum, preserve styles for KPIs that are not summable + (eg percentage values). Before this fix, such cells were displayed + without style. + (`#219 `__) +- In Excel export, keep the percentage point suffix (pp) instead of + replacing it with %. + (`#220 `__) 12.0.3.4.0 (2019-07-09) ----------------------- **Features** -- New year-to-date mode for defining periods. - (`#165 `__) -- Add support for move lines with negative debit or credit. Used by - some for storno accounting. Not officially supported. - (`#175 `__) -- In Excel export, use a number format with thousands separator. The - specific separator used depends on the Excel configuration (eg - regional settings). - (`#190 `__) -- Add generation date/time at the end of the XLS export. - (`#191 `__) -- In presence of Sub KPIs, report more informative user errors when - non-multi expressions yield tuples of incorrect lenght. - (`#196 `__) +- New year-to-date mode for defining periods. + (`#165 `__) +- Add support for move lines with negative debit or credit. Used by some + for storno accounting. Not officially supported. + (`#175 `__) +- In Excel export, use a number format with thousands separator. The + specific separator used depends on the Excel configuration (eg + regional settings). + (`#190 `__) +- Add generation date/time at the end of the XLS export. + (`#191 `__) +- In presence of Sub KPIs, report more informative user errors when + non-multi expressions yield tuples of incorrect lenght. + (`#196 `__) **Bugfixes** -- Fix rendering of percentage types in Excel export. - (`#192 `__) +- Fix rendering of percentage types in Excel export. + (`#192 `__) 12.0.3.3.0 (2019-01-26) ----------------------- @@ -398,44 +395,44 @@ Migration to odoo 13.0. this requires an update to the JS widget that proved difficult to implement so far. Help welcome.* -- Analytic account filters. On a report, an analytic account can be - selected for filtering. The filter will be applied to move lines - queries. A filter box is also available in the widget to let the user - select the analytic account during report preview. - (`#15 `__) -- Control visibility of analytic filter combo box in widget. This is - useful to hide the analytic filters on reports where they do not make - sense, such as balance sheet reports. - (`#42 `__) -- Display analytic filters in the header of exported pdf and xls. - (`#44 `__) -- Replace the last old gtk icons with fontawesome icons. - (`#104 `__) -- Use active_test=False in AEP queries. This is important for reports - involving inactive taxes. This should not negatively effect existing - reports, because an accounting report must take into account all - existing move lines even if they reference objects such as taxes, - journals, accounts types that have been deactivated since their - creation. (`#107 `__) -- int(), float() and round() support for AccountingNone. - (`#108 `__) -- Allow referencing subkpis by name by writing kpi_x.subkpi_y in - expressions. - (`#114 `__) -- Add an option to control the display of the start/end dates in the - column headers. It is disabled by default (this is a change compared - to previous behaviour). - (`#118 `__) -- Add evaluate method to mis.report. This is a simplified method to - evaluate kpis of a report over a time period, without creating a - mis.report.instance. - (`#123 `__) +- Analytic account filters. On a report, an analytic account can be + selected for filtering. The filter will be applied to move lines + queries. A filter box is also available in the widget to let the user + select the analytic account during report preview. + (`#15 `__) +- Control visibility of analytic filter combo box in widget. This is + useful to hide the analytic filters on reports where they do not make + sense, such as balance sheet reports. + (`#42 `__) +- Display analytic filters in the header of exported pdf and xls. + (`#44 `__) +- Replace the last old gtk icons with fontawesome icons. + (`#104 `__) +- Use active_test=False in AEP queries. This is important for reports + involving inactive taxes. This should not negatively effect existing + reports, because an accounting report must take into account all + existing move lines even if they reference objects such as taxes, + journals, accounts types that have been deactivated since their + creation. (`#107 `__) +- int(), float() and round() support for AccountingNone. + (`#108 `__) +- Allow referencing subkpis by name by writing kpi_x.subkpi_y in + expressions. + (`#114 `__) +- Add an option to control the display of the start/end dates in the + column headers. It is disabled by default (this is a change compared + to previous behaviour). + (`#118 `__) +- Add evaluate method to mis.report. This is a simplified method to + evaluate kpis of a report over a time period, without creating a + mis.report.instance. + (`#123 `__) **Bugs** -- In the style form, hide the "Hide always" checkbox when "Hide always - inherit" is checked, as for all other syle elements. - (`#121 `__) +- In the style form, hide the "Hide always" checkbox when "Hide always + inherit" is checked, as for all other syle elements. + (`#121 `__) **Upgrading from 3.2 (breaking changes)** @@ -446,32 +443,32 @@ analytic filters, the underlying model must now have an 11.0.3.2.2 (2018-06-30) ----------------------- -- [FIX] Fix bug in company_default_get call returning id instead of - recordset (`#103 `__) -- [IMP] add "hide always" style property to make hidden KPI's (for KPI - that serve as basis for other formulas, but do not need to be - displayed). (`#46 `__) +- [FIX] Fix bug in company_default_get call returning id instead of + recordset (`#103 `__) +- [IMP] add "hide always" style property to make hidden KPI's (for KPI + that serve as basis for other formulas, but do not need to be + displayed). (`#46 `__) 11.0.3.2.1 (2018-05-29) ----------------------- -- [FIX] Missing comparison operator for AccountingNone leading to - errors in pbal computations - (`#93 `__) +- [FIX] Missing comparison operator for AccountingNone leading to errors + in pbal computations + (`#93 `__) 10.0.3.2.0 (2018-05-02) ----------------------- -- [FIX] make subkpi ordering deterministic - (`#71 `__) -- [ADD] report instance level option to disable account expansion, - enabling the creation of detailed templates while deferring the - decision of rendering the details or not to the report instance - (`#74 `__) -- [ADD] pbal and nbal accounting expressions, to sum positive and - negative balances respectively (ie ignoring accounts with negative, - resp positive balances) - (`#86 `__) +- [FIX] make subkpi ordering deterministic + (`#71 `__) +- [ADD] report instance level option to disable account expansion, + enabling the creation of detailed templates while deferring the + decision of rendering the details or not to the report instance + (`#74 `__) +- [ADD] pbal and nbal accounting expressions, to sum positive and + negative balances respectively (ie ignoring accounts with negative, + resp positive balances) + (`#86 `__) 11.0.3.1.2 (2018-02-04) ----------------------- @@ -484,125 +481,125 @@ Migration to Odoo 11. No new feature. New features: -- [ADD] month and year relative periods, easier to use than date ranges - for the most common case. - (`#2 `__) -- [ADD] multi-company consolidation support, with currency conversion - (the conversion rate date is the end of the reporting period) - (`#7 `__, - `#3 `__) -- [ADD] provide ref, datetime, dateutil, time, user in the evaluation - context of move line domains; among other things, this allows using - references to xml ids (such as account types or tax tags) when - querying move lines - (`#26 `__). -- [ADD] extended account selectors: you can now select accounts using - any domain on account.account, not only account codes - ``balp[('account_type', '=', 'asset_receivable')]`` - (`#4 `__). -- [IMP] in the report instance configuration form, the filters are now - grouped in a notebook page, this improves readability and - extensibility - (`#39 `__). +- [ADD] month and year relative periods, easier to use than date ranges + for the most common case. + (`#2 `__) +- [ADD] multi-company consolidation support, with currency conversion + (the conversion rate date is the end of the reporting period) + (`#7 `__, + `#3 `__) +- [ADD] provide ref, datetime, dateutil, time, user in the evaluation + context of move line domains; among other things, this allows using + references to xml ids (such as account types or tax tags) when + querying move lines + (`#26 `__). +- [ADD] extended account selectors: you can now select accounts using + any domain on account.account, not only account codes + ``balp[('account_type', '=', 'asset_receivable')]`` + (`#4 `__). +- [IMP] in the report instance configuration form, the filters are now + grouped in a notebook page, this improves readability and + extensibility + (`#39 `__). Bug fixes: -- [FIX] fix error when saving periods in comparison mode on newly - created (not yet saved) report instances. - `#50 `__ -- [FIX] improve display of Base Date report instance view. - `#51 `__ +- [FIX] fix error when saving periods in comparison mode on newly + created (not yet saved) report instances. + `#50 `__ +- [FIX] improve display of Base Date report instance view. + `#51 `__ Upgrading from 3.0 (breaking changes): -- Alternative move line data sources must have a company_id field. +- Alternative move line data sources must have a company_id field. 10.0.3.0.4 (2017-10-14) ----------------------- Bug fix: -- [FIX] issue with initial balance rounding. - `#30 `__ +- [FIX] issue with initial balance rounding. + `#30 `__ 10.0.3.0.3 (2017-10-03) ----------------------- Bug fix: -- [FIX] fix error saving KPI on newly created reports. - `#18 `__ +- [FIX] fix error saving KPI on newly created reports. + `#18 `__ 10.0.3.0.2 (2017-10-01) ----------------------- New features: -- [ADD] Alternative move line source per report column. This makes mis - buidler accounting expressions work on any model that has debit, - credit, account_id and date fields. Provided you can expose, say, - committed purchases, or your budget as a view with debit, credit and - account_id, this opens up a lot of possibilities -- [ADD] Comparison column source (more flexible than the previous, now - deprecated, comparison mechanism). CAVEAT: there is no automated - migration to the new mechanism. -- [ADD] Sum column source, to create columns that add/subtract other - columns. -- [ADD] mis.kpi.data abstract model as a basis for manual KPI values - supporting automatic ajustment to the reporting time period (the - basis for budget item, but could also server other purposes, such as - manually entering some KPI values, such as number of employee) -- [ADD] mis_builder_budget module providing a new budget data source -- [ADD] new "hide empty" style property -- [IMP] new AEP method to get accounts involved in an expression (this - is useful to find which KPI relate to a given P&L acount, to - implement budget control) -- [IMP] many UI improvements -- [IMP] many code style improvements and some refactoring -- [IMP] add the column date_from, date_to in expression evaluation - context, as well as time, datetime and dateutil modules +- [ADD] Alternative move line source per report column. This makes mis + buidler accounting expressions work on any model that has debit, + credit, account_id and date fields. Provided you can expose, say, + committed purchases, or your budget as a view with debit, credit and + account_id, this opens up a lot of possibilities +- [ADD] Comparison column source (more flexible than the previous, now + deprecated, comparison mechanism). CAVEAT: there is no automated + migration to the new mechanism. +- [ADD] Sum column source, to create columns that add/subtract other + columns. +- [ADD] mis.kpi.data abstract model as a basis for manual KPI values + supporting automatic ajustment to the reporting time period (the basis + for budget item, but could also server other purposes, such as + manually entering some KPI values, such as number of employee) +- [ADD] mis_builder_budget module providing a new budget data source +- [ADD] new "hide empty" style property +- [IMP] new AEP method to get accounts involved in an expression (this + is useful to find which KPI relate to a given P&L acount, to implement + budget control) +- [IMP] many UI improvements +- [IMP] many code style improvements and some refactoring +- [IMP] add the column date_from, date_to in expression evaluation + context, as well as time, datetime and dateutil modules Main bug fixes: -- [FIX] deletion of templates and reports (cascade and retricts) - (https://github.com/OCA/account-financial-reporting/issues/281) -- [FIX] copy of reports - (https://github.com/OCA/account-financial-reporting/issues/282) -- [FIX] better error message when periods have wrong/missing dates - (https://github.com/OCA/account-financial-reporting/issues/283) -- [FIX] xlsx export of string types KPI - (https://github.com/OCA/account-financial-reporting/issues/285) -- [FIX] sorting of detail by account -- [FIX] computation bug in detail by account when multiple accounting - expressions were used in a KPI -- [FIX] permission issue when adding report to dashboard with non admin - user +- [FIX] deletion of templates and reports (cascade and retricts) + (https://github.com/OCA/account-financial-reporting/issues/281) +- [FIX] copy of reports + (https://github.com/OCA/account-financial-reporting/issues/282) +- [FIX] better error message when periods have wrong/missing dates + (https://github.com/OCA/account-financial-reporting/issues/283) +- [FIX] xlsx export of string types KPI + (https://github.com/OCA/account-financial-reporting/issues/285) +- [FIX] sorting of detail by account +- [FIX] computation bug in detail by account when multiple accounting + expressions were used in a KPI +- [FIX] permission issue when adding report to dashboard with non admin + user 10.0.2.0.3 (unreleased) ----------------------- -- [IMP] more robust behaviour in presence of missing expressions -- [FIX] indent style -- [FIX] local variable 'ctx' referenced before assignment when - generating reports with no objects -- [IMP] use fontawesome icons -- [MIG] migrate to 10.0 -- [FIX] unicode error when exporting to Excel -- [IMP] provide full access to mis builder style for group Adviser. +- [IMP] more robust behaviour in presence of missing expressions +- [FIX] indent style +- [FIX] local variable 'ctx' referenced before assignment when + generating reports with no objects +- [IMP] use fontawesome icons +- [MIG] migrate to 10.0 +- [FIX] unicode error when exporting to Excel +- [IMP] provide full access to mis builder style for group Adviser. 9.0.2.0.2 (2016-09-27) ---------------------- -- [IMP] Add refresh button in mis report preview. -- [IMP] Widget code changes to allow to add fields in the widget more - easily. +- [IMP] Add refresh button in mis report preview. +- [IMP] Widget code changes to allow to add fields in the widget more + easily. 9.0.2.0.1 (2016-05-26) ---------------------- -- [IMP] remove unused argument in declare_and_compute_period() for a - cleaner API. This is a breaking API changing merged in urgency before - it is used by other modules. +- [IMP] remove unused argument in declare_and_compute_period() for a + cleaner API. This is a breaking API changing merged in urgency before + it is used by other modules. 9.0.2.0.0 (2016-05-24) ---------------------- @@ -611,72 +608,71 @@ Part of the work for this release has been done at the Sorrento sprint April 26-29, 2016. The rest (ie a major refactoring) has been done in the weeks after. -- [IMP] hide button box in edit mode on the report instance settings - form -- [FIX] Fix sum aggregation of non-stored fields - (https://github.com/OCA/account-financial-reporting/issues/178) -- [IMP] There is now a default style at the report level -- [CHG] Number display properties (rounding, prefix, suffix, factor) - are now defined in styles -- [CHG] Percentage difference are rounded to 1 digit instead of the - kpi's rounding, as the KPI rounding does not make sense in this case -- [CHG] The divider suffix (k, M, etc) is not inserted automatically - anymore because it is inconsistent when working with prefixes; you - need to add it manually in the suffix -- [IMP] AccountingExpressionProcessor now supports 'balu' expressions - to obtain the unallocated profit/loss of previous fiscal years; - get_unallocated_pl is the corresponding convenience method -- [IMP] AccountingExpressionProcessor now has easy methods to obtain - balances by account: get_balances_initial, get_balances_end, - get_balances_variation -- [IMP] there is now an auto-expand feature to automatically display a - detail by account for selected kpis -- [IMP] the kpi and period lists are now manipulated through forms - instead of directly in the tree views -- [IMP] it is now possible to create a report through a wizard, such - reports are deemed temporary and available through a "Last Reports - Generated" menu, they are garbaged collected automatically, unless - saved permanently, which can be done using a Save button -- [IMP] there is now a beginner mode to configure simple reports with - only one period -- [IMP] it is now easier to configure periods with fixed start/end - dates -- [IMP] the new sub-kpi mechanism allows the creation of columns with - multiple values, or columns with different values -- [IMP] thanks to the new style model, the Excel export is now styled -- [IMP] a new style model is now used to centralize style configuration -- [FIX] use =like instead of like to search for accounts, because the % - are added by the user in the expressions -- [FIX] Correctly compute the initial balance of income and expense - account based on the start of the fiscal year -- [IMP] Support date ranges (from OCA/server-tools/date_range) as a - more flexible alternative to fiscal periods -- v9 migration: fiscal periods are removed, account charts are removed, - consolidation accounts have been removed +- [IMP] hide button box in edit mode on the report instance settings + form +- [FIX] Fix sum aggregation of non-stored fields + (https://github.com/OCA/account-financial-reporting/issues/178) +- [IMP] There is now a default style at the report level +- [CHG] Number display properties (rounding, prefix, suffix, factor) are + now defined in styles +- [CHG] Percentage difference are rounded to 1 digit instead of the + kpi's rounding, as the KPI rounding does not make sense in this case +- [CHG] The divider suffix (k, M, etc) is not inserted automatically + anymore because it is inconsistent when working with prefixes; you + need to add it manually in the suffix +- [IMP] AccountingExpressionProcessor now supports 'balu' expressions to + obtain the unallocated profit/loss of previous fiscal years; + get_unallocated_pl is the corresponding convenience method +- [IMP] AccountingExpressionProcessor now has easy methods to obtain + balances by account: get_balances_initial, get_balances_end, + get_balances_variation +- [IMP] there is now an auto-expand feature to automatically display a + detail by account for selected kpis +- [IMP] the kpi and period lists are now manipulated through forms + instead of directly in the tree views +- [IMP] it is now possible to create a report through a wizard, such + reports are deemed temporary and available through a "Last Reports + Generated" menu, they are garbaged collected automatically, unless + saved permanently, which can be done using a Save button +- [IMP] there is now a beginner mode to configure simple reports with + only one period +- [IMP] it is now easier to configure periods with fixed start/end dates +- [IMP] the new sub-kpi mechanism allows the creation of columns with + multiple values, or columns with different values +- [IMP] thanks to the new style model, the Excel export is now styled +- [IMP] a new style model is now used to centralize style configuration +- [FIX] use =like instead of like to search for accounts, because the % + are added by the user in the expressions +- [FIX] Correctly compute the initial balance of income and expense + account based on the start of the fiscal year +- [IMP] Support date ranges (from OCA/server-tools/date_range) as a more + flexible alternative to fiscal periods +- v9 migration: fiscal periods are removed, account charts are removed, + consolidation accounts have been removed 8.0.1.0.0 (2016-04-27) ---------------------- -- The copy of a MIS Report Instance now copies period. - https://github.com/OCA/account-financial-reporting/pull/181 -- The copy of a MIS Report Template now copies KPIs and queries. - https://github.com/OCA/account-financial-reporting/pull/177 -- Usability: the default view for MIS Report instances is now the - rendered preview, and the settings are accessible through a gear icon - in the list view and a button in the preview. - https://github.com/OCA/account-financial-reporting/pull/170 -- Display blank cells instead of 0.0 when there is no data. - https://github.com/OCA/account-financial-reporting/pull/169 -- Usability: better layout of the MIS Report periods settings on small - screens. https://github.com/OCA/account-financial-reporting/pull/167 -- Include the download buttons inside the MIS Builder widget, and - refactor the widget to open the door to analytic filtering in the - previews. https://github.com/OCA/account-financial-reporting/pull/151 -- Add KPI rendering prefixes (so you can print $ in front of the - value). https://github.com/OCA/account-financial-reporting/pull/158 -- Add hooks for analytic filtering. - https://github.com/OCA/account-financial-reporting/pull/128 - https://github.com/OCA/account-financial-reporting/pull/131 +- The copy of a MIS Report Instance now copies period. + https://github.com/OCA/account-financial-reporting/pull/181 +- The copy of a MIS Report Template now copies KPIs and queries. + https://github.com/OCA/account-financial-reporting/pull/177 +- Usability: the default view for MIS Report instances is now the + rendered preview, and the settings are accessible through a gear icon + in the list view and a button in the preview. + https://github.com/OCA/account-financial-reporting/pull/170 +- Display blank cells instead of 0.0 when there is no data. + https://github.com/OCA/account-financial-reporting/pull/169 +- Usability: better layout of the MIS Report periods settings on small + screens. https://github.com/OCA/account-financial-reporting/pull/167 +- Include the download buttons inside the MIS Builder widget, and + refactor the widget to open the door to analytic filtering in the + previews. https://github.com/OCA/account-financial-reporting/pull/151 +- Add KPI rendering prefixes (so you can print $ in front of the value). + https://github.com/OCA/account-financial-reporting/pull/158 +- Add hooks for analytic filtering. + https://github.com/OCA/account-financial-reporting/pull/128 + https://github.com/OCA/account-financial-reporting/pull/131 8.0.0.2.0 --------- @@ -704,35 +700,35 @@ Authors Contributors ------------ -- Stéphane Bidoul -- Laetitia Gangloff -- Adrien Peiffer -- Alexis de Lattre -- Alexandre Fayolle -- Jordi Ballester -- Thomas Binsfeld -- Giovanni Capalbo -- Marco Calcagni -- Sébastien Beau -- Laurent Mignon -- Luc De Meyer -- Benjamin Willig -- Martronic SA -- nicomacr -- Juan Jose Scarafia -- Richard deMeester -- Eric Caudal -- Andrea Stirpe -- Maxence Groine -- Arnaud Pineux -- Ernesto Tejeda -- Pedro M. Baeza -- Alexey Pelykh -- Jairo Llopis (https://www.moduon.team/) -- Dzung Tran -- Hoang Diep -- Miquel Pascual -- Antoni Marroig +- Stéphane Bidoul +- Laetitia Gangloff +- Adrien Peiffer +- Alexis de Lattre +- Alexandre Fayolle +- Jordi Ballester +- Thomas Binsfeld +- Giovanni Capalbo +- Marco Calcagni +- Sébastien Beau +- Laurent Mignon +- Luc De Meyer +- Benjamin Willig +- Martronic SA +- nicomacr +- Juan Jose Scarafia +- Richard deMeester +- Eric Caudal +- Andrea Stirpe +- Maxence Groine +- Arnaud Pineux +- Ernesto Tejeda +- Pedro M. Baeza +- Alexey Pelykh +- Jairo Llopis (https://www.moduon.team/) +- Dzung Tran +- Hoang Diep +- Miquel Pascual +- Antoni Marroig Maintainers ----------- diff --git a/mis_builder_budget/models/fiscial_period.py b/mis_builder_budget/models/fiscial_period.py index 58afa12f3..d6a7c4884 100644 --- a/mis_builder_budget/models/fiscial_period.py +++ b/mis_builder_budget/models/fiscial_period.py @@ -1,22 +1,23 @@ -from odoo import models, fields, api +from odoo import api, fields, models + class AccountFiscalPeriod(models.Model): - _inherit = 'account.fiscal.year' # Adjust based on your needs + _inherit = "account.fiscal.year" # Adjust based on your needs # Selection field to include 'Quarter' period_type = fields.Selection( - [('monthly', 'Monthly'), ('quarterly', 'Quarterly'), ('yearly', 'Yearly')], + [("monthly", "Monthly"), ("quarterly", "Quarterly"), ("yearly", "Yearly")], string="Period Type", - default='monthly', - required=True + default="monthly", + required=True, ) quarter_start_date = fields.Date(string="Quarter Start Date") quarter_end_date = fields.Date(string="Quarter End Date") - @api.onchange('period_type') + @api.onchange("period_type") def _onchange_period_type(self): - if self.period_type == 'quarterly': + if self.period_type == "quarterly": # Auto set the quarter dates (Example: Adjust to your needs) today = fields.Date.today() current_month = today.month diff --git a/mis_builder_budget/views/fiscial_period.xml b/mis_builder_budget/views/fiscial_period.xml index cbdda9d61..40b421ea0 100644 --- a/mis_builder_budget/views/fiscial_period.xml +++ b/mis_builder_budget/views/fiscial_period.xml @@ -1,7 +1,6 @@ - @@ -10,9 +9,15 @@
- - - + + +
From 033f6cd24432552acf29ebf0efd73f57ed9d33d5 Mon Sep 17 00:00:00 2001 From: collo Date: Wed, 23 Oct 2024 08:26:26 +0300 Subject: [PATCH 07/11] pre-commit-hooks --- .pre-commit-config.yaml | 6 ++ git-diagnostics-2024-10-23-0823.zip | Bin 0 -> 970 bytes mis_builder_budget/__manifest__.py | 1 - mis_builder_budget/models/__init__.py | 1 - mis_builder_budget/models/fiscial_period.py | 35 ----------- .../models/mis_budget_abstract.py | 33 ++++++++-- mis_builder_budget/views/fiscial_period.xml | 25 -------- .../views/mis_budget_by_account.xml | 59 +++++++++++------- odoo-pre-commit-hooks | 1 + 9 files changed, 71 insertions(+), 90 deletions(-) create mode 100644 git-diagnostics-2024-10-23-0823.zip delete mode 100644 mis_builder_budget/models/fiscial_period.py delete mode 100644 mis_builder_budget/views/fiscial_period.xml create mode 160000 odoo-pre-commit-hooks diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b12aaf20..d2201549d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -123,3 +123,9 @@ repos: - id: pylint_odoo args: - --rcfile=.pylintrc-mandatory + - repo: https://github.com/OCA/odoo-pre-commit-hooks + rev: v0.0.33 + hooks: + - id: oca-checks-odoo-module + - id: oca-checks-po + args: [ "--fix" ] diff --git a/git-diagnostics-2024-10-23-0823.zip b/git-diagnostics-2024-10-23-0823.zip new file mode 100644 index 0000000000000000000000000000000000000000..8b5ec16b8baaec4f265e40a4f202c7c4fc6cf69c GIT binary patch literal 970 zcmWIWW@h1HU|`^2c;plwIk&&kO_7m-p%IAr88{hIG85DD@{3C{lZ*9o^3y{@SQ!{C zJ0#Lg15W21RuI_pS+x2z=buA;hjo3I#%YCST`6v1v|gRGfk8cY-@b@ke{1ct=gyov z8J!*CWZvjzX(=zPh8st|H(zVUfIO;Z=UJUXWkjccg-PYiP41YJE_0)vai}^XIC6l|HK@C60D!E z)E>zP2C@<~SPK%9vx{|e@{<#D^hzp9;K4feoFm^M1%cLwwf+ZL*UW8XJhoO{^Kil{ zPeZ4kqBknPO zay<4e`I3L?UZz92byE0{h7+y&&;XKLwHNqm{;Q@!_?kkF4JtUG2ZA_QBo#@^!dza@4`+}zp zU*6yN$FbO`Eup5{(Dv~qre*y$uN;r_h6}{-DpociZls`aIaEE_@H!B-REi({a0n!hEK4f4303|7D A=Kufz literal 0 HcmV?d00001 diff --git a/mis_builder_budget/__manifest__.py b/mis_builder_budget/__manifest__.py index 72b02208b..e08f57354 100644 --- a/mis_builder_budget/__manifest__.py +++ b/mis_builder_budget/__manifest__.py @@ -20,7 +20,6 @@ "views/mis_budget_by_account_item.xml", "security/mis_budget_by_account.xml", "views/mis_budget_by_account.xml", - "views/fiscial_period.xml", ], "installable": True, "development_status": "Production/Stable", diff --git a/mis_builder_budget/models/__init__.py b/mis_builder_budget/models/__init__.py index 0a742fc48..3e2aa44d0 100644 --- a/mis_builder_budget/models/__init__.py +++ b/mis_builder_budget/models/__init__.py @@ -8,4 +8,3 @@ from . import mis_report_instance from . import mis_report_instance_period from . import mis_report_kpi_expression -from . import fiscial_period diff --git a/mis_builder_budget/models/fiscial_period.py b/mis_builder_budget/models/fiscial_period.py deleted file mode 100644 index d6a7c4884..000000000 --- a/mis_builder_budget/models/fiscial_period.py +++ /dev/null @@ -1,35 +0,0 @@ -from odoo import api, fields, models - - -class AccountFiscalPeriod(models.Model): - _inherit = "account.fiscal.year" # Adjust based on your needs - - # Selection field to include 'Quarter' - period_type = fields.Selection( - [("monthly", "Monthly"), ("quarterly", "Quarterly"), ("yearly", "Yearly")], - string="Period Type", - default="monthly", - required=True, - ) - - quarter_start_date = fields.Date(string="Quarter Start Date") - quarter_end_date = fields.Date(string="Quarter End Date") - - @api.onchange("period_type") - def _onchange_period_type(self): - if self.period_type == "quarterly": - # Auto set the quarter dates (Example: Adjust to your needs) - today = fields.Date.today() - current_month = today.month - if current_month in [1, 2, 3]: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-01-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-03-31") - elif current_month in [4, 5, 6]: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-04-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-06-30") - elif current_month in [7, 8, 9]: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-07-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-09-30") - else: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-10-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-12-31") diff --git a/mis_builder_budget/models/mis_budget_abstract.py b/mis_builder_budget/models/mis_budget_abstract.py index 1a8106b15..de2fa9c49 100644 --- a/mis_builder_budget/models/mis_budget_abstract.py +++ b/mis_builder_budget/models/mis_budget_abstract.py @@ -1,8 +1,5 @@ -# Copyright 2017-2020 ACSONE SA/NV -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - from odoo import _, api, fields, models - +from datetime import datetime class MisBudgetAbstract(models.AbstractModel): _name = "mis.budget.abstract" @@ -25,6 +22,18 @@ class MisBudgetAbstract(models.AbstractModel): string="Company", default=lambda self: self.env.company, ) + quarter = fields.Selection( + [ + ("q1", "Q1 (January - March)"), + ("q2", "Q2 (April - June)"), + ("q3", "Q3 (July - September)"), + ("q4", "Q4 (October - December)"), + ], + string="Quarter", + compute="_compute_quarter", + store=True, + readonly=True, + ) def copy(self, default=None): self.ensure_one() @@ -51,6 +60,22 @@ def _onchange_dates(self): ): rec.date_range_id = False + @api.depends("date_from") + def _compute_quarter(self): + for rec in self: + if rec.date_from: + month = rec.date_from.month + if 1 <= month <= 3: + rec.quarter = "q1" + elif 4 <= month <= 6: + rec.quarter = "q2" + elif 7 <= month <= 9: + rec.quarter = "q3" + else: + rec.quarter = "q4" + else: + rec.quarter = False + def action_draft(self): self.write({"state": "draft"}) diff --git a/mis_builder_budget/views/fiscial_period.xml b/mis_builder_budget/views/fiscial_period.xml deleted file mode 100644 index 40b421ea0..000000000 --- a/mis_builder_budget/views/fiscial_period.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - account.fiscal.year.form - account.fiscal.year - -
- - - - - -
-
-
-
diff --git a/mis_builder_budget/views/mis_budget_by_account.xml b/mis_builder_budget/views/mis_budget_by_account.xml index 2d0dc153e..a20a7393b 100644 --- a/mis_builder_budget/views/mis_budget_by_account.xml +++ b/mis_builder_budget/views/mis_budget_by_account.xml @@ -1,10 +1,11 @@ - - - - mis.budget.by.account.form (in mis_builder_budget) - mis.budget.by.account + + + mis.budget.form (in mis_builder_budget) + mis.budget
@@ -32,7 +33,7 @@