[MIG] bi_sql_editor: Migration to 15.0

pull/557/head
mariadforgeflow 2021-12-13 09:21:22 +01:00
parent 613e0e88ba
commit 8fa79a290e
5 changed files with 25 additions and 22 deletions

View File

@ -5,7 +5,7 @@
{
"name": "BI SQL Editor",
"summary": "BI Views builder, based on Materialized or Normal SQL Views",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"license": "AGPL-3",
"category": "Reporting",
"author": "GRAP,Odoo Community Association (OCA)",
@ -20,4 +20,5 @@
"demo": ["demo/res_groups_demo.xml", "demo/bi_sql_view_demo.xml"],
"installable": True,
"uninstall_hook": "uninstall_hook",
"maintainers": ["legalsylvain"],
}

View File

@ -11,10 +11,10 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
<field
name="query"
><![CDATA[
SELECT *
FROM unexisting_table
ORDER BY unexisting_field
]]>
SELECT *
FROM unexisting_table
ORDER BY unexisting_field
]]>
</field>
</record>
<record id="partner_sql_view" model="bi.sql.view">
@ -23,13 +23,13 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
<field
name="query"
><![CDATA[
SELECT
name as x_name,
street as x_street,
company_id as x_company_id
FROM res_partner
ORDER BY name
]]>
SELECT
name as x_name,
street as x_street,
company_id as x_company_id
FROM res_partner
ORDER BY name
]]>
</field>
</record>
<record id="module_sql_view" model="bi.sql.view">
@ -39,14 +39,14 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
<field
name="query"
><![CDATA[
SELECT
name as x_name,
case
when author ilike '%OpenERP SA%' THEN 'Odoo SA'
when author ilike '%Odoo Community Association (OCA)%' THEN 'OCA'
else 'Undefined Author' END as x_author_type
FROM ir_module_module
]]>
SELECT
name as x_name,
case
when author ilike '%OpenERP SA%' THEN 'Odoo SA'
when author ilike '%Odoo Community Association (OCA)%' THEN 'OCA'
else 'Undefined Author' END as x_author_type
FROM ir_module_module
]]>
</field>
</record>
<function

View File

@ -526,7 +526,7 @@ class BiSQLView(models.Model):
return self.name
return "{} ({})".format(
self.name,
datetime.utcnow().strftime(_("%m/%d/%Y %H:%M:%S UTC")),
datetime.utcnow().strftime("%m/%d/%Y %H:%M:%S UTC"),
)
def _prepare_menu(self):

View File

@ -5,5 +5,6 @@ class IrModelFields(models.Model):
_inherit = "ir.model.fields"
def _add_manual_fields(self, model):
super()._add_manual_fields(model)
res = super()._add_manual_fields(model)
self.env["bi.sql.view"].check_manual_fields(model)
return res

View File

@ -129,6 +129,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
nolabel="1"
colspan="4"
attrs="{'readonly': [('state', '!=', 'draft')]}"
widget="ace"
/>
</page>
<page