[IMP] Add back the variable feature in sql_export

Refactore to use the new properties field
This commit is contained in:
Florian da Costa
2023-02-03 11:36:59 +01:00
committed by David Beal
parent 8df404eff2
commit 3cb3fae1f6
13 changed files with 109 additions and 232 deletions

View File

@@ -9,12 +9,15 @@
/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="query" position="after">
<field name="use_properties" invisible="1" />
</field>
<button name="button_preview_sql_expression" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible': [('field_ids', '!=', False)]}</attribute>
>{'invisible': [('use_properties', '=', True)]}</attribute>
</button>
<xpath expr="//header" position="inside">
<button
name="export_sql_query"
@@ -24,6 +27,14 @@
class="oe_highlight"
icon="fa-arrow-right text-success"
/>
<button
name="configure_properties"
states="draft"
string="Configure Properties"
type="object"
class="oe_highlight"
icon="fa-arrow-right text-success"
/>
</xpath>
<group name="group_main_info" position="inside">
<group name="option">
@@ -41,19 +52,14 @@
/>
</group>
</group>
<group name="group_query" position="after">
<group string="Parameters">
<field
name="field_ids"
nolabel="1"
colspan="2"
options="{'no_create': True}"
context="{'tree_view_ref': 'sql_export.sql_parameter_view_tree', 'form_view_ref': 'sql_export.sql_parameter_view_form'}"
attrs="{'readonly': [('state', '!=', 'draft')]}"
groups="sql_request_abstract.group_sql_request_user"
<field name="query" position="before">
<p
colspan="2"
attrs="{'invisible': [('use_properties', '=', False)]}"
> In case of use of properties in the query, use this syntax : &#37;&#37;(Property String)s. <br
/>
</group>
</group>
Example : SELECT id FROM sale_order WHERE create_date > &#37;&#37;(Start Date)s</p>
</field>
</field>
</record>