-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[ADD] estate: implement core estate management features #1108
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
Draft
radet-odoo
wants to merge
21
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorials-radet
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.
Draft
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
987e6c2
[ADD] estate: initial module setup and ORM configuration
radet-odoo a94c3cd
[ADD] estate: add access rights for user groups
radet-odoo 8a7b04c
[ADD] estate: add UI actions, menus and defaults
radet-odoo 3981aa4
[FIX] runbot: fix checkpoints error
radet-odoo 0bee4ea
[IMP] estate: add custom list, form, and search views
radet-odoo 464369e
[IMP] Add many2one relation between two tables
radet-odoo 359d3d5
[IMP] estate: add many2many and one2many relations to properties
radet-odoo 9d74e9c
[IMP] estate: computed fields and onchanges
radet-odoo 163c6d9
[IMP] estate: add action buttons for property and offer states
radet-odoo dff1b27
[IMP] estate: enforce business rules using constraints
radet-odoo 6bef477
[IMP] estate: improve UI with inline views and widgets
radet-odoo 5bb4895
[IMP] estate: enhance UI with views and visual cues
radet-odoo a8b4338
[IMP] estate: add inheritance and core business rules
radet-odoo dadd893
[ADD] estate_account: integrate invoicing on property sale
radet-odoo 1f06294
[IMP] estate: add kanban view for properties
radet-odoo 53bd7f4
[ADD] awesome_owl: add Owl component examples in playground
radet-odoo 460982a
[ADD] awesome_owl: counters callbacks and todo list examples
radet-odoo 0865c83
[ADD] awesome_owl: generic Card with slots and toggle
radet-odoo e7d363e
[ADD] awesome_dashboard: navigation buttons and dashboard items
radet-odoo cbc433d
[IMP] awesome_dashboard: statistics, caching, charts
radet-odoo 2ff80f3
[IMP] awesome_dashboard: lazy, generic & extensible dashboard
radet-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 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,35 @@ | ||
| import { Component } from "@odoo/owl"; | ||
| import { registry } from "@web/core/registry"; | ||
| import { Layout } from "@web/search/layout"; | ||
| import { useService } from "@web/core/utils/hooks"; | ||
| import { DashboardItem } from "./dashboard_item/dashboard_item"; | ||
|
|
||
| class AwesomeDashboard extends Component { | ||
| static template = "awesome_dashboard.AwesomeDashboard"; | ||
| static components = { Layout, DashboardItem }; | ||
|
|
||
| setup() { | ||
| this.action = useService("action"); | ||
| this.display = { | ||
| controlPanel: {}, | ||
| }; | ||
| } | ||
|
|
||
| openCustomerView() { | ||
| this.action.doAction("base.action_partner_form"); | ||
| } | ||
|
|
||
| openLeads() { | ||
| this.action.doAction({ | ||
| type: "ir.actions.act_window", | ||
| name: "All leads", | ||
| res_model: "crm.lead", | ||
| views: [ | ||
| [false, "list"], | ||
| [false, "form"], | ||
| ], | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboard); |
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,3 @@ | ||
| .o_dashboard { | ||
| background-color: black; | ||
| } | ||
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
18 changes: 18 additions & 0 deletions
18
awesome_dashboard/static/src/dashboard_item/dashboard_item.js
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 } from "@odoo/owl"; | ||
|
|
||
| export class DashboardItem extends Component { | ||
| static template = "awesome_dashboard.DashboardItem" | ||
| static props = { | ||
| slots: { | ||
| type: Object, | ||
| shape: { | ||
| default: Object | ||
| }, | ||
| }, | ||
| size: { | ||
| type: Number, | ||
| default: 1, | ||
| optional: true, | ||
| }, | ||
| }; | ||
| } |
10 changes: 10 additions & 0 deletions
10
awesome_dashboard/static/src/dashboard_item/dashboard_item.xml
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,10 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_dashboard.DashboardItem"> | ||
| <div class="card m-2 border-dark" t-attf-style="width: {{18*props.size}}rem;"> | ||
| <div class="card-body"> | ||
| <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,22 @@ | ||
| import { Component, useState } from "@odoo/owl"; | ||
|
|
||
| export class Card extends Component { | ||
| static template = "awesome_owl.Card"; | ||
| static props = { | ||
| title: String, | ||
| slots: { | ||
| type: Object, | ||
| shape: { | ||
| default: true | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| setup() { | ||
| this.state = useState({ isOpen: true }); | ||
| } | ||
|
|
||
| toggleContent() { | ||
| this.state.isOpen = !this.state.isOpen; | ||
| } | ||
| } |
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 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Card"> | ||
| <div class="card d-inline-block m-2" style="width: 18rem;"> | ||
| <div class="card-body"> | ||
| <h5 class="card-title"> | ||
| <t t-out="props.title"/> | ||
| <button class="btn" t-on-click="toggleContent"> | ||
| <t t-if="state.isOpen">Hide</t> | ||
| <t t-else="">Show</t> | ||
| </button> | ||
| </h5> | ||
| <p class="card-text" t-if="state.isOpen"> | ||
| <t t-slot="default"/> | ||
| </p> | ||
| </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,17 @@ | ||
| import { Component, useState } from "@odoo/owl"; | ||
|
|
||
| export class Counter extends Component { | ||
| static template = "awesome_owl.Counter"; | ||
| static props = { | ||
| onChange: { type: Function, optional: true } | ||
| }; | ||
|
|
||
| setup() { | ||
| this.state = useState({ value: 0 }); | ||
| } | ||
|
|
||
| increment() { | ||
| this.state.value = this.state.value + 1; | ||
| this.props.onChange && this.props.onChange() | ||
| } | ||
| } |
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,10 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Counter"> | ||
| <div class="m-2 border d-inline-block"> | ||
| <button class="btn btn-primary bg-success-subtle" t-on-click="increment"> | ||
| Pressed <t t-esc="state.value"/> Times | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,20 @@ | ||
| import { Component } from "@odoo/owl"; | ||
| import { Component, markup, useState } from "@odoo/owl"; | ||
| import { Counter } from "./counter/counter" | ||
| import { Card } from "./card/card"; | ||
| import { TodoList } from "./todo_list/todo_list" | ||
|
|
||
| export class Playground extends Component { | ||
| static template = "awesome_owl.playground"; | ||
| static components = { Counter, Card, TodoList }; | ||
|
|
||
| setup() { | ||
| this.str1 = "<div class='text-primary'>some content</div>"; | ||
| this.str2 = markup("<div class='text-primary'>some content</div>"); | ||
| this.sum = useState({ value: 0 }) | ||
| this.incrementSum = this.incrementSum.bind(this); | ||
| } | ||
|
|
||
| incrementSum() { | ||
| this.sum.value += 1 | ||
| } | ||
| } |
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,21 @@ | ||
| import { Component } from "@odoo/owl"; | ||
|
|
||
| export class TodoItem extends Component { | ||
| static template = "awesome_owl.TodoItem"; | ||
| static props = { | ||
| todo: { | ||
| type: Object, | ||
| shape: { id: Number, description: String, isCompleted: Boolean } | ||
| }, | ||
| toggleState: Function, | ||
| removeTodo: Function | ||
| }; | ||
|
|
||
| onChange() { | ||
| this.props.toggleState(this.props.todo.id) | ||
| } | ||
|
|
||
| onDelete() { | ||
| 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,13 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.TodoItem"> | ||
| <div class="form-check"> | ||
| <input class="form-check-input" type="checkbox" t-att-id="props.todo.id" t-att-checked="props.todo.isCompleted" t-on-change="onChange"/> | ||
| <label t-att-for="props.todo.id" t-att-class="props.todo.isCompleted ? 'text-decoration-line-through text-muted' : '' "> | ||
| <t t-esc="props.todo.id"/>. | ||
| <t t-esc="props.todo.description"/> | ||
| </label> | ||
| <span class="fa fa-remove ms-3 text-danger" t-on-click="onDelete"/> | ||
| </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,36 @@ | ||
| import { Component, useState, useRef } from "@odoo/owl"; | ||
| import { TodoItem } from "./todo_item"; | ||
| import { useAutofocus } from "../utils"; | ||
|
|
||
| export class TodoList extends Component { | ||
| static template = "awesome_owl.TodoList"; | ||
| static components = { TodoItem }; | ||
|
|
||
| setup() { | ||
| this.todos = useState([]) | ||
| this.id = 1 | ||
| this.inputRef = useRef("input"); | ||
| useAutofocus(this.inputRef); | ||
| this.removeTodo = this.removeTodo.bind(this) | ||
| } | ||
|
|
||
| addTodo(e){ | ||
| if (e.keyCode === 13 && e.target.value.trim()) { | ||
| this.todos.push({ | ||
| id: this.id++, | ||
| description: e.target.value, | ||
| isCompleted: false | ||
| }); | ||
| e.target.value = ""; | ||
| } | ||
| } | ||
|
|
||
| toggleState(id) { | ||
| const todo = this.todos.find(todo => todo.id === id) | ||
| todo.isCompleted = !todo.isCompleted | ||
| } | ||
|
|
||
| removeTodo(id) { | ||
| this.todos.splice(this.todos.findIndex((todo) => todo.id === id), 1) | ||
| } | ||
| } |
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,12 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.TodoList"> | ||
| <h2>Todo List</h2> | ||
| <div class="d-inline-block border p-2 m-2"> | ||
| <input type="text" placeholder="Enter a new task" t-on-keyup="addTodo" t-ref="input" /> | ||
| <t t-foreach="todos" t-as="todo" t-key="todo.id"> | ||
| <TodoItem todo="todo" toggleState.bind="toggleState" removeTodo="removeTodo"/> | ||
| </t> | ||
| </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,9 @@ | ||
| import { onMounted } from "@odoo/owl"; | ||
|
|
||
| export function useAutofocus(ref) { | ||
| onMounted(() => { | ||
| if (ref.el) { | ||
| ref.el.focus(); | ||
| } | ||
| }); | ||
| } |
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 @@ | ||
| i18n/ |
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 @@ | ||
| from . import models |
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 @@ | ||
| { | ||
| 'name': 'Real Estate', | ||
| 'category': 'Real Estate', | ||
| 'version': '1.0', | ||
| 'author': 'Radhey Detroja(RADET)', | ||
| 'license': 'LGPL-3', | ||
| 'summary': 'Manage real estate properties', | ||
| 'depends': ['base', 'mail'], | ||
| 'application': True, | ||
| 'data': [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_property_offer_views.xml', | ||
| 'views/estate_property_type_views.xml', | ||
| 'views/estate_property_tag_views.xml', | ||
| 'views/res_users_views.xml', | ||
| 'views/estate_menus.xml', | ||
| ] | ||
| } |
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,5 @@ | ||
| from . import estate_property | ||
| from . import estate_property_type | ||
| from . import estate_property_tag | ||
| from . import estate_property_offer | ||
| from . import res_users |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be One empty line at EOF.