Skip to content

Conversation

@lef-adhoc
Copy link
Contributor

@lef-adhoc lef-adhoc commented Nov 28, 2025

legalsylvain and others added 30 commits November 28, 2025 11:22
…fresh date time on the action name of each sql materialized view
Fix error '... is not a table or foreign table'
Fix view (colors + oe_highlight)
Fix tests
Fix README + manifest
Fix back to draft
Fix cron call + default values
Use Postgres version 9.6 for travis builds
* [IMP] is_materialized field non readonly on sql_valid state ; [FIX] block possibility to set indexes on non materialized view

* [FIX] set domain_force, group_ids readonly if state > sql_valid

* [IMP] better display of the field group_ids

* [IMP] possibility to reorder menu items from sql views

* [IMP] Do not warn user when setting sql view to draft if state is sql_valid

* [REF]

* [FIX] Set Date of the first execution in the action name
[UPD] Update bi_sql_editor.pot

[UPD] Update bi_sql_editor.pot

[UPD] Update bi_sql_editor.pot
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
bi_sql_editor 12.0.1.1.0

[UPD] README.rst

[UPD] README.rst
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: reporting-engine-12.0/reporting-engine-12.0-bi_sql_editor
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-bi_sql_editor/
Currently translated at 29.1% (32 of 110 strings)

Translation: reporting-engine-12.0/reporting-engine-12.0-bi_sql_editor
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-bi_sql_editor/de/
chrisb-c01 and others added 6 commits November 28, 2025 11:22
Currently translated at 66.8% (97 of 145 strings)

Translation: reporting-engine-18.0/reporting-engine-18.0-bi_sql_editor
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-bi_sql_editor/ca/
Currently translated at 93.7% (136 of 145 strings)

Translation: reporting-engine-18.0/reporting-engine-18.0-bi_sql_editor
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-bi_sql_editor/ca/
Currently translated at 100.0% (145 of 145 strings)

Translation: reporting-engine-18.0/reporting-engine-18.0-bi_sql_editor
Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-18-0/reporting-engine-18-0-bi_sql_editor/ca/
@lef-adhoc lef-adhoc force-pushed the 19.0-mig-bi_sql_editor branch 6 times, most recently from 2380b1a to 4927854 Compare November 28, 2025 15:41
@lef-adhoc lef-adhoc mentioned this pull request Nov 28, 2025
20 tasks
from psycopg2.sql import SQL, Identifier

from odoo import SUPERUSER_ID, _, api, fields, models
from odoo import SUPERUSER_ID, api, fields, models
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-19.0

When using SUPERUSER_ID variable, import it from api instead inside odoo itself. More info at odoo/odoo@d6a955f10483.

Either from odoo.api import SUPERUSER_ID or use api.SUPERUSER_ID

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

<odoo>
<record id="base.group_no_one" model="res.groups">
<field name="users" eval="[(4, ref('base.user_admin'))]" />
<field name="user_ids" eval="[(4, ref('base.user_admin'))]" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<field name="user_ids" eval="[Command.link(ref('base.user_admin'))]" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check the commit “[MIG] bi_sql_editor: Migration to 19.0”? It's like that.

Except for the command, which I don't think is necessary.

"name": "Demo User",
"login": "demo_bi_sql",
"email": "demo@example.com",
"group_ids": [(6, 0, [cls.group_bi_no_access.id])],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"group_ids": [Command.set(cls.group_bi_no_access.ids)],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary

def _get_user(cls, access_level=False):
if access_level == "manager":
cls.demo_user.write({"groups_id": [(6, 0, cls.group_bi_manager.ids)]})
cls.demo_user.write({"group_ids": [(6, 0, cls.group_bi_manager.ids)]})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check the commit “[MIG] bi_sql_editor: Migration to 19.0”? It's like that.

Copy link
Contributor

@yankinmax yankinmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of suggestions

@lef-adhoc lef-adhoc force-pushed the 19.0-mig-bi_sql_editor branch from 4927854 to 3144fdc Compare December 16, 2025 14:56
@lef-adhoc lef-adhoc force-pushed the 19.0-mig-bi_sql_editor branch 2 times, most recently from 8cc1347 to b66eb95 Compare December 31, 2025 15:04
Copy link

@vvrossem vvrossem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @yankinmax: it would be a nice opportunity to use Command instead of keeping the "old" way

</record>
<record id="sql_request_abstract.group_sql_request_user" model="res.groups">
<field name="users" eval="[(4, ref('base.user_demo'))]" />
<field name="user_ids" eval="[(4, ref('base.user_demo'))]" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<field name="user_ids" eval="[(4, ref('base.user_demo'))]" />
<field name="user_ids" eval="[Command.link(ref('base.user_demo'))]" />

@@ -3,11 +3,11 @@

from odoo.exceptions import AccessError, UserError, ValidationError
from odoo.tests import tagged
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from odoo.tests import tagged
from odoo.tests import new_test_user, tagged

cls.group_bi_no_access = cls.env.ref("base.group_user")
cls.demo_user = cls.env.ref("base.user_demo")
cls.view = cls.env.ref("bi_sql_editor.partner_sql_view")
cls.demo_user = cls.env["res.users"].create(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cls.demo_user = cls.env["res.users"].create(
cls.demo_user = new_test_user(cls.env, login='demo_bi_sql', groups='base.group_user', name='Demo User', email='demo@example.com')

@psugne
Copy link

psugne commented Jan 13, 2026

@lef-adhoc how is going with this one?

@lef-adhoc lef-adhoc force-pushed the 19.0-mig-bi_sql_editor branch from b66eb95 to 887773e Compare January 13, 2026 14:49
@lef-adhoc
Copy link
Contributor Author

@vvrossem @psugne Done!

@psugne
Copy link

psugne commented Jan 27, 2026

@lef-adhoc Would it be possible to update TestBiSqlViewEditor.test_security to search for the view by ID instead of name? For example:
def test_security(self): with self.assertRaises(AccessError): self.bi_sql_view.with_user(self._get_user()).search( [("id", "=", self.view.id)] ) bi = self.bi_sql_view.with_user(self._get_user("manager")).search( [("id", "=", self.view.id)] ) self.assertEqual( len(bi), 1, f"BI Manager should have access to the specific record: {self.view.name}", )

When running this test in my module, it currently fails due to search mismatches:
AssertionError: 2 != 1 : BI Manager should have access to bi Partners View
Searching by ID instead of name should make the test more deterministic and avoid collisions when multiple records share the same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.