From 9d06e874abee4304e8ac05b7e10412657da5b29e Mon Sep 17 00:00:00 2001 From: sreedevk Date: Wed, 27 May 2026 09:41:56 +0000 Subject: [PATCH] [ADD] awesome owl: Framework Tutorials 101 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PURPOSE Learn the basics of the Owl framework and of the Odoo web framework, which is built on top. task-6250237 --- awesome_dashboard/static/src/dashboard.js | 8 -- awesome_dashboard/static/src/dashboard.xml | 8 -- .../static/src/dashboard/dashboard.js | 85 +++++++++++++++++++ .../static/src/dashboard/dashboard.scss | 3 + .../static/src/dashboard/dashboard.xml | 44 ++++++++++ .../static/src/dashboard/dashboard_items.js | 64 ++++++++++++++ .../static/src/dashboard/dashboard_loader.js | 10 +++ .../src/dashboard_item/dashboard_item.js | 19 +++++ .../src/dashboard_item/dashboard_item.xml | 9 ++ .../static/src/number_card/number_card.js | 13 +++ .../static/src/number_card/number_card.xml | 9 ++ .../static/src/piechart/piechart.js | 48 +++++++++++ .../static/src/piechart/piechart.xml | 10 +++ .../static/src/piechart_card/piechart_card.js | 15 ++++ .../src/piechart_card/piechart_card.xml | 9 ++ .../static/src/services/statistics_service.js | 22 +++++ awesome_owl/static/src/card/card.js | 9 ++ awesome_owl/static/src/card/card.xml | 12 +++ awesome_owl/static/src/counter/counter.js | 17 ++++ awesome_owl/static/src/counter/counter.xml | 15 ++++ awesome_owl/static/src/main.js | 4 +- awesome_owl/static/src/playground.js | 16 +++- awesome_owl/static/src/playground.xml | 18 +++- awesome_owl/static/src/todo/todo_item.js | 11 +++ awesome_owl/static/src/todo/todo_item.xml | 30 +++++++ awesome_owl/static/src/todo/todo_list.js | 49 +++++++++++ awesome_owl/static/src/todo/todo_list.xml | 27 ++++++ ruff.toml | 84 ++++++++++++++++++ 28 files changed, 644 insertions(+), 24 deletions(-) delete mode 100644 awesome_dashboard/static/src/dashboard.js delete mode 100644 awesome_dashboard/static/src/dashboard.xml create mode 100644 awesome_dashboard/static/src/dashboard/dashboard.js create mode 100644 awesome_dashboard/static/src/dashboard/dashboard.scss create mode 100644 awesome_dashboard/static/src/dashboard/dashboard.xml create mode 100644 awesome_dashboard/static/src/dashboard/dashboard_items.js create mode 100644 awesome_dashboard/static/src/dashboard/dashboard_loader.js create mode 100644 awesome_dashboard/static/src/dashboard_item/dashboard_item.js create mode 100644 awesome_dashboard/static/src/dashboard_item/dashboard_item.xml create mode 100644 awesome_dashboard/static/src/number_card/number_card.js create mode 100644 awesome_dashboard/static/src/number_card/number_card.xml create mode 100644 awesome_dashboard/static/src/piechart/piechart.js create mode 100644 awesome_dashboard/static/src/piechart/piechart.xml create mode 100644 awesome_dashboard/static/src/piechart_card/piechart_card.js create mode 100644 awesome_dashboard/static/src/piechart_card/piechart_card.xml create mode 100644 awesome_dashboard/static/src/services/statistics_service.js create mode 100644 awesome_owl/static/src/card/card.js create mode 100644 awesome_owl/static/src/card/card.xml create mode 100644 awesome_owl/static/src/counter/counter.js create mode 100644 awesome_owl/static/src/counter/counter.xml create mode 100644 awesome_owl/static/src/todo/todo_item.js create mode 100644 awesome_owl/static/src/todo/todo_item.xml create mode 100644 awesome_owl/static/src/todo/todo_list.js create mode 100644 awesome_owl/static/src/todo/todo_list.xml create mode 100644 ruff.toml diff --git a/awesome_dashboard/static/src/dashboard.js b/awesome_dashboard/static/src/dashboard.js deleted file mode 100644 index c4fb245621b..00000000000 --- a/awesome_dashboard/static/src/dashboard.js +++ /dev/null @@ -1,8 +0,0 @@ -import { Component } from "@odoo/owl"; -import { registry } from "@web/core/registry"; - -class AwesomeDashboard extends Component { - static template = "awesome_dashboard.AwesomeDashboard"; -} - -registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboard); diff --git a/awesome_dashboard/static/src/dashboard.xml b/awesome_dashboard/static/src/dashboard.xml deleted file mode 100644 index 1a2ac9a2fed..00000000000 --- a/awesome_dashboard/static/src/dashboard.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - hello dashboard - - - diff --git a/awesome_dashboard/static/src/dashboard/dashboard.js b/awesome_dashboard/static/src/dashboard/dashboard.js new file mode 100644 index 00000000000..ccd3574474a --- /dev/null +++ b/awesome_dashboard/static/src/dashboard/dashboard.js @@ -0,0 +1,85 @@ +import { CheckBox } from "@web/core/checkbox/checkbox"; +import { Component, useState } from "@odoo/owl"; +import { DashboardItem } from "../dashboard_item/dashboard_item"; +import { Dialog } from "@web/core/dialog/dialog"; +import { Layout } from "@web/search/layout"; +import { Piechart } from "../piechart/piechart"; +import { browser } from "@web/core/browser/browser"; +import { registry } from "@web/core/registry"; +import { useService } from "@web/core/utils/hooks"; + +class AwesomeDashboard extends Component { + static template = "awesome_dashboard.awesome_dashboard"; + static components = { Layout, DashboardItem, Piechart }; + + setup() { + this.action = useService("action"); + this.statistics = useState(useService("awesome_dashboard.statistics")); + this.dialog = useService("dialog"); + this.items = registry.category("awesome_dashboard").getAll(); + + this.state = useState({ + disabledItems: browser.localStorage.getItem("disabledDashboardItems")?.split(",") || [] + }); + } + + openCustomerList() { + this.action.doAction("base.action_partner_form"); + } + + openConfig() { + this.dialog.add(ConfigDialog, { + items: this.items, + disabledItems: this.state.disabledItems, + onUpdateConfig: this.updateConfig.bind(this), + }) + } + + openLeadsList() { + this.action.doAction({ + type: "ir.actions.act_window", + name: "CRM Leads Workspace", + res_model: "crm.lead", + views: [[false, "list"], [false, "form"]], + }); + } + + updateConfig(newDisabledItems) { + this.state.disabledItems = newDisabledItems; + } +} + +class ConfigDialog extends Component { + static template = "awesome_dashboard.config_dialog"; + static components = { CheckBox, Dialog }; + static props = ["items", "disabledItems", "onUpdateConfig", "close"]; + + setup() { + this.items = useState(this.props.items.map((item) => { + return { + ...item, + enabled: !this.props.disabledItems.includes(item.id), + } + })); + } + + apply() { + this.props.close(); + } + + onChange(checked, changedItem) { + changedItem.enabled = checked; + const newDisabledItems = Object.values(this.items).filter( + (item) => !item.enabled + ).map((item) => item.id); + + browser.localStorage.setItem( + "disabledDashboardItems", + newDisabledItems, + ); + + this.props.onUpdateConfig(newDisabledItems); + } +} + +registry.category("lazy_components").add("AwesomeDashboard", AwesomeDashboard); diff --git a/awesome_dashboard/static/src/dashboard/dashboard.scss b/awesome_dashboard/static/src/dashboard/dashboard.scss new file mode 100644 index 00000000000..f7538c55a36 --- /dev/null +++ b/awesome_dashboard/static/src/dashboard/dashboard.scss @@ -0,0 +1,3 @@ +.o_dashboard { + background: grey; +} diff --git a/awesome_dashboard/static/src/dashboard/dashboard.xml b/awesome_dashboard/static/src/dashboard/dashboard.xml new file mode 100644 index 00000000000..4a50c50ec1f --- /dev/null +++ b/awesome_dashboard/static/src/dashboard/dashboard.xml @@ -0,0 +1,44 @@ + + + + + + +
+ + + +
+
+
+ + + + + + +
+
+
+ + + + + + + + + + + + + +
diff --git a/awesome_dashboard/static/src/dashboard/dashboard_items.js b/awesome_dashboard/static/src/dashboard/dashboard_items.js new file mode 100644 index 00000000000..d874d9d3af1 --- /dev/null +++ b/awesome_dashboard/static/src/dashboard/dashboard_items.js @@ -0,0 +1,64 @@ +import { registry } from "@web/core/registry"; +import { NumberCard } from "../number_card/number_card"; +import { PiechartCard } from "../piechart_card/piechart_card"; + +export const items = [ + { + id: "average_quantity", + description: "Average amount of t-shirts", + Component: NumberCard, + props: (data) => ({ + title: "Average amount of t-shirt by order this month", + value: data.average_quantity, + }), + }, + { + id: "average_time", + description: "Average order time", + Component: NumberCard, + props: (data) => ({ + title: "Average time for an order to reach a final state.", + value: data.average_time, + }), + }, + { + id: "nb_new_orders", + description: "New orders this month", + Component: NumberCard, + props: (data) => ({ + title: "Number of new orders this month", + value: data.nb_new_orders, + }), + }, + { + id: "nb_cancelled_orders", + description: "Cancelled orders this month", + Component: NumberCard, + props: (data) => ({ + title: "Number of cancelled orders this month", + value: data.nb_cancelled_orders, + }), + }, + { + id: "total_amount", + description: "Total new orders this month", + Component: NumberCard, + props: (data) => ({ + title: "Total amount of new orders this month", + value: data.total_amount, + }), + }, + { + id: "orders_by_size", + description: "Shirt orders by size", + Component: PiechartCard, + props: (data) => ({ + title: "Shirt orders by size", + values: data.orders_by_size, + }), + }, +]; + +items.forEach(item => { + registry.category("awesome_dashboard").add(item.id, item); +}); diff --git a/awesome_dashboard/static/src/dashboard/dashboard_loader.js b/awesome_dashboard/static/src/dashboard/dashboard_loader.js new file mode 100644 index 00000000000..192d933f119 --- /dev/null +++ b/awesome_dashboard/static/src/dashboard/dashboard_loader.js @@ -0,0 +1,10 @@ +import { Component, xml } from "@odoo/owl"; +import { LazyComponent } from "@web/core/assets"; +import { registry } from "@web/core/registry"; + +export class AwesomeDashboardLoader extends Component { + static components = { LazyComponent }; + static template = xml``; +} + +registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboardLoader); diff --git a/awesome_dashboard/static/src/dashboard_item/dashboard_item.js b/awesome_dashboard/static/src/dashboard_item/dashboard_item.js new file mode 100644 index 00000000000..489accc5a0e --- /dev/null +++ b/awesome_dashboard/static/src/dashboard_item/dashboard_item.js @@ -0,0 +1,19 @@ +import { Component } from "@odoo/owl"; + +export class DashboardItem extends Component { + static template = "awesome_dashboard.dashboard_item"; + static props = { + size: { + type: Number, + optional: true, + }, + slots: { + type: Object, + optional: true, + }, + }; + + get size() { + return this.props.size || 1; + } +} diff --git a/awesome_dashboard/static/src/dashboard_item/dashboard_item.xml b/awesome_dashboard/static/src/dashboard_item/dashboard_item.xml new file mode 100644 index 00000000000..9bdd0617616 --- /dev/null +++ b/awesome_dashboard/static/src/dashboard_item/dashboard_item.xml @@ -0,0 +1,9 @@ + + + +
+ +
+
+
diff --git a/awesome_dashboard/static/src/number_card/number_card.js b/awesome_dashboard/static/src/number_card/number_card.js new file mode 100644 index 00000000000..bc51b19252c --- /dev/null +++ b/awesome_dashboard/static/src/number_card/number_card.js @@ -0,0 +1,13 @@ +import { Component } from "@odoo/owl"; + +export class NumberCard extends Component { + static template = "awesome_dashboard.number_card"; + static props = { + title: { + type: String, + }, + value: { + type: Number, + }, + }; +} diff --git a/awesome_dashboard/static/src/number_card/number_card.xml b/awesome_dashboard/static/src/number_card/number_card.xml new file mode 100644 index 00000000000..198a809e66e --- /dev/null +++ b/awesome_dashboard/static/src/number_card/number_card.xml @@ -0,0 +1,9 @@ + + + +

+ +

+ + +
diff --git a/awesome_dashboard/static/src/piechart/piechart.js b/awesome_dashboard/static/src/piechart/piechart.js new file mode 100644 index 00000000000..f904bb6e141 --- /dev/null +++ b/awesome_dashboard/static/src/piechart/piechart.js @@ -0,0 +1,48 @@ +import { Component, onMounted, onPatched, onWillStart, onWillUnmount, useRef } from "@odoo/owl" +import { loadJS } from "@web/core/assets"; + +export class Piechart extends Component { + static template = "awesome_dashboard.piechart"; + static props = { + title: String, + data: { + type: Object, + optional: true, + }, + }; + + setup() { + this.canvasRef = useRef("canvas"); + + onWillStart(async () => loadJS("/web/static/lib/Chart/Chart.js")); + onWillUnmount(() => { + this.chart.destroy(); + }); + onMounted(() => { + this.renderChart(); + }); + onPatched(() => { + this.chart?.destroy(); + this.renderChart(); + }); + + } + + renderChart() { + const chartData = this.props.data || {}; + const labels = Object.keys(chartData); + const data = Object.values(chartData); + this.chart = new Chart(this.canvasRef.el, { + type: "pie", + data: { + labels: labels, + datasets: [ + { + label: this.props.title, + data: data, + }, + ], + }, + }); + } +} diff --git a/awesome_dashboard/static/src/piechart/piechart.xml b/awesome_dashboard/static/src/piechart/piechart.xml new file mode 100644 index 00000000000..8d60be9c476 --- /dev/null +++ b/awesome_dashboard/static/src/piechart/piechart.xml @@ -0,0 +1,10 @@ + + + +
+
+ +
+
+
+
diff --git a/awesome_dashboard/static/src/piechart_card/piechart_card.js b/awesome_dashboard/static/src/piechart_card/piechart_card.js new file mode 100644 index 00000000000..2c72a4be242 --- /dev/null +++ b/awesome_dashboard/static/src/piechart_card/piechart_card.js @@ -0,0 +1,15 @@ +import { Component } from "@odoo/owl"; +import { Piechart } from "../piechart/piechart"; + +export class PiechartCard extends Component { + static template = "awesome_dashboard.piechart_card"; + static components = { Piechart: Piechart }; + static props = { + title: { + type: String, + }, + values: { + type: Object, + }, + }; +} diff --git a/awesome_dashboard/static/src/piechart_card/piechart_card.xml b/awesome_dashboard/static/src/piechart_card/piechart_card.xml new file mode 100644 index 00000000000..b87865f3b85 --- /dev/null +++ b/awesome_dashboard/static/src/piechart_card/piechart_card.xml @@ -0,0 +1,9 @@ + + + +

+ +

+ +
+
diff --git a/awesome_dashboard/static/src/services/statistics_service.js b/awesome_dashboard/static/src/services/statistics_service.js new file mode 100644 index 00000000000..0a02ba9e826 --- /dev/null +++ b/awesome_dashboard/static/src/services/statistics_service.js @@ -0,0 +1,22 @@ +import { registry } from "@web/core/registry"; +import { rpc } from "@web/core/network/rpc"; +import { reactive } from "@odoo/owl"; + +const statisticsService = { + dependencies: [], + + start(_env) { + const statistics = reactive({ isReady: false }); + const loadData = async () => { + const updates = await rpc("/awesome_dashboard/statistics"); + Object.assign(statistics, updates, { isReady: true }); + }; + + setInterval(loadData, 3 * 1000); + loadData(); + + return statistics; + }, +}; + +registry.category("services").add("awesome_dashboard.statistics", statisticsService); diff --git a/awesome_owl/static/src/card/card.js b/awesome_owl/static/src/card/card.js new file mode 100644 index 00000000000..f934fbf140f --- /dev/null +++ b/awesome_owl/static/src/card/card.js @@ -0,0 +1,9 @@ +import { Component } from "@odoo/owl"; + +export class Card extends Component { + static template = "awesome_owl.card"; + static props = { + title: String, + content: String, + }; +} diff --git a/awesome_owl/static/src/card/card.xml b/awesome_owl/static/src/card/card.xml new file mode 100644 index 00000000000..6642de5162b --- /dev/null +++ b/awesome_owl/static/src/card/card.xml @@ -0,0 +1,12 @@ + + + +
+
+
+

+

+
+
+
+ diff --git a/awesome_owl/static/src/counter/counter.js b/awesome_owl/static/src/counter/counter.js new file mode 100644 index 00000000000..f49fcbd3be9 --- /dev/null +++ b/awesome_owl/static/src/counter/counter.js @@ -0,0 +1,17 @@ +import { Component, useState } from '@odoo/owl' + +export class Counter extends Component { + static template = "awesome_owl.counter"; + static props = { + onChange: Function, + }; + + setup() { + this.state = useState({ value: 0 }); + } + + increment() { + this.state.value++; + this.props.onChange(); + } +} diff --git a/awesome_owl/static/src/counter/counter.xml b/awesome_owl/static/src/counter/counter.xml new file mode 100644 index 00000000000..70ff85bd928 --- /dev/null +++ b/awesome_owl/static/src/counter/counter.xml @@ -0,0 +1,15 @@ + + + +
+

Owl Counter

+

+ Counter: +

+ +
+
+
+ diff --git a/awesome_owl/static/src/main.js b/awesome_owl/static/src/main.js index 1aaea902b55..676a2d1a86a 100644 --- a/awesome_owl/static/src/main.js +++ b/awesome_owl/static/src/main.js @@ -3,8 +3,8 @@ import { mountComponent } from "@web/env"; import { Playground } from "./playground"; const config = { - dev: true, - name: "Owl Tutorial" + dev: true, + name: "Owl Tutorial" }; // Mount the Playground component when the document.body is ready diff --git a/awesome_owl/static/src/playground.js b/awesome_owl/static/src/playground.js index 4ac769b0aa5..d22585ea73a 100644 --- a/awesome_owl/static/src/playground.js +++ b/awesome_owl/static/src/playground.js @@ -1,5 +1,17 @@ -import { Component } from "@odoo/owl"; +import { Component, useState } from "@odoo/owl"; +import { Counter } from "./counter/counter" +import { Card } from "./card/card" +import { TodoList } from "./todo/todo_list"; export class Playground extends Component { - static template = "awesome_owl.playground"; + static template = "awesome_owl.playground" + static components = { Counter, Card, TodoList }; + + setup() { + this.state = useState({ sum: 0 }); + } + + updateSum() { + this.state.sum++; + } } diff --git a/awesome_owl/static/src/playground.xml b/awesome_owl/static/src/playground.xml index 4fb905d59f9..9bf15e3141f 100644 --- a/awesome_owl/static/src/playground.xml +++ b/awesome_owl/static/src/playground.xml @@ -1,10 +1,20 @@ - -
- hello world + + +
+ + + +
+

Todo

+
+ +
- + diff --git a/awesome_owl/static/src/todo/todo_item.js b/awesome_owl/static/src/todo/todo_item.js new file mode 100644 index 00000000000..78b9e1c8d22 --- /dev/null +++ b/awesome_owl/static/src/todo/todo_item.js @@ -0,0 +1,11 @@ +import { Component } from "@odoo/owl"; + +export class TodoItem extends Component { + static template = "awesome_owl.todo_item"; + + static props = { + todo: Object, + toggleState: Function, + removeTodo: Function, + }; +} diff --git a/awesome_owl/static/src/todo/todo_item.xml b/awesome_owl/static/src/todo/todo_item.xml new file mode 100644 index 00000000000..e27b87d4787 --- /dev/null +++ b/awesome_owl/static/src/todo/todo_item.xml @@ -0,0 +1,30 @@ + + + +
+ +
+ + + # + +
+ +
+ + Done + + + Pending + + +
+
+
+ +
diff --git a/awesome_owl/static/src/todo/todo_list.js b/awesome_owl/static/src/todo/todo_list.js new file mode 100644 index 00000000000..c8b0c0b1200 --- /dev/null +++ b/awesome_owl/static/src/todo/todo_list.js @@ -0,0 +1,49 @@ +import { Component, useState, useRef, onMounted } from "@odoo/owl"; +import { TodoItem } from "../todo/todo_item"; + +export class TodoList extends Component { + static template = "awesome_owl.todo_list"; + static components = { TodoItem }; + + setup() { + this.items = useState([{ id: 1, description: "Buy milk", isCompleted: true }]); + this.nextId = 2; + this.inputRef = useRef("input"); + + onMounted(() => { + if (this.inputRef.el) this.inputRef.el.focus(); + }); + } + + createItem(ev) { + if (ev.key === "Enter") { + const description = ev.target.value.trim(); + + if (!description) { + return; + } + + this.items.push({ + id: this.nextId++, + description: description, + isCompleted: false + }); + + ev.target.value = ""; + } + } + + toggleItem(item_id) { + const todo = this.items.find(t => t.id === item_id); + if (todo) { + todo.isCompleted = !todo.isCompleted; + } + } + + deleteItem(item_id) { + const index = this.items.findIndex((t) => t.id === item_id); + if (index >= 0) { + this.items.splice(index, 1); + } + } +} diff --git a/awesome_owl/static/src/todo/todo_list.xml b/awesome_owl/static/src/todo/todo_list.xml new file mode 100644 index 00000000000..3d354575829 --- /dev/null +++ b/awesome_owl/static/src/todo/todo_list.xml @@ -0,0 +1,27 @@ + + + +
+ +
+ +
+ + + + + + + +

You currently have on tasks.

+
+
+
+
diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000000..26df8ffc370 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,84 @@ +# automatically generated file by the runbot nightly ruff checks, do not modify +# for ruff version 0.15.0 (or higher) +# note: 'E241', 'E272', 'E201', 'E221' are ignored on runbot in test files when formating a table like structure (more than two space) +# some rules present here are not enabled on runbot (yet) but are still advised to follow when possible : ["B904", "COM812", "E741", "EM101", "I001", "RET", "RUF021", "RUF102", "TRY002", "UP006", "UP007"] + + +target-version = "py310" + +[lint] +preview = true +external = ["OLS"] +select = [ + "BLE", # flake8-blind-except + "C", # flake8-comprehensions + "COM", # flake8-commas + "E", # pycodestyle Error + "EM", # flake8-errmsg + "EXE", # flake8-executable + "F", # Pyflakes + "FA", # flake8-future-annotations + "FLY", # flynt + "G", # flake8-logging-format + "I", # isort + "ICN", # flake8-import-conventions + "INT", # flake8-gettext + "ISC", # flake8-implicit-str-concat + "LOG", # flake8-logging + "PGH", # pygrep-hooks + "PIE", # flake8-pie + "PLC", # Pylint Convention + "PLE", # Pylint Error + "PLW", # Pylint Warning + "PYI", # flake8-pyi + "RET", # flake8-return + "RUF", # Ruff-specific rules + "SIM", # flake8-simplify + "SLOT", # flake8-slots + "T", # flake8-print + "TC", # flake8-type-checking + "TID", # flake8-tidy-imports + "TRY", # tryceratops + "UP", # pyupgrade + "W", # pycodestyle Warning + "YTT", # flake8-2020 +] +ignore = [ + "C408", # unnecessary-collection-call + "C420", # unnecessary-dict-comprehension-for-iterable + "C901", # complex-structure + "E266", # multiple-leading-hashes-for-block-comment + "E501", # line-too-long + "E713", # not-in-test + "EM102", # f-string-in-exception + "FA100", # future-rewritable-type-annotation + "PGH003", # blanket-type-ignore + "PIE790", # unnecessary-placeholder + "PIE808", # unnecessary-range-start + "PLC2701", # import-private-name + "PLW2901", # redefined-loop-name + "RUF001", # ambiguous-unicode-character-string + "RUF005", # collection-literal-concatenation + "RUF012", # mutable-class-default + "RUF067", # non-empty-init-module + "RUF100", # unused-noqa + "SIM102", # collapsible-if + "SIM108", # if-else-block-instead-of-if-exp + "SIM117", # multiple-with-statements + "TID252", # relative-imports + "TRY003", # raise-vanilla-args + "TRY300", # try-consider-else + "TRY400", # error-instead-of-exception + "UP031", # printf-string-formatting +] + +[lint.per-file-ignores] +"**/__init__.py" = [ + "F401", # unused-import +] + +[lint.isort] +# https://www.odoo.com/documentation/latest/contributing/development/coding_guidelines.html#imports +section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] +known-first-party = ["odoo"] +known-local-folder = ["odoo.addons"]