Replace zone preview with JS Mapbox widget and simplify zone UI

This commit is contained in:
Ruslan Bakiev
2026-02-13 18:01:40 +07:00
parent f967429b9d
commit 111afdd885
9 changed files with 272 additions and 82 deletions

View File

@@ -5,14 +5,6 @@
<field name="model">repair.fsm.zone</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_set_active" type="object" string="Set Active" class="btn-primary" invisible="state == 'active'"/>
<button name="action_archive" type="object" string="Archive" invisible="state == 'archived'"/>
<button name="action_reset_draft" type="object" string="Reset to Draft" invisible="state == 'draft'"/>
<button name="action_open_polygon_in_map" type="object" string="Open Polygon Map" invisible="not polygon_geojson"/>
<button name="action_open_point_picker_map" type="object" string="Open OSM"/>
<field name="state" widget="statusbar" statusbar_visible="draft,active,archived" options="{'clickable': '1'}"/>
</header>
<sheet>
<group>
<field name="name"/>
@@ -21,10 +13,10 @@
<field name="polygon_geojson" widget="text" placeholder='{"type":"Polygon","coordinates":[[[-84.55,33.60],[-84.20,33.60],[-84.20,33.90],[-84.55,33.90],[-84.55,33.60]]]}'/>
</group>
<group>
<field name="polygon_map_preview" widget="html" readonly="1" nolabel="1"/>
<field name="mapbox_token" invisible="1"/>
<field name="polygon_geojson" widget="mapbox_polygon_preview" nolabel="1"/>
</group>
</sheet>
<chatter/>
</form>
</field>
</record>

View File

@@ -4,9 +4,8 @@
<field name="name">repair.fsm.zone.kanban</field>
<field name="model">repair.fsm.zone</field>
<field name="arch" type="xml">
<kanban default_group_by="state">
<kanban>
<field name="name"/>
<field name="state"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">

View File

@@ -6,7 +6,6 @@
<field name="arch" type="xml">
<list>
<field name="name"/>
<field name="state" widget="badge" optional="show"/>
<field name="polygon_geojson" optional="hide"/>
</list>
</field>