[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", "name": "BI SQL Editor",
"summary": "BI Views builder, based on Materialized or Normal SQL Views", "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", "license": "AGPL-3",
"category": "Reporting", "category": "Reporting",
"author": "GRAP,Odoo Community Association (OCA)", "author": "GRAP,Odoo Community Association (OCA)",
@ -20,4 +20,5 @@
"demo": ["demo/res_groups_demo.xml", "demo/bi_sql_view_demo.xml"], "demo": ["demo/res_groups_demo.xml", "demo/bi_sql_view_demo.xml"],
"installable": True, "installable": True,
"uninstall_hook": "uninstall_hook", "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 <field
name="query" name="query"
><![CDATA[ ><![CDATA[
SELECT * SELECT *
FROM unexisting_table FROM unexisting_table
ORDER BY unexisting_field ORDER BY unexisting_field
]]> ]]>
</field> </field>
</record> </record>
<record id="partner_sql_view" model="bi.sql.view"> <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 <field
name="query" name="query"
><![CDATA[ ><![CDATA[
SELECT SELECT
name as x_name, name as x_name,
street as x_street, street as x_street,
company_id as x_company_id company_id as x_company_id
FROM res_partner FROM res_partner
ORDER BY name ORDER BY name
]]> ]]>
</field> </field>
</record> </record>
<record id="module_sql_view" model="bi.sql.view"> <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 <field
name="query" name="query"
><![CDATA[ ><![CDATA[
SELECT SELECT
name as x_name, name as x_name,
case case
when author ilike '%OpenERP SA%' THEN 'Odoo SA' when author ilike '%OpenERP SA%' THEN 'Odoo SA'
when author ilike '%Odoo Community Association (OCA)%' THEN 'OCA' when author ilike '%Odoo Community Association (OCA)%' THEN 'OCA'
else 'Undefined Author' END as x_author_type else 'Undefined Author' END as x_author_type
FROM ir_module_module FROM ir_module_module
]]> ]]>
</field> </field>
</record> </record>
<function <function

View File

@ -526,7 +526,7 @@ class BiSQLView(models.Model):
return self.name return self.name
return "{} ({})".format( return "{} ({})".format(
self.name, 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): def _prepare_menu(self):

View File

@ -5,5 +5,6 @@ class IrModelFields(models.Model):
_inherit = "ir.model.fields" _inherit = "ir.model.fields"
def _add_manual_fields(self, model): 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) 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" nolabel="1"
colspan="4" colspan="4"
attrs="{'readonly': [('state', '!=', 'draft')]}" attrs="{'readonly': [('state', '!=', 'draft')]}"
widget="ace"
/> />
</page> </page>
<page <page