[IMP] preview button
parent
1ce6fb73c8
commit
4a2fba7f34
|
@ -570,3 +570,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"/>
|
||||
|
|
Loading…
Reference in New Issue