Skip to content

Commit f3fce68

Browse files
committed
Merge PR #217 into 18.0
Signed-off-by sebastienbeau
2 parents d1aa126 + 5dd7ed9 commit f3fce68

2 files changed

Lines changed: 45 additions & 21 deletions

File tree

connector_search_engine/models/se_binding.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ def recompute_json(self, force_export: bool = False):
218218
if force_export or not compare_json(old_data or {}, record.data or {}):
219219
record.state = "to_export"
220220
else:
221-
record.state = "done"
221+
if record.state not in ("to_export", "exporting"):
222+
record.state = "done"
222223
record.error = ""
223224

224225
def export_record(self) -> str:

connector_search_engine/views/se_binding_view.xml

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,52 @@
2424
<field name="model">se.binding</field>
2525
<field name="arch" type="xml">
2626
<form string="Binding">
27-
<group>
28-
<field name="backend_id" />
29-
<field name="index_id" />
30-
<field name="state" />
31-
<field name="date_recomputed" />
32-
<field name="date_synchronized" />
33-
<field name="res_model" />
34-
<field name="res_id" />
35-
<field name="record_id" />
36-
</group>
37-
<group string="Error" attrs="{'invisible': [('error', '=', False)]}">
38-
<field name="error" nolabel="1" colspan="4" />
39-
</group>
40-
<group string="Data">
27+
<header>
28+
<button
29+
name="recompute_json"
30+
type="object"
31+
string="Force Recompute"
32+
attrs="{'invisible': [('state', 'in', ('to_delete', 'deleting'))]}"
33+
/>
34+
<button
35+
name="export_record"
36+
type="object"
37+
string="Force Export"
38+
attrs="{'invisible': [('state', 'not in', ('done', 'to_export', 'exporting'))]}"
39+
/>
4140
<field
42-
name="data_display"
43-
nolabel="1"
44-
colspan="4"
45-
widget="ace"
46-
options="{'mode': 'python'}"
41+
name="state"
42+
widget="statusbar"
43+
statusbar_visible="to_recompute,recomputing,to_export,exporting,done"
4744
/>
45+
</header>
46+
<sheet>
47+
<group>
48+
<field name="backend_id" />
49+
<field name="index_id" />
50+
<field name="date_recomputed" />
51+
<field name="date_synchronized" />
52+
<field name="res_model" />
53+
<field name="res_id" />
54+
<field name="record_id" />
55+
</group>
56+
<group
57+
string="Error"
58+
attrs="{'invisible': [('error', '=', False)]}"
59+
>
60+
<field name="error" nolabel="1" colspan="4" />
61+
</group>
62+
<group string="Data">
63+
<field
64+
name="data_display"
65+
nolabel="1"
66+
colspan="4"
67+
widget="ace"
68+
options="{'mode': 'python'}"
69+
/>
4870

49-
</group>
71+
</group>
72+
</sheet>
5073
</form>
5174
</field>
5275
</record>

0 commit comments

Comments
 (0)