runbot/runbot_merge/models/ir_cron/views.xml
Xavier Morel d8c2782d1f [IMP] runbot_merge: add cron trigger button
"Run manually" is a bit meh, as it runs the cron synchronously (so you
have to wait for it, and hope it doesn't run for longer than the
request timeout which may be smaller than the cron timeout) and it can
run in a subtly different environment than normal, which can lead to
different behaviour.

Instead add a button to enqueue a cron trigger, now that they exist
that's much closer to what we actually want, and it does run the cron
in a normal / expected environment.
2025-02-18 11:45:56 +01:00

16 lines
697 B
XML

<odoo>
<record id="ir_cron_view_form" model="ir.ui.view">
<field name="name">replace "run manually" by "trigger"</field>
<field name="model">ir.cron</field>
<field name="inherit_id" ref="base.ir_cron_view_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='method_direct_trigger']" position="after">
<button name="trigger" type="object" string="Trigger" class="oe_highlight" invisible="state != 'code'"/>
</xpath>
<xpath expr="//button[@name='method_direct_trigger']" position="attributes">
<attribute name="class"/>
</xpath>
</field>
</record>
</odoo>