Skip to content

Commit

Permalink
connector_search_engine: allow recompute specific bindings
Browse files Browse the repository at this point in the history
_jobify_batch_recompute and batch_recompute now accept a binding_ids param

to force the records to be computed.
  • Loading branch information
simahawk committed Feb 26, 2024
1 parent cc3d828 commit bcfc380
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion connector_search_engine/wizards/se_binding_state_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class SeBindingStateUpdater(models.TransientModel):
selection=lambda self: self.env["se.binding"]._fields["state"].selection,
required=True,
)
do_it_now = fields.Boolean(help="Don't wait for the cron to process these records")

def doit(self):
res_ids = self.env.context.get("active_ids")
self.env["se.binding"].browse(res_ids).write({"state": self.state})
bindings = self.env["se.binding"].browse(res_ids)
bindings.write({"state": self.state})
if self.do_it_now:
bindings.index_id._jobify_batch_recompute(binding_ids=bindings.ids)
5 changes: 4 additions & 1 deletion connector_search_engine/wizards/se_binding_state_updater.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
<field name="arch" type="xml">
<form string="Se Binding State Updater">
<group>
<field name="state" />
<group colspan="2">
<field name="state" />
<field name="do_it_now" />
</group>
</group>
<footer>
<button name="doit" string="OK" class="btn-primary" type="object" />
Expand Down

0 comments on commit bcfc380

Please sign in to comment.