feat: add dlv_fleetflow_base — FleetFlow Settings foundation addon
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.0.0] - 2026-06-14
|
||||
|
||||
### Added
|
||||
- Initial release.
|
||||
- FleetFlow entry in the Odoo Settings sidebar (Settings → FleetFlow).
|
||||
- Empty notebook foundation for feature addon tabs.
|
||||
- Owned by `dlv_fleetflow_base`, never uninstalled directly.
|
||||
@@ -0,0 +1,64 @@
|
||||
# dlv_fleetflow_base
|
||||
|
||||
## Overview
|
||||
|
||||
`dlv_fleetflow_base` is the foundation addon for all FleetFlow-branded addons.
|
||||
It permanently owns the **FleetFlow** entry in the Odoo Settings sidebar
|
||||
(Settings → FleetFlow) and provides an empty settings block that feature addons
|
||||
extend. It contains no models and no business logic — its only job is to give
|
||||
every `dlv_fleetflow_*` addon a single, shared place to live in Settings.
|
||||
|
||||
## How it works
|
||||
|
||||
This addon inherits the standard configuration form
|
||||
(`base_setup.res_config_settings_view_form`) and injects a FleetFlow
|
||||
`app_settings_block` carrying `data-key="dlv_fleetflow_base"` and an empty
|
||||
`<notebook/>`. It also creates the **FleetFlow** menu entry and the action that
|
||||
opens Settings directly on that block.
|
||||
|
||||
Feature addons (`dlv_fleetflow_*`) never create their own Settings entry.
|
||||
Instead, each one adds a tab by inheriting the same base configuration form and
|
||||
targeting the shared notebook with an xpath:
|
||||
|
||||
```
|
||||
//div[@data-key='dlv_fleetflow_base']//notebook
|
||||
```
|
||||
|
||||
Because every feature addon depends on `dlv_fleetflow_base`, its view is loaded
|
||||
first, so the notebook exists when the feature addon's xpath runs. The result is
|
||||
one FleetFlow settings page with one tab per installed feature addon.
|
||||
|
||||
## Adding a new FleetFlow addon
|
||||
|
||||
1. Add `dlv_fleetflow_base` to your addon's `depends`.
|
||||
2. Inherit the base configuration form and add a `<page>` to the shared
|
||||
notebook:
|
||||
|
||||
```xml
|
||||
<record id="my_addon_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.my.addon</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@data-key='dlv_fleetflow_base']//notebook" position="inside">
|
||||
<page string="My Addon">
|
||||
<!-- your settings content here -->
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
```
|
||||
|
||||
3. That's it — your tab appears under Settings → FleetFlow alongside the others.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `base`
|
||||
- `base_setup`
|
||||
|
||||
## Installation
|
||||
|
||||
Install `dlv_fleetflow_base` **first**, before any other `dlv_fleetflow_*`
|
||||
addon. It is a permanent dependency: do **not** uninstall it while any FleetFlow
|
||||
feature addon is still active, or those addons will lose their Settings tab and
|
||||
fail to load their configuration views.
|
||||
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
{
|
||||
"name": "FleetFlow Base",
|
||||
"summary": "Foundation for all FleetFlow addons — owns the Settings menu entry",
|
||||
"author": "bv Domus La Vila",
|
||||
"website": "https://domuslavila.eu",
|
||||
"category": "Technical",
|
||||
"version": "16.0.1.0.0",
|
||||
"license": "LGPL-3",
|
||||
"depends": ["base", "base_setup"],
|
||||
"data": [
|
||||
"views/res_config_settings_views.xml",
|
||||
"views/menus.xml",
|
||||
],
|
||||
"installable": True,
|
||||
"application": False,
|
||||
"auto_install": False,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="fleetflow_action_config_settings" model="ir.actions.act_window">
|
||||
<field name="name">FleetFlow</field>
|
||||
<field name="res_model">res.config.settings</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">inline</field>
|
||||
<field name="context">{'module': 'dlv_fleetflow_base'}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="fleetflow_menu_config_settings"
|
||||
name="FleetFlow"
|
||||
parent="base_setup.menu_all_settings"
|
||||
sequence="70"
|
||||
action="fleetflow_action_config_settings"/>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="fleetflow_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">res.config.settings.view.form.inherit.fleetflow</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[hasclass('settings')]" position="inside">
|
||||
<div class="app_settings_block" data-string="FleetFlow" string="FleetFlow"
|
||||
data-key="dlv_fleetflow_base" groups="base.group_system">
|
||||
<h2>FleetFlow</h2>
|
||||
<notebook/>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user