mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[9.0] IMP bi_sql_editor (#156)
This commit is contained in:
committed by
Sylvain LE GAL
parent
76ad396363
commit
7c3043b12c
@@ -6,7 +6,7 @@
|
||||
{
|
||||
'name': 'BI SQL Editor',
|
||||
'summary': "BI Views builder, based on Materialized or Normal SQL Views",
|
||||
'version': '9.0.1.0.0',
|
||||
'version': '9.0.1.1.0',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'Reporting',
|
||||
'author': 'GRAP,Odoo Community Association (OCA)',
|
||||
|
||||
@@ -571,3 +571,9 @@ class BiSQLView(models.Model):
|
||||
sql_view.view_name)
|
||||
self.env.cr.execute(req)
|
||||
sql_view.size = self.env.cr.fetchone()[0]
|
||||
|
||||
@api.multi
|
||||
def button_preview_sql_expression(self):
|
||||
self.button_validate_sql_expression()
|
||||
res = self._execute_sql_request()
|
||||
raise UserError('\n'.join(map(lambda x: str(x), res[:100])))
|
||||
|
||||
@@ -29,6 +29,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
<button name="button_set_draft" type="object" states="sql_valid,model_valid,ui_valid"
|
||||
string="Set to Draft" groups="sql_request_abstract.group_sql_request_manager"
|
||||
confirm="Are you sure you want to set to draft this SQL View. It will delete the materialized view, and all the previous mapping realized with the columns"/>
|
||||
<button name="button_preview_sql_expression" type="object" states="draft" string="Preview SQL Expression" class="oe_highlight"/>
|
||||
<button name="button_create_sql_view_and_model" type="object" states="sql_valid"
|
||||
string="Create SQL View, Indexes and Models" class="oe_highlight"
|
||||
help="This will try to create an SQL View, based on the SQL request and the according Transient Model and fields, based on settings"/>
|
||||
|
||||
Reference in New Issue
Block a user