diff --git a/mis_builder_bi_sql_editor/README.rst b/mis_builder_bi_sql_editor/README.rst new file mode 100644 index 0000000..24103d9 --- /dev/null +++ b/mis_builder_bi_sql_editor/README.rst @@ -0,0 +1,146 @@ +========================= +MIS Builder BI SQL Editor +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:41e107b1dbd1b78c2a4318f783b10b9e30119cb8d9ed1d515c4e2c1673ea8220 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmis--builder--contrib-lightgray.png?logo=github + :target: https://github.com/OCA/mis-builder-contrib/tree/18.0/mis_builder_bi_sql_editor + :alt: OCA/mis-builder-contrib +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/mis-builder-contrib-18-0/mis-builder-contrib-18-0-mis_builder_bi_sql_editor + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/mis-builder-contrib&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module make the BI SQL Editor query models compatible with MIS +Builder. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +Create a query with SQL BI Editor: + +- Use the BI SQL Editor to create your query. +- Make sure your query includes the required fields: x_credit, x_debit, + x_account_id, x_date and x_company_id. +- Optionally, you can include the x_analytic_account_id field for + analytical account support. + +Field Requirements: + +- \`x_credit\`: Must have type float. +- \`x_debit\`: Must have type float. +- \`x_date\`: Must have the date type. +- \`x_account_id\`: Must have the type many2one and be associated with + the account.account model. +- \`x_company_id\`: Must have the type many2one and be associated with + the res.company model. +- x_analytic_account_id (optional): Must have the type many2one and be + associated with the account.analytic.account model. + +Activate MIS Builder in the query model: + +- Once your query meets the above requirements, click the “Activate MIS + Builder” button. +- This will signal that the query should be used in the "Refresh MIS + Builder BI SQL Lines" cron. +- Refreshing materialized view will also create new lines in the model + (if there are new lines). + +Remove MIS Builder in the query model: + +- If you no longer need MIS Builder compatibility, click the "Remove MIS + Builder" button. +- This will delete the rows and columns related to your BI SQL model. + +Create MIS Builder report: + +- When creating a MIS Builder Report, select "BI SQL MIS Builder Line" + as the source. +- Afterwards, select the BI SQL View you want to use (The view must have + MIS Builder activated). +- When creating kpis for this report, you can use MIS expressions to + filter the fields in your query. +- To do this, it is necessary to use the name of the BI SQL View. +- Example: bal[][('x_bi_sql_view_mis.x_name', '=', 'test')]. +- This will filter out the lines in your query that have the x_name + field with "test" as the value. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Escodoo + +Contributors +------------ + +- `Escodoo `__: + + - Marcel Savegnago + - Wesley Oliveira + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-WesleyOliveira98| image:: https://github.com/WesleyOliveira98.png?size=40px + :target: https://github.com/WesleyOliveira98 + :alt: WesleyOliveira98 + +Current `maintainer `__: + +|maintainer-WesleyOliveira98| + +This module is part of the `OCA/mis-builder-contrib `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mis_builder_bi_sql_editor/__init__.py b/mis_builder_bi_sql_editor/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/mis_builder_bi_sql_editor/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mis_builder_bi_sql_editor/__manifest__.py b/mis_builder_bi_sql_editor/__manifest__.py new file mode 100644 index 0000000..3b42e99 --- /dev/null +++ b/mis_builder_bi_sql_editor/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2025 - TODAY, Escodoo +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "MIS Builder BI SQL Editor", + "summary": """ + Integrate MIS Builder to BI SQL Editor""", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "Escodoo," "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/mis-builder-contrib", + "depends": ["mis_builder", "bi_sql_editor"], + "data": [ + "views/bi_sql_view.xml", + "views/mis_builder_bi_sql_line.xml", + "views/mis_report_instance.xml", + "views/mis_report.xml", + "security/ir.model.access.csv", + "data/mis_builder_bi_sql_line_cron.xml", + ], + "installable": True, + "application": True, + "development_status": "Alpha", + "maintainers": ["WesleyOliveira98"], +} diff --git a/mis_builder_bi_sql_editor/data/mis_builder_bi_sql_line_cron.xml b/mis_builder_bi_sql_editor/data/mis_builder_bi_sql_line_cron.xml new file mode 100644 index 0000000..814c1ef --- /dev/null +++ b/mis_builder_bi_sql_editor/data/mis_builder_bi_sql_line_cron.xml @@ -0,0 +1,14 @@ + + + + + Refresh MIS Builder BI SQL Lines + + code + model._create_mis_builder_bi_sql_lines() + + 1 + days + + diff --git a/mis_builder_bi_sql_editor/models/__init__.py b/mis_builder_bi_sql_editor/models/__init__.py new file mode 100644 index 0000000..c47ddd7 --- /dev/null +++ b/mis_builder_bi_sql_editor/models/__init__.py @@ -0,0 +1,4 @@ +from . import bi_sql_view +from . import mis_builder_bi_sql_line +from . import mis_report_instance +from . import mis_report diff --git a/mis_builder_bi_sql_editor/models/bi_sql_view.py b/mis_builder_bi_sql_editor/models/bi_sql_view.py new file mode 100644 index 0000000..baaec34 --- /dev/null +++ b/mis_builder_bi_sql_editor/models/bi_sql_view.py @@ -0,0 +1,111 @@ +# Copyright 2025 - TODAY, Wesley Oliveira +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class BiSQLView(models.Model): + _inherit = "bi.sql.view" + + mis_builder_compatible = fields.Boolean( + compute="_compute_mis_builder_compatible", + ) + mis_builder_activated = fields.Boolean(default=False) + + @api.depends( + "bi_sql_view_field_ids.name", + "bi_sql_view_field_ids.ttype", + "bi_sql_view_field_ids.many2one_model_id", + ) + def _compute_mis_builder_compatible(self): + for record in self: + model_sql_fields = record.bi_sql_view_field_ids + credit_field = model_sql_fields.filtered( + lambda x: x.name == "x_credit" and x.ttype == "float" + ) + debit_field = model_sql_fields.filtered( + lambda x: x.name == "x_debit" and x.ttype == "float" + ) + account_field = model_sql_fields.filtered( + lambda x: x.name == "x_account_id" and x.ttype == "many2one" + ) + date_field = model_sql_fields.filtered( + lambda x: x.name == "x_date" and x.ttype == "date" + ) + company_field = model_sql_fields.filtered( + lambda x: x.name == "x_company_id" and x.ttype == "many2one" + ) + analytic_account_field = model_sql_fields.filtered( + lambda x: x.name == "x_analytic_account_id" and x.ttype == "many2one" + ) + record.mis_builder_compatible = not ( + not credit_field + or not debit_field + or not account_field + or account_field.many2one_model_id.model != "account.account" + or not date_field + or not company_field + or company_field.many2one_model_id.model != "res.company" + or ( + analytic_account_field + and analytic_account_field.many2one_model_id.model + != "account.analytic.account" + ) + ) + + def activate_mis_builder(self): + self.ensure_one() + if self.mis_builder_compatible: + model_id = ( + self.env["ir.model"] + .search([("model", "=", "mis.builder.bi.sql.line")]) + .id + ) + self.env["ir.model.fields"].create( + { + "name": self.view_name, + "model_id": model_id, + "state": "manual", + "ttype": "many2one", + "relation": self.model_name, + } + ) + self.mis_builder_activated = True + + def remove_mis_builder(self): + self.ensure_one() + if self.mis_builder_compatible and self.mis_builder_activated: + self.env["mis.builder.bi.sql.line"].search( + [("bi_sql_model", "=", self.model_id.id)] + ).unlink() + + model_id = ( + self.env["ir.model"] + .search([("model", "=", "mis.builder.bi.sql.line")]) + .id + ) + self.env["ir.model.fields"].search( + [ + ("name", "=", self.view_name), + ("model_id", "=", model_id), + ] + ).unlink() + + self.mis_builder_activated = False + + def button_set_draft(self): + if self.mis_builder_activated: + self.remove_mis_builder() + return super().button_set_draft() + + def button_refresh_materialized_view(self): + res = super().button_refresh_materialized_view() + if self.mis_builder_activated: + self.env["mis.builder.bi.sql.line"]._create_mis_builder_bi_sql_lines() + return res + + def copy_data(self, default=None): + vals_list = super().copy_data(default=default) + for vals in vals_list: + vals["mis_builder_activated"] = False + return vals_list diff --git a/mis_builder_bi_sql_editor/models/mis_builder_bi_sql_line.py b/mis_builder_bi_sql_editor/models/mis_builder_bi_sql_line.py new file mode 100644 index 0000000..617dd4d --- /dev/null +++ b/mis_builder_bi_sql_editor/models/mis_builder_bi_sql_line.py @@ -0,0 +1,51 @@ +# Copyright 2025 - TODAY, Wesley Oliveira +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MisBuilderBiSqlLine(models.Model): + _name = "mis.builder.bi.sql.line" + _description = "MIS Builder BI SQL Line" + + credit = fields.Float() + debit = fields.Float() + account_id = fields.Many2one(comodel_name="account.account") + date = fields.Date() + company_id = fields.Many2one(comodel_name="res.company") + analytic_account_id = fields.Many2one(comodel_name="account.analytic.account") + bi_sql_model = fields.Many2one(comodel_name="ir.model") + res_id = fields.Integer() + + def _create_mis_builder_bi_sql_lines(self): + sql_view_ids = self.env["bi.sql.view"].search( + [ + ("mis_builder_compatible", "=", True), + ("mis_builder_activated", "=", True), + ] + ) + vals_list = [] + for sql_view in sql_view_ids: + existing_res_ids = set( + self.search([("bi_sql_model", "=", sql_view.model_id.id)]).mapped( + "res_id" + ) + ) + for line in self.env[sql_view.model_id.model].search([]): + if line.id in existing_res_ids: + continue + vals_list.append( + { + "credit": line.x_credit, + "debit": line.x_debit, + "account_id": line.x_account_id.id, + "date": line.x_date, + "company_id": line.x_company_id.id, + "analytic_account_id": line.x_analytic_account_id.id or False, + "bi_sql_model": sql_view.model_id.id, + "res_id": line.id, + sql_view.view_name: line.id, + } + ) + if vals_list: + self.create(vals_list) diff --git a/mis_builder_bi_sql_editor/models/mis_report.py b/mis_builder_bi_sql_editor/models/mis_report.py new file mode 100644 index 0000000..1701713 --- /dev/null +++ b/mis_builder_bi_sql_editor/models/mis_report.py @@ -0,0 +1,27 @@ +# Copyright 2025 - TODAY, Wesley Oliveira +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class MisReport(models.Model): + _inherit = "mis.report" + + bi_sql_view = fields.Many2one( + string="BI SQL View", + comodel_name="bi.sql.view", + domain=[("mis_builder_activated", "=", True)], + ) + bi_sql_view_required = fields.Boolean( + default=False, compute="_compute_bi_sql_view_required" + ) + + @api.depends("move_lines_source") + def _compute_bi_sql_view_required(self): + for record in self: + model_id = ( + self.env["ir.model"] + .search([("model", "=", "mis.builder.bi.sql.line")]) + .id + ) + record.bi_sql_view_required = record.move_lines_source.id == model_id diff --git a/mis_builder_bi_sql_editor/models/mis_report_instance.py b/mis_builder_bi_sql_editor/models/mis_report_instance.py new file mode 100644 index 0000000..4acfd24 --- /dev/null +++ b/mis_builder_bi_sql_editor/models/mis_report_instance.py @@ -0,0 +1,46 @@ +# Copyright 2025 - TODAY, Wesley Oliveira +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class MisReportInstancePeriod(models.Model): + _inherit = "mis.report.instance.period" + + bi_sql_view = fields.Many2one( + string="BI SQL View", + comodel_name="bi.sql.view", + domain=[("mis_builder_activated", "=", True)], + ) + bi_sql_view_required = fields.Boolean( + default=False, compute="_compute_bi_sql_view_required" + ) + + @api.depends("source", "source_aml_model_id") + def _compute_bi_sql_view_required(self): + for record in self: + if record.source == "actuals_alt": + model_id = ( + self.env["ir.model"] + .search([("model", "=", "mis.builder.bi.sql.line")]) + .id + ) + record.bi_sql_view_required = record.source_aml_model_id.id == model_id + else: + record.bi_sql_view_required = False + + def _get_additional_move_line_filter(self): + domain = super()._get_additional_move_line_filter() + if self.bi_sql_view: + domain = domain + [("bi_sql_model", "=", self.bi_sql_view.model_id.id)] + return domain + + +class MisReportInstance(models.Model): + _inherit = "mis.report.instance" + + bi_sql_view = fields.Many2one( + string="BI SQL View", + comodel_name="bi.sql.view", + related="report_id.bi_sql_view", + ) diff --git a/mis_builder_bi_sql_editor/pyproject.toml b/mis_builder_bi_sql_editor/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/mis_builder_bi_sql_editor/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mis_builder_bi_sql_editor/readme/CONTRIBUTORS.md b/mis_builder_bi_sql_editor/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..e1ffbca --- /dev/null +++ b/mis_builder_bi_sql_editor/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Escodoo](https://www.escodoo.com.br): + - Marcel Savegnago \ + - Wesley Oliveira \ diff --git a/mis_builder_bi_sql_editor/readme/DESCRIPTION.md b/mis_builder_bi_sql_editor/readme/DESCRIPTION.md new file mode 100644 index 0000000..262b1c7 --- /dev/null +++ b/mis_builder_bi_sql_editor/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module make the BI SQL Editor query models compatible with MIS +Builder. diff --git a/mis_builder_bi_sql_editor/readme/USAGE.md b/mis_builder_bi_sql_editor/readme/USAGE.md new file mode 100644 index 0000000..413a7e8 --- /dev/null +++ b/mis_builder_bi_sql_editor/readme/USAGE.md @@ -0,0 +1,49 @@ +To use this module, you need to: + +Create a query with SQL BI Editor: + +- Use the BI SQL Editor to create your query. +- Make sure your query includes the required fields: x_credit, x_debit, + x_account_id, x_date and x_company_id. +- Optionally, you can include the x_analytic_account_id field for + analytical account support. + +Field Requirements: + +- \`x_credit\`: Must have type float. +- \`x_debit\`: Must have type float. +- \`x_date\`: Must have the date type. +- \`x_account_id\`: Must have the type many2one and be associated with + the account.account model. +- \`x_company_id\`: Must have the type many2one and be associated with + the res.company model. +- x_analytic_account_id (optional): Must have the type many2one and be + associated with the account.analytic.account model. + +Activate MIS Builder in the query model: + +- Once your query meets the above requirements, click the “Activate MIS + Builder” button. +- This will signal that the query should be used in the "Refresh MIS + Builder BI SQL Lines" cron. +- Refreshing materialized view will also create new lines in the model + (if there are new lines). + +Remove MIS Builder in the query model: + +- If you no longer need MIS Builder compatibility, click the "Remove MIS + Builder" button. +- This will delete the rows and columns related to your BI SQL model. + +Create MIS Builder report: + +- When creating a MIS Builder Report, select "BI SQL MIS Builder Line" + as the source. +- Afterwards, select the BI SQL View you want to use (The view must have + MIS Builder activated). +- When creating kpis for this report, you can use MIS expressions to + filter the fields in your query. +- To do this, it is necessary to use the name of the BI SQL View. +- Example: bal\[\]\[('x_bi_sql_view_mis.x_name', '=', 'test')\]. +- This will filter out the lines in your query that have the x_name + field with "test" as the value. diff --git a/mis_builder_bi_sql_editor/security/ir.model.access.csv b/mis_builder_bi_sql_editor/security/ir.model.access.csv new file mode 100644 index 0000000..1a41153 --- /dev/null +++ b/mis_builder_bi_sql_editor/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_mis_builder_bi_sql_line,access_mis_builder_bi_sql_line,model_mis_builder_bi_sql_line,base.group_user,1,0,0,0 +manage_mis_builder_bi_sql_line,manage_mis_builder_bi_sql_line,model_mis_builder_bi_sql_line,account.group_account_manager,1,1,1,1 diff --git a/mis_builder_bi_sql_editor/static/description/icon.png b/mis_builder_bi_sql_editor/static/description/icon.png new file mode 100644 index 0000000..1afa781 Binary files /dev/null and b/mis_builder_bi_sql_editor/static/description/icon.png differ diff --git a/mis_builder_bi_sql_editor/static/description/index.html b/mis_builder_bi_sql_editor/static/description/index.html new file mode 100644 index 0000000..bb85390 --- /dev/null +++ b/mis_builder_bi_sql_editor/static/description/index.html @@ -0,0 +1,489 @@ + + + + + +MIS Builder BI SQL Editor + + + +
+

MIS Builder BI SQL Editor

+ + +

Alpha License: AGPL-3 OCA/mis-builder-contrib Translate me on Weblate Try me on Runboat

+

This module make the BI SQL Editor query models compatible with MIS +Builder.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+

Create a query with SQL BI Editor:

+
    +
  • Use the BI SQL Editor to create your query.
  • +
  • Make sure your query includes the required fields: x_credit, x_debit, +x_account_id, x_date and x_company_id.
  • +
  • Optionally, you can include the x_analytic_account_id field for +analytical account support.
  • +
+

Field Requirements:

+
    +
  • `x_credit`: Must have type float.
  • +
  • `x_debit`: Must have type float.
  • +
  • `x_date`: Must have the date type.
  • +
  • `x_account_id`: Must have the type many2one and be associated with +the account.account model.
  • +
  • `x_company_id`: Must have the type many2one and be associated with +the res.company model.
  • +
  • x_analytic_account_id (optional): Must have the type many2one and be +associated with the account.analytic.account model.
  • +
+

Activate MIS Builder in the query model:

+
    +
  • Once your query meets the above requirements, click the “Activate MIS +Builder” button.
  • +
  • This will signal that the query should be used in the “Refresh MIS +Builder BI SQL Lines” cron.
  • +
  • Refreshing materialized view will also create new lines in the model +(if there are new lines).
  • +
+

Remove MIS Builder in the query model:

+
    +
  • If you no longer need MIS Builder compatibility, click the “Remove MIS +Builder” button.
  • +
  • This will delete the rows and columns related to your BI SQL model.
  • +
+

Create MIS Builder report:

+
    +
  • When creating a MIS Builder Report, select “BI SQL MIS Builder Line” +as the source.
  • +
  • Afterwards, select the BI SQL View you want to use (The view must have +MIS Builder activated).
  • +
  • When creating kpis for this report, you can use MIS expressions to +filter the fields in your query.
  • +
  • To do this, it is necessary to use the name of the BI SQL View.
  • +
  • Example: bal[][(‘x_bi_sql_view_mis.x_name’, ‘=’, ‘test’)].
  • +
  • This will filter out the lines in your query that have the x_name +field with “test” as the value.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

WesleyOliveira98

+

This module is part of the OCA/mis-builder-contrib project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/mis_builder_bi_sql_editor/tests/__init__.py b/mis_builder_bi_sql_editor/tests/__init__.py new file mode 100644 index 0000000..f6aaa3d --- /dev/null +++ b/mis_builder_bi_sql_editor/tests/__init__.py @@ -0,0 +1 @@ +from . import test_mis_builder_bi_sql_line diff --git a/mis_builder_bi_sql_editor/tests/test_mis_builder_bi_sql_line.py b/mis_builder_bi_sql_editor/tests/test_mis_builder_bi_sql_line.py new file mode 100644 index 0000000..f94eaa0 --- /dev/null +++ b/mis_builder_bi_sql_editor/tests/test_mis_builder_bi_sql_line.py @@ -0,0 +1,29 @@ +# Copyright 2025 - TODAY, Escodoo +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.addons.base.tests.common import BaseCommon + + +class TestMisBuilderBiSqlLine(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.company = cls.env.ref("base.main_company") + + def test_create_line(self): + line = self.env["mis.builder.bi.sql.line"].create( + { + "credit": 100.0, + "debit": 0.0, + "company_id": self.company.id, + } + ) + self.assertEqual(line.credit, 100.0) + self.assertEqual(line.company_id, self.company) + + def test_report_filter_without_bi_sql_view(self): + period = self.env["mis.report.instance.period"] + self.assertTrue( + hasattr(period, "_get_additional_move_line_filter"), + "mis.report.instance.period must expose _get_additional_move_line_filter", + ) diff --git a/mis_builder_bi_sql_editor/views/bi_sql_view.xml b/mis_builder_bi_sql_editor/views/bi_sql_view.xml new file mode 100644 index 0000000..4cbc6f2 --- /dev/null +++ b/mis_builder_bi_sql_editor/views/bi_sql_view.xml @@ -0,0 +1,31 @@ + + + + + bi.sql.view.form (in mis_builder_bi_sql_editor) + bi.sql.view + + +
+
+ + + + + +
+
diff --git a/mis_builder_bi_sql_editor/views/mis_builder_bi_sql_line.xml b/mis_builder_bi_sql_editor/views/mis_builder_bi_sql_line.xml new file mode 100644 index 0000000..bc43000 --- /dev/null +++ b/mis_builder_bi_sql_editor/views/mis_builder_bi_sql_line.xml @@ -0,0 +1,40 @@ + + + + + mis.builder.bi.sql.line.form + mis.builder.bi.sql.line + +
+ + + + + + + + + + + + +
+
+
+ + + mis.builder.bi.sql.line.list + mis.builder.bi.sql.line + + + + + + + + + + + +
diff --git a/mis_builder_bi_sql_editor/views/mis_report.xml b/mis_builder_bi_sql_editor/views/mis_report.xml new file mode 100644 index 0000000..76c9ed3 --- /dev/null +++ b/mis_builder_bi_sql_editor/views/mis_report.xml @@ -0,0 +1,19 @@ + + + + + mis.report.view.form (in mis_builder_bi_sql_editor) + mis.report + + + + + + + + diff --git a/mis_builder_bi_sql_editor/views/mis_report_instance.xml b/mis_builder_bi_sql_editor/views/mis_report_instance.xml new file mode 100644 index 0000000..77ccffd --- /dev/null +++ b/mis_builder_bi_sql_editor/views/mis_report_instance.xml @@ -0,0 +1,24 @@ + + + + + mis.report.instance.period.form (in mis_builder_bi_sql_editor) + mis.report.instance.period + + + + + + + +