odoo/odoo#156439

Created by JavaScript, Aaron Bohy (aab)
Closed
label
odoo-dev:master-semantic-kanban-aab
head
76245618d5ef17a220b514e4fafa577d35fd86e9
odoo/odoo odoo/enterprise
master #156439 #58044

[WIP] web, *: semantic kanban view engine

New semantic kanban engine: no more weird 'js qweb stuff' in your backend views.

We started from this 'generic kanban template' and simplified it a bit to have a few new node-types:
image

Layout

Layout block in the image Node
column &lt;aside&gt;<br>Attributes: full​ (default: "false") to expand on card padding (e.g. res_partner)
main > header/body/footer &lt;section&gt;​<br>By default, will have classnames &#34;d-flex justify-content-between flex-column&#34;.<br>Attributes:type​ (optional) set to "row" to have class "flex-row"No need for footer/header, the first/last section would stick to top/bottom of the card
ribbon use a &lt;widget&gt; node with name=&#34;web_ribbon&#34;​ almost anywhere in the template (like in form views)​.<br>Best practice would be to use it as direct child of the &lt;kanban&gt;​ node.
menu (not shown in the mockup) &lt;menu&gt;​injects the toggle in 'after title' section in the mockup (vertical ellipsis)<br>by default support any html and we encourage the use of button nodes and perhaps separator node with a string as a default sectioning mechanism; in addition to a default size in css? otherwise any custom html  + css is fine (we add a class on the dropdown menu to make css targetting easy)

New attributes on root node

global_click Default: true​ Replaces the oe_kanban_global_click​ / oe_kanban_global_click_edit​ logic<br>Around 27 kanban views where it must be set to disable the feature -> &lt;kanban global_click=&#34;0&#34;&gt;
color ​Optional.<br>Can be set to the field to use as color for the card border-left.<br>Replaces the kanban_color(record.color.raw_value)​ feature -> &lt;kanban color=&#34;color&#34;&gt;

Dropped features

  • ​kanban-tooltip​ template (3 usecases: gamification + 2x maintenance)
  • kanban_getcolorname​ not even translated
  • ​selection_mode​ (true is SelectCreateDialog), used to remove stuff -> automatically make the card inert in SelectCreateDialog (only allow to select the card)
    ​- widget.deletable​/ widget.editable​-> automatically disable type="delete"​/ type="edit"​buttons/links
  • all rendering context (record​ / widget​ / luxon​...)
  • qweb directives (t-if​/ t-esc​ ...) (t-if is replaced by invisible attribute)
  • automatically set  widget=&#34;many2many_tags&#34; on many2many fields -> must be set in the arch now, like in list views
  • type=&#34;open&#34; ​as since form views are always in edit mode, it opens the record in edit anyway (like type="edit"​)