[FIX] runbot_merge: layout backend issues galore

- Odoo 17 seems to not be adjusting `nolabel` fields to be `colspan=2`
  by default, so every such occurrence has to be adjusted by hand or
  it gets squeezed in just the labels column.
- Because of the loss of readonly mode, some fields / setups which
  previously looked ugly during the rare edition (e.g. Pr titles) now
  look ugly all the time. Rework layout and force them to always be
  readonly (hopefully we won't need to edit those).
- This is compounded by unfortunate styling I can't find how to
  override e.g. char fields are 100% width even if readonly.
- `<header>` system requires some workarounds to have the right layout
  and spacing (notably `header` has a bunch of awful rules which we
  need to work around via an interstitial div to set up our own
  flexbox).
This commit is contained in:
Xavier Morel 2024-08-16 14:24:06 +02:00
parent 0d653620c2
commit ccca46c992
3 changed files with 34 additions and 35 deletions

View File

@ -57,7 +57,7 @@
</group> </group>
<group string="Pull Requests"> <group string="Pull Requests">
<group colspan="4"> <group colspan="4">
<field name="all_prs" nolabel="1" readonly="1"> <field colspan="2" name="all_prs" nolabel="1" readonly="1">
<tree> <tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open PR"/> <button type="object" name="get_formview_action" icon="fa-external-link" title="open PR"/>
<field name="display_name"/> <field name="display_name"/>
@ -69,7 +69,7 @@
</group> </group>
<group string="Genealogy"> <group string="Genealogy">
<group colspan="4"> <group colspan="4">
<field name="genealogy_ids" nolabel="1" readonly="1"> <field colspan="2" name="genealogy_ids" nolabel="1" readonly="1">
<tree decoration-muted="id == parent.id"> <tree decoration-muted="id == parent.id">
<button type="object" name="get_formview_action" icon="fa-external-link" title="open batch"/> <button type="object" name="get_formview_action" icon="fa-external-link" title="open batch"/>
<field name="name"/> <field name="name"/>
@ -81,7 +81,7 @@
</group> </group>
<group string="Stagings"> <group string="Stagings">
<group colspan="4"> <group colspan="4">
<field name="staging_ids" nolabel="1" readonly="1"> <field colspan="2" name="staging_ids" nolabel="1" readonly="1">
<tree> <tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open staging"/> <button type="object" name="get_formview_action" icon="fa-external-link" title="open staging"/>
<field name="staged_at"/> <field name="staged_at"/>

View File

@ -123,27 +123,33 @@
<field name="model">runbot_merge.pull_requests</field> <field name="model">runbot_merge.pull_requests</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form> <form>
<div class="o_form_statusbar"> <header>
<span class="o_statusbar_buttons"> <div class="d-flex gap-1">
<button type="object" name="button_split" string="Split Off"/> <button type="object" name="button_split" string="Split Off"/>
<field name="github_url" widget="url" class="btn btn-secondary" text="Github"/> <field name="github_url" widget="url" class="btn btn-secondary mb-0" text="Github"/>
<field name="url" widget="url" class="btn btn-secondary" text="Frontend"/> <field name="url" widget="url" class="btn btn-secondary mb-0" text="Frontend"/>
</span> </div>
</div> </header>
<sheet> <sheet>
<field name="project" invisible="1"/> <field name="project" invisible="1"/>
<field name="target_sequence" invisible="1"/> <field name="target_sequence" invisible="1"/>
<div class="oe_title"> <div class="oe_title" colspan="2">
<h1> <h1>
<field name="repository"/>#<field name="number"/> <field name="repository" readonly="True"/>#<field name="number" readonly="True"/>
</h1> </h1>
<h2> <h2>
<field name="state"/> <field name="state"/>
<span invisible="state == 'merged' or not blocked"> <span invisible="state == 'merged' or not blocked">
(blocked: <field name="blocked"/>) <!--
</span> The web client forces char fields to take 100%
width in all situations without (as far as I
can tell) opt out, if the view is in edition
mode. Which is now always the case for form views.
-->
(blocked: <field name="blocked" class="w-auto"/>)
</span>
<span invisible="state != 'merged'"> <span invisible="state != 'merged'">
(<field name="merge_date"/>) (<field name="merge_date" readonly="True"/>)
</span> </span>
</h2> </h2>
</div> </div>
@ -179,11 +185,6 @@
</details> </details>
</group> </group>
</group> </group>
<group>
<group colspan="4">
<field name="blocked"/>
</group>
</group>
</page> </page>
<page name="configuration" string="Configuration"> <page name="configuration" string="Configuration">
<group> <group>
@ -200,7 +201,7 @@
</group> </group>
<group string="Delegates"> <group string="Delegates">
<group colspan="4"> <group colspan="4">
<field name="delegates" nolabel="1"> <field colspan="2" name="delegates" nolabel="1">
<tree> <tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open partner"/> <button type="object" name="get_formview_action" icon="fa-external-link" title="open partner"/>
<field name="name"/> <field name="name"/>
@ -213,7 +214,7 @@
<page name="stagings" string="Staging History"> <page name="stagings" string="Staging History">
<group> <group>
<group colspan="4"> <group colspan="4">
<field name="staging_ids" nolabel="1" readonly="1"> <field colspan="2" name="staging_ids" nolabel="1" readonly="1">
<tree> <tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open staging"/> <button type="object" name="get_formview_action" icon="fa-external-link" title="open staging"/>
<field name="staged_at"/> <field name="staged_at"/>
@ -234,10 +235,8 @@
invisible="source_id and not parent_id" invisible="source_id and not parent_id"
string="Detached because" name="detach_reason" readonly="1"/> string="Detached because" name="detach_reason" readonly="1"/>
</group> </group>
</group> <group>
<group> <field colspan="2" name="forwardport_ids" nolabel="1" readonly="True">
<group colspan="4">
<field name="forwardport_ids" nolabel="1" readonly="True">
<tree> <tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open PR"/> <button type="object" name="get_formview_action" icon="fa-external-link" title="open PR"/>
<field name="target" string="Branch"/> <field name="target" string="Branch"/>
@ -251,7 +250,7 @@
<!-- influencers --> <!-- influencers -->
<group string="Message"> <group string="Message">
<group colspan="4"> <group colspan="4">
<field name="message" nolabel="1"/> <field colspan="2" name="message" nolabel="1" readonly="1"/>
</group> </group>
</group> </group>
</sheet> </sheet>

View File

@ -60,12 +60,12 @@
</group> </group>
<group> <group>
<group colspan="4" string="Review Rights"> <group colspan="4" string="Review Rights">
<div colspan="4" class="alert alert-warning" role="alert" invisible="not review_rights"> <div colspan="2" class="alert alert-warning" role="alert" invisible="not review_rights">
Review access requires successfully following Review access requires successfully following
the Code Review (QDP) and Security (DLE) the Code Review (QDP) and Security (DLE)
trainings. Please check before giving r+ access. trainings. Please check before giving r+ access.
</div> </div>
<field colspan="4" name="review_rights" nolabel="1"> <field colspan="2" name="review_rights" nolabel="1">
<tree string="Review ACLs" editable="bottom"> <tree string="Review ACLs" editable="bottom">
<field name="repository_id"/> <field name="repository_id"/>
<field name="review"/> <field name="review"/>
@ -73,18 +73,18 @@
</tree> </tree>
</field> </field>
</group> </group>
<group colspan="4"> <group colspan="2">
<div colspan="4" class="alert alert-danger" role="alert" invisible="not override_sensitive"> <div colspan="2" class="alert alert-danger" role="alert" invisible="not override_sensitive">
Security Override <b>REQUIRES</b> successfully Security Override <b>REQUIRES</b> successfully
following the Security training. Please ask DLE following the Security training. Please ask DLE
before granting access. before granting access.
</div> </div>
<field colspan="4" name="override_rights" widget="many2many_tags"/> <field colspan="2" name="override_rights" widget="many2many_tags"/>
</group> </group>
</group> </group>
<group> <group>
<group colspan="4" string="Delegate On"> <group colspan="2" string="Delegate On">
<field name="delegate_reviewer" nolabel="1"> <field name="delegate_reviewer" nolabel="1" colspan="2">
<tree> <tree>
<field name="repository"/> <field name="repository"/>
<field name="number"/> <field name="number"/>