runbot/runbot_merge/models/backport/views.xml
Xavier Morel a12e593fba [FIX] runbot_merge: backport wizard
- fix incorrect view specs (the action id comes first)
- add a wizard form and hook it into the PR, completely forgot to do
  that
- usability improvements: filter branches to be in the same project as
  the PR being backported, and older than the current PR's branch

The latter is a somewhat incomplete condition: ideally we'd want to
only allow selecting branches preceding the target of the *source* of
the PR being backported, that way we don't risk errors when
backporting forward-ports (the condition should be checked in the
final action but still).

Also we're only filtering by sequence, so we're missing the name part
of the ordering, hence if multiple branches have the same sequence we
may not allow selecting some of the preceding branches.
2024-11-18 09:48:48 +01:00

24 lines
997 B
XML

<odoo>
<record id="runbot_merge_backport_form" model="ir.ui.view">
<field name="name">Backport Wizard</field>
<field name="model">runbot_merge.pull_requests.backport</field>
<field name="arch" type="xml">
<form>
<field name="pr_id" invisible="1"/>
<field name="project_id" invisible="1"/>
<field name="source_seq" invisible="1"/>
<field name="target" class="w-100"/>
</form>
</field>
</record>
<record id="runbot_merge_backport_pr_action" model="ir.actions.server">
<field name="name">Perform backport from current PR</field>
<field name="type">ir.actions.server</field>
<field name="model_id" ref="model_runbot_merge_pull_requests"/>
<field name="binding_model_id" ref="model_runbot_merge_pull_requests"/>
<field name="state">code</field>
<field name="code">action = record.backport()</field>
</record>
</odoo>