mirror of https://github.com/OCA/web.git
parent
c90c77ff68
commit
4f8b4983e5
|
@ -3,7 +3,7 @@
|
|||
{
|
||||
"name": "Quick Start Screen",
|
||||
"summary": "Configurable start screen for quick actions",
|
||||
"version": "16.0.1.0.0",
|
||||
"version": "18.0.1.0.0",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/web",
|
||||
"license": "AGPL-3",
|
||||
|
@ -22,7 +22,7 @@
|
|||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"web_quick_start_screen/static/src/scss/quick_start_screen.scss",
|
||||
"web_quick_start_screen/static/src/js/kanban_controller.esm.js",
|
||||
"web_quick_start_screen/static/src/js/**/*",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from collections import defaultdict
|
||||
|
||||
from odoo import _, api, fields, models, tools
|
||||
from odoo import api, fields, models, tools
|
||||
|
||||
|
||||
class QuicktStartScreen(models.Model):
|
||||
|
@ -40,8 +40,8 @@ class QuicktStartScreen(models.Model):
|
|||
|
||||
def _prepare_screen_action(self):
|
||||
return {
|
||||
"display_name": self.name or _("Start"),
|
||||
"name": self.name or _("Start"),
|
||||
"display_name": self.name or self.env._("Start"),
|
||||
"name": self.name or self.env._("Start"),
|
||||
"res_model": "quick.start.screen.action",
|
||||
"target": "current",
|
||||
"type": "ir.actions.act_window",
|
||||
|
|
|
@ -58,6 +58,7 @@ class DecontracStartScreenAction(models.Model):
|
|||
if self.context:
|
||||
extra_context = self._get_extra_context()
|
||||
# We need to deal with the active_id and overwrite it if needed
|
||||
# MIG TODO: Check if this is affected
|
||||
active_id = extra_context.get("active_id", 0)
|
||||
action["context"] = dict(
|
||||
safe_eval(action.get("context", "{}"), {"active_id": active_id}),
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
/** @odoo-module */
|
||||
/* Copyright 2024 Tecnativa - David Vidal
|
||||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
|
||||
import {ControlPanel} from "@web/search/control_panel/control_panel";
|
||||
import {kanbanView} from "@web/views/kanban/kanban_view";
|
||||
import {registry} from "@web/core/registry";
|
||||
const {xml} = owl;
|
||||
|
||||
export class QuickStartScreenControlPanel extends ControlPanel {}
|
||||
|
||||
// We want to remove the control panel from this view.
|
||||
QuickStartScreenControlPanel.template = xml`<div class="d-none" />`;
|
||||
export class QuickStartScreenControlPanel extends ControlPanel {
|
||||
static template = "start_screen.ControlPanel";
|
||||
}
|
||||
|
||||
export const quickStartScreenView = {
|
||||
...kanbanView,
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates xml:space="preserve">
|
||||
<t
|
||||
t-name="start_screen.ControlPanel"
|
||||
t-inherit="web.ControlPanel"
|
||||
t-inherit-mode="primary"
|
||||
>
|
||||
<xpath expr="//div[hasclass('o_control_panel')]" position="attributes">
|
||||
<attribute name="class" add="d-none" separator=" " />
|
||||
</xpath>
|
||||
</t>
|
||||
</templates>
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="quick_start_screen_action_tree" model="ir.ui.view">
|
||||
<record id="quick_start_screen_action_list" model="ir.ui.view">
|
||||
<field name="model">quick.start.screen.action</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree>
|
||||
<list>
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name" />
|
||||
<field name="description" />
|
||||
<field name="action_ref_id" groups="base.group_system" />
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="quick_start_screen_action_kanban" model="ir.ui.view">
|
||||
|
@ -23,50 +23,34 @@
|
|||
<field name="color" />
|
||||
<field name="context" />
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="col-6 col-md-4 col-lg-3 py-4">
|
||||
<div class="row m-0 w-100 h-100">
|
||||
<div class="col-lg-4 p-0">
|
||||
<div
|
||||
class="d-flex w-100 h-100 align-items-start justify-content-center display-3 p-3 text-muted"
|
||||
>
|
||||
<img
|
||||
t-att-src="kanban_image('quick.start.screen.action', 'image', record.id.raw_value)"
|
||||
class="o_image_64_cover"
|
||||
t-if="record.image.raw_value"
|
||||
t-att-alt="record.name.raw_value"
|
||||
/>
|
||||
<i
|
||||
t-else=""
|
||||
t-attf-class="fa #{record.icon_name.raw_value or 'fa-flash'} o_start_icon_color_#{record.color.raw_value}"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8 p-0">
|
||||
<div
|
||||
class="card-body d-flex flex-column align-items-start justify-content-start h-100"
|
||||
>
|
||||
<h3
|
||||
class="card-title"
|
||||
t-out="record.name.raw_value"
|
||||
/>
|
||||
<a
|
||||
type="object"
|
||||
data-reload-on-close="true"
|
||||
name="run_action"
|
||||
role="button"
|
||||
href="#"
|
||||
class="btn-lnk stretched-link"
|
||||
t-att-string="record.name.raw_value"
|
||||
>
|
||||
<span
|
||||
t-out="record.description.raw_value"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<t t-name="card" class="flex-row">
|
||||
<aside class="d-flex align-items-center me-2">
|
||||
<field
|
||||
t-if="record.image.raw_value"
|
||||
name="image"
|
||||
widget="image"
|
||||
options="{'img_class': 'object-fit-contain'}"
|
||||
/>
|
||||
<i
|
||||
t-else=""
|
||||
t-attf-class="fa #{record.icon_name.raw_value or 'fa-flash'} fa-3x o_start_icon_color_#{record.color.raw_value}"
|
||||
t-att-title="record.name.raw_value"
|
||||
/>
|
||||
</aside>
|
||||
<main>
|
||||
<h3 class="card-title" t-out="record.name.raw_value" />
|
||||
<a
|
||||
type="object"
|
||||
data-reload-on-close="true"
|
||||
name="run_action"
|
||||
role="button"
|
||||
href="#"
|
||||
class="btn-lnk stretched-link"
|
||||
t-att-string="record.name.raw_value"
|
||||
>
|
||||
<span t-out="record.description.raw_value" />
|
||||
</a>
|
||||
</main>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
|
@ -81,15 +65,8 @@
|
|||
<field name="name" />
|
||||
<field name="action_ref_id" groups="base.group_system" />
|
||||
<field name="description" widget="html" />
|
||||
<field
|
||||
name="icon_name"
|
||||
attrs="{'invisible': [('image', '!=', False)]}"
|
||||
/>
|
||||
<field
|
||||
name="color"
|
||||
widget="color_picker"
|
||||
attrs="{'invisible': [('image', '!=', False)]}"
|
||||
/>
|
||||
<field name="icon_name" invisible="image" />
|
||||
<field name="color" widget="color_picker" invisible="image" />
|
||||
<field name="domain" groups="base.group_system" />
|
||||
<field name="context" groups="base.group_system" />
|
||||
<field name="image" widget="image" />
|
||||
|
@ -101,7 +78,7 @@
|
|||
<record id="quick_start_screen_action_action" model="ir.actions.act_window">
|
||||
<field name="name">Quick Start Screen Actions</field>
|
||||
<field name="res_model">quick.start.screen.action</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_quick_start_screen_action"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<odoo>
|
||||
<record id="quick_start_screen_tree_view" model="ir.ui.view">
|
||||
<record id="quick_start_screen_list_view" model="ir.ui.view">
|
||||
<field name="model">quick.start.screen</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="top">
|
||||
<list editable="top">
|
||||
<field name="name" />
|
||||
<field
|
||||
name="action_ids"
|
||||
|
@ -16,13 +16,13 @@
|
|||
title="Go to the start screen"
|
||||
icon="fa-flash"
|
||||
/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="start_screen_action_config" model="ir.actions.act_window">
|
||||
<field name="res_model">quick.start.screen</field>
|
||||
<field name="name">Quick Start Screens</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_mode">list</field>
|
||||
</record>
|
||||
<record id="start_screen_action" model="ir.actions.server">
|
||||
<field name="name">Quick Start Screen</field>
|
||||
|
|
Loading…
Reference in New Issue