-
Notifications
You must be signed in to change notification settings - Fork 3k
[IMP] awesomeclicker: add editor metadata in Python file #1173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jupao-odoo
wants to merge
50
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-add-editor-awesomeclicker-jupao
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 41 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
9a8f241
[IMP] awesomeclicker: add editor metadata in Python file
jupao-odoo 169daed
[ADD] estate: initialize tutorial
jupao-odoo aa17f8b
[ADD] estate: define list, form and search views for properties
jupao-odoo e44c44e
[IMP] estate: add property types, tags and offers models
jupao-odoo 7b475b6
[IMP] estate: chapter 8 - computed fields and onchange
jupao-odoo 8b7b934
[REF] estate: add action buttons for properties and offers
jupao-odoo 1b855f7
[REF] estate: add Python constraints for data consistency
jupao-odoo e30a69a
[IMP] estate: enhance property views, search and stats
jupao-odoo 4508a76
[IMP] estate: add business logic on CRUD + inherit res.users with pro…
jupao-odoo 71d9a81
[CLN] estate: ignore local config files
jupao-odoo 2cc58a4
[FIX] estate: several fixes from PR remarks
jupao-odoo 9b65e0a
[REF] estate_account: link estate and account, create invoices on pro…
jupao-odoo a2af77e
[IMP] estate: add kanban view for properties
jupao-odoo c0cc56a
[FIX] module_name: address PR feedback
jupao-odoo 1fc90ff
[FIX] estate_account: restore correct invoice price and add license
jupao-odoo 98b250c
[FIX] estate: apply PR review feedback
jupao-odoo 3304ef2
[CLN] estate: fix code style and formatting
jupao-odoo 3028c94
[FIX] ci: fix failing CI pipeline
jupao-odoo dffa3b2
[FIX] estate: remove unused elements from Kanban view
jupao-odoo e205ffa
[FIX] estate_account: correct admin fees and use float_compare
jupao-odoo 3b255e1
[FIX] estate: keep status field invisible for offer decorations
jupao-odoo f7c72e6
[FIX] estate: remove invisible columns from view
jupao-odoo 7b20935
[IMP] awesome_owl: add reactive counter in Playground component
jupao-odoo baeca0a
[ADD] awesome_owl: introduce reusable Card component with props
jupao-odoo 7c23553
[IMP] awesome_owl: support HTML content in Card component
jupao-odoo 3b625a7
[IMP] awesome_owl: add props validation to Card component
jupao-odoo 65b7c35
[IMP] awesome_owl: implement sum of two Counter components via callba…
jupao-odoo 1c84d45
[ADD] awesome_owl: implement TodoList and TodoItem components with dy…
jupao-odoo 5fe6e52
[IMP] awesome_owl: allow adding new todos in TodoList
jupao-odoo 06b7abd
[FIX] awesome_owl: correct issues in Card and Counter components
jupao-odoo 3293cbc
[FIX] awesome_owl: fix Card component and EstateProperty issues
jupao-odoo c5e2e5c
[IMP] awesome_owl: add autofocus, toggle, and delete features to Todo…
jupao-odoo 6304f12
[IMP] awesome_owl: make Card generic with slots and add toggle feature
jupao-odoo 8b8b108
[FIX] estate: fix flake8 errors in estate_property
jupao-odoo 4ac34d7
[FIX] awesome_owl & estate: fix TodoList, TodoItem, utils, Card, and …
jupao-odoo a513edc
[FIX] awesome_owl : fix component and property issues
jupao-odoo 173ddac
[FIX] awesome_owl : fix component and property issues
jupao-odoo d05103d
[IMP] awesome_dashboard: add Layout to AwesomeDashboard
jupao-odoo ed4ed74
[IMP] awesome_dashboard: add quick navigation buttons with action ser…
jupao-odoo 4f5dce2
[ADD] awesome_dashboard: introduce reusable DashboardItem component
jupao-odoo 65c7bc2
[IMP] awesome_dashboard: fetch and display dashboard statistics
jupao-odoo bc8312e
[IMP] awesome_dashboard: cache statistics with dedicated service
jupao-odoo d296649
[REF] awesome_dashboard: move control panel buttons to Layout slot
jupao-odoo ce585d6
[ADD] awesome_dashboard: add PieChart component with lazy-loaded Char…
jupao-odoo 4b4f0bb
[IMP] awesome_dashboard: add live refresh to statistics service
jupao-odoo be259d0
[IMP] awesome_dashboard: enable lazy loading for dashboard
jupao-odoo 483bd50
[REF] awesome_dashboard: make dashboard generic with dynamic items
jupao-odoo 08f9b67
[IMP] awesome_dashboard: make dashboard extensible with registry
jupao-odoo df82d76
[IMP] awesome_dashboard: add customizable dashboard items with local …
jupao-odoo 492ac07
[REF] awesome_dashboard: remove unnecessary @odoo-module headers
jupao-odoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import controllers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,80 @@ | ||
| import { Component } from "@odoo/owl"; | ||
| import { Component, onWillStart, useState } from "@odoo/owl"; | ||
| import { registry } from "@web/core/registry"; | ||
| import { Layout } from "@web/search/layout"; | ||
| import { useService } from "@web/core/utils/hooks"; | ||
| import { rpc } from "@web/core/network/rpc"; | ||
|
|
||
| /* --------------------------- | ||
| Dashboard Item | ||
| ----------------------------*/ | ||
| class DashboardItem extends Component { | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| static template = "awesome_dashboard.DashboardItem"; | ||
| static props = { | ||
| size: { type: Number, optional: true }, | ||
| }; | ||
|
|
||
| get width() { | ||
| const size = this.props.size || 1; | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return `width: ${18 * size}rem`; | ||
| } | ||
| } | ||
|
|
||
| /* --------------------------- | ||
| Main Dashboard | ||
| ----------------------------*/ | ||
| class AwesomeDashboard extends Component { | ||
| static template = "awesome_dashboard.AwesomeDashboard"; | ||
| static components = { DashboardItem }; | ||
|
|
||
| setup() { | ||
| this.action = useService("action"); | ||
|
|
||
| this.state = useState({ | ||
| stats: null, | ||
| }); | ||
|
|
||
| onWillStart(async () => { | ||
| this.state.stats = await rpc( | ||
| "/awesome_dashboard/statistics", | ||
| {} | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| openCustomers() { | ||
| this.action.doAction("base.action_partner_form"); | ||
| } | ||
|
|
||
| openLeads() { | ||
| this.action.doAction({ | ||
| type: "ir.actions.act_window", | ||
| name: "Leads", | ||
| res_model: "crm.lead", | ||
| views: [ | ||
| [false, "list"], | ||
| [false, "form"], | ||
| ], | ||
| target: "current", | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| /* --------------------------- | ||
| Layout Wrapper | ||
| ----------------------------*/ | ||
| class AwesomeDashboardWrapper extends Component { | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| static template = "awesome_dashboard.AwesomeDashboardWrapper"; | ||
| static components = { Layout, AwesomeDashboard }; | ||
|
|
||
| get layoutProps() { | ||
| return { | ||
| controlPanel: {}, | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| className: "o_dashboard h-100", | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboard); | ||
| registry.category("actions").add( | ||
| "awesome_dashboard.dashboard", | ||
| AwesomeDashboardWrapper | ||
| ); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .o_dashboard { | ||
| background-color: grey; | ||
| } | ||
|
|
||
| .o_dashboard .card { | ||
| border-radius: 12px; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,77 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
|
|
||
| <!-- Layout Wrapper --> | ||
| <t t-name="awesome_dashboard.AwesomeDashboardWrapper"> | ||
| <Layout t-props="layoutProps"> | ||
| <AwesomeDashboard/> | ||
| </Layout> | ||
| </t> | ||
|
|
||
| <!-- Reusable Card --> | ||
| <t t-name="awesome_dashboard.DashboardItem"> | ||
| <div class="card shadow-sm m-2" | ||
| t-att-style="width"> | ||
| <div class="card-body"> | ||
| <t t-slot="default"/> | ||
| </div> | ||
| </div> | ||
| </t> | ||
|
|
||
| <!-- Dashboard Content --> | ||
| <t t-name="awesome_dashboard.AwesomeDashboard"> | ||
| hello dashboard | ||
|
|
||
| <!-- 🔹 Navigation Buttons --> | ||
| <div class="d-flex gap-3 p-3"> | ||
| <button class="btn btn-primary" | ||
| t-on-click="openCustomers"> | ||
| Customers | ||
| </button> | ||
|
|
||
| <button class="btn btn-secondary" | ||
| t-on-click="openLeads"> | ||
| Leads | ||
| </button> | ||
| </div> | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <!-- 🔹 Statistics --> | ||
| <div class="d-flex flex-wrap px-3" | ||
| t-if="state.stats"> | ||
|
|
||
| <DashboardItem> | ||
| <h6>New Orders</h6> | ||
| <h3><t t-esc="state.stats.nb_new_orders"/></h3> | ||
| <small>This month</small> | ||
| </DashboardItem> | ||
|
|
||
| <DashboardItem> | ||
| <h6>Total Amount</h6> | ||
| <h3><t t-esc="state.stats.total_amount"/></h3> | ||
| <small>This month</small> | ||
| </DashboardItem> | ||
|
|
||
| <DashboardItem> | ||
| <h6>Avg T-Shirts / Order</h6> | ||
| <h3><t t-esc="state.stats.average_quantity"/></h3> | ||
| </DashboardItem> | ||
|
|
||
| <DashboardItem> | ||
| <h6>Cancelled Orders</h6> | ||
| <h3><t t-esc="state.stats.nb_cancelled_orders"/></h3> | ||
| <small>This month</small> | ||
| </DashboardItem> | ||
|
|
||
| <DashboardItem size="2"> | ||
| <h6>Avg Processing Time (hours)</h6> | ||
| <h3><t t-esc="state.stats.average_time"/></h3> | ||
| </DashboardItem> | ||
|
|
||
| </div> | ||
|
|
||
| <!-- Loading State --> | ||
| <div t-else="" class="p-5 text-center"> | ||
| Loading statistics... | ||
| </div> | ||
|
|
||
| </t> | ||
|
|
||
| </templates> | ||
| </templates> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import controllers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import controllers |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { Component, useState } from "@odoo/owl"; | ||
|
|
||
| export class Card extends Component { | ||
| static template = "awesome_owl.Card"; | ||
|
|
||
| static props = { | ||
| title: String, | ||
| slots: { type: Object, optional: true }, | ||
| }; | ||
|
|
||
| setup() { | ||
| this.state = useState({ open: true }); | ||
| } | ||
|
|
||
| toggle() { | ||
| this.state.open = !this.state.open; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.