[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 string="Pull Requests">
<group colspan="4">
<field name="all_prs" nolabel="1" readonly="1">
<field colspan="2" name="all_prs" nolabel="1" readonly="1">
<tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open PR"/>
<field name="display_name"/>
@ -69,7 +69,7 @@
</group>
<group string="Genealogy">
<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">
<button type="object" name="get_formview_action" icon="fa-external-link" title="open batch"/>
<field name="name"/>
@ -81,7 +81,7 @@
</group>
<group string="Stagings">
<group colspan="4">
<field name="staging_ids" nolabel="1" readonly="1">
<field colspan="2" name="staging_ids" nolabel="1" readonly="1">
<tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open staging"/>
<field name="staged_at"/>

View File

@ -123,27 +123,33 @@
<field name="model">runbot_merge.pull_requests</field>
<field name="arch" type="xml">
<form>
<div class="o_form_statusbar">
<span class="o_statusbar_buttons">
<header>
<div class="d-flex gap-1">
<button type="object" name="button_split" string="Split Off"/>
<field name="github_url" widget="url" class="btn btn-secondary" text="Github"/>
<field name="url" widget="url" class="btn btn-secondary" text="Frontend"/>
</span>
<field name="github_url" widget="url" class="btn btn-secondary mb-0" text="Github"/>
<field name="url" widget="url" class="btn btn-secondary mb-0" text="Frontend"/>
</div>
</header>
<sheet>
<field name="project" invisible="1"/>
<field name="target_sequence" invisible="1"/>
<div class="oe_title">
<div class="oe_title" colspan="2">
<h1>
<field name="repository"/>#<field name="number"/>
<field name="repository" readonly="True"/>#<field name="number" readonly="True"/>
</h1>
<h2>
<field name="state"/>
<span invisible="state == 'merged' or not blocked">
(blocked: <field name="blocked"/>)
<!--
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'">
(<field name="merge_date"/>)
(<field name="merge_date" readonly="True"/>)
</span>
</h2>
</div>
@ -179,11 +185,6 @@
</details>
</group>
</group>
<group>
<group colspan="4">
<field name="blocked"/>
</group>
</group>
</page>
<page name="configuration" string="Configuration">
<group>
@ -200,7 +201,7 @@
</group>
<group string="Delegates">
<group colspan="4">
<field name="delegates" nolabel="1">
<field colspan="2" name="delegates" nolabel="1">
<tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open partner"/>
<field name="name"/>
@ -213,7 +214,7 @@
<page name="stagings" string="Staging History">
<group>
<group colspan="4">
<field name="staging_ids" nolabel="1" readonly="1">
<field colspan="2" name="staging_ids" nolabel="1" readonly="1">
<tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open staging"/>
<field name="staged_at"/>
@ -234,10 +235,8 @@
invisible="source_id and not parent_id"
string="Detached because" name="detach_reason" readonly="1"/>
</group>
</group>
<group>
<group colspan="4">
<field name="forwardport_ids" nolabel="1" readonly="True">
<field colspan="2" name="forwardport_ids" nolabel="1" readonly="True">
<tree>
<button type="object" name="get_formview_action" icon="fa-external-link" title="open PR"/>
<field name="target" string="Branch"/>
@ -251,7 +250,7 @@
<!-- influencers -->
<group string="Message">
<group colspan="4">
<field name="message" nolabel="1"/>
<field colspan="2" name="message" nolabel="1" readonly="1"/>
</group>
</group>
</sheet>

View File

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