-
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 35 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
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
| 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
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; | ||
| } | ||
| } |
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,19 @@ | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Card"> | ||
| <div class="card d-inline-block m-2" style="width: 18rem;"> | ||
| <div class="card-header d-flex justify-content-between align-items-center"> | ||
| <h5 class="card-title mb-0"> | ||
| <t t-out="props.title"/> | ||
| </h5> | ||
| <button class="btn btn-sm btn-outline-primary" t-on-click="toggle"> | ||
| <t t-out="state.open ? 'Hide' : 'Show'"/> | ||
| </button> | ||
| </div> | ||
|
|
||
| <div class="card-body" t-if="state.open"> | ||
| <!-- Default slot for arbitrary content --> | ||
| <t t-slot="default"/> | ||
| </div> | ||
| </div> | ||
| </t> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { Component, useState } from "@odoo/owl"; | ||
|
|
||
| export class Counter extends Component { | ||
| static template = "awesome_owl.Counter"; | ||
|
|
||
| static props = { | ||
| onChange: { type: Function, optional: true }, // optional callback | ||
| }; | ||
|
|
||
| setup() { | ||
| this.state = useState({ value: 0 }); | ||
| } | ||
|
|
||
| increment() { | ||
| this.state.value++; | ||
|
|
||
| if (this.props.onChange) { | ||
| this.props.onChange(this.state.value); | ||
| } | ||
| } | ||
| } |
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,11 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Counter"> | ||
| <div class="p-3"> | ||
| <span>Counter: <t t-out="state.value"/></span> | ||
| <button class="btn btn-primary ms-2" t-on-click="increment"> | ||
| Increment | ||
| </button> | ||
| </div> | ||
| </t> | ||
| </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,5 +1,9 @@ | ||
| import { Component } from "@odoo/owl"; | ||
| import { TodoList } from "./todo/todo_list"; | ||
| import { Card } from "./card/card"; | ||
| import { Counter } from "./counter/counter"; | ||
|
|
||
| export class Playground extends Component { | ||
| static template = "awesome_owl.playground"; | ||
| } | ||
| static template = "awesome_owl.Playground"; | ||
| static components = { TodoList, Card, Counter }; | ||
| } |
jupao-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
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,10 +1,21 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Playground"> | ||
| <div class="p-3"> | ||
|
|
||
| <t t-name="awesome_owl.playground"> | ||
| <div class="p-3"> | ||
| hello world | ||
| </div> | ||
| </t> | ||
| <!-- Card with normal content --> | ||
| <Card title="'Simple Card'"> | ||
| <p>Just a basic text card.</p> | ||
| </Card> | ||
|
|
||
| </templates> | ||
| <!-- Card containing a Counter component --> | ||
| <Card title="'Counter Card'"> | ||
| <Counter/> | ||
| </Card> | ||
|
|
||
| <!-- Card with multiple components --> | ||
| <Card title="'Multiple Items'"> | ||
| <Counter/> | ||
| <p>Some extra text beacause, I can.</p> | ||
| </Card> | ||
|
|
||
| </div> | ||
| </t> |
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,29 @@ | ||
| import { Component } from "@odoo/owl"; | ||
|
|
||
| export class TodoItem extends Component { | ||
| static template = "awesome_owl.TodoItem"; | ||
|
|
||
| static props = { | ||
| // Define a shape for the todo object | ||
| todo: { | ||
| type: Object, | ||
| shape: { | ||
| id: { type: [String, Number], required: true }, | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| description: { type: String, required: true }, | ||
| isCompleted: { type: Boolean, required: true }, | ||
| }, | ||
| required: true, | ||
| }, | ||
| toggleState: { type: Function, required: true }, | ||
| removeTodo: { type: Function, required: true }, | ||
| }; | ||
|
|
||
| onCheckboxChange() { | ||
| // Call parent callback with the todo ID | ||
| this.props.toggleState(this.props.todo.id); | ||
| } | ||
|
|
||
| onRemoveClick() { | ||
| this.props.removeTodo(this.props.todo.id); | ||
| } | ||
| } | ||
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,38 @@ | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.TodoItem"> | ||
| <div class="mb-1 d-flex align-items-center"> | ||
|
|
||
| <!-- Checkbox --> | ||
| <input | ||
| type="checkbox" | ||
| class="me-2" | ||
| t-att-checked="props.todo.isCompleted" | ||
| t-on-change="onCheckboxChange" | ||
| /> | ||
|
|
||
| <!-- ID --> | ||
| <strong | ||
| class="me-2" | ||
| t-att-class="props.todo.isCompleted ? 'text-muted text-decoration-line-through' : ''" | ||
jupao-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| > | ||
| <t t-out="props.todo.id"/>: | ||
| </strong> | ||
|
|
||
| <!-- Description --> | ||
| <span | ||
| class="flex-grow-1" | ||
| t-att-class="props.todo.isCompleted ? 'text-muted text-decoration-line-through' : ''" | ||
| > | ||
| <t t-out="props.todo.description"/> | ||
| </span> | ||
|
|
||
| <!-- Delete button --> | ||
| <button | ||
| type="button" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for this |
||
| class="fa fa-remove ms-2 text-danger btn btn-link p-0" | ||
| t-on-click="onRemoveClick" | ||
| aria-label="Remove todo" | ||
| ></button> | ||
| </div> | ||
| </t> | ||
| </templates> | ||
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.