-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[ADD] estate: Real Estate Property Management Module #889
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
aarp-odoo
wants to merge
12
commits into
odoo:18.0
Choose a base branch
from
odoo-dev:18.0-tutorials-aarp
base: 18.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 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
291e43d
[ADD] estate: create a real estate app with basic models using Object…
aarp-odoo 066933b
[IMP] estate: implement the basic `estate.property` with required fie…
aarp-odoo 163a7e8
[IMP] estate: create a real estate app with basic models, views, and …
aarp-odoo f992186
[IMP] estate: fix linting issues and improve code formatting as per O…
aarp-odoo 0f74440
[IMP] estate: implement only one offer can be accepted and create inv…
aarp-odoo 270300f
[ADD] awesome_owl: implement counter, card components and todo list i…
aarp-odoo 9cb4c74
[IMP] awesome_owl: implement add & delete task functionality in todo …
aarp-odoo 4a0880f
[IMP] estate, awesome_owl: mark property as sold only if accepted off…
aarp-odoo 22e9d19
[IMP] awesome_owl, awesome_dashboard: implement cards with slots and …
aarp-odoo f31960e
[IMP] awesome_dashboard: implement dashboard layout, memoized RPC, pi…
aarp-odoo 33668c7
[IMP] awesome_dashboard: Implement real life update, lazy loading and…
aarp-odoo 05c1a02
[IMP] awesome_dashboard: make dashboard extensible and implement pers…
aarp-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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Component } from "@odoo/owl"; | ||
|
||
export class Card extends Component { | ||
static template = "awesome_owl.Card" | ||
static props = { | ||
title: { | ||
type: String, | ||
}, | ||
content: { | ||
type: String, | ||
} | ||
} | ||
} |
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,15 @@ | ||
<?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-esc="props.title"/> | ||
</h5> | ||
<p class="card-text"> | ||
<t t-out="props.content"/> | ||
</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,25 @@ | ||
import { Component, useState } from "@odoo/owl"; | ||
|
||
export class Counter extends Component { | ||
static template = "awesome_owl.Counter"; | ||
static props = { | ||
title: { | ||
type: String, | ||
}, | ||
onChange: { | ||
type: Function, | ||
optional: true, | ||
} | ||
} | ||
|
||
setup() { | ||
this.state = useState({ value: 1 }); | ||
} | ||
|
||
increment() { | ||
this.state.value++; | ||
if (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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates xml:space="preserve"> | ||
<t t-name="awesome_owl.Counter"> | ||
<div class="d-flex align-items-center border p-4 gap-4"> | ||
<p class="mb-0"> | ||
<t t-esc="props.title"/>: <t t-esc="state.value"></t> | ||
</p> | ||
<button class="btn btn-primary text-white" style="background: #714b67" 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
/** @odoo-module **/ | ||
|
||
import { Component } from "@odoo/owl"; | ||
import { Component, useState, markup } 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 components = { Counter, Card, TodoList } | ||
html = ('<h3>hello world</h3>'); | ||
markup_html = markup(this.html); | ||
|
||
setup() { | ||
this.state = useState({ sum: 2 }); | ||
} | ||
|
||
incrementSum() { | ||
this.state.sum++; | ||
} | ||
} |
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,30 @@ | ||
import { Component, useState } 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, | ||
} | ||
}, | ||
toggleTaskState: { | ||
type: Function, | ||
}, | ||
taskDelete: { | ||
type: Function, | ||
} | ||
|
||
} | ||
|
||
toggleTaskState() { | ||
this.props.toggleTaskState(this.props.todo.id); | ||
} | ||
|
||
taskDelete() { | ||
this.props.taskDelete(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="d-flex align-items-center gap-2"> | ||
<input t-att-id="props.todo.id" type="checkbox" class="form-check-input mb-2" t-att-checked="props.todo.isCompleted" t-on-change="toggleTaskState"/> | ||
<div class="d-flex mb-1 p-1 ps-2 flex-grow-1" t-att-for="props.todo.id" t-att-style="!props.todo.isCompleted ? 'border-radius: 8px; background: #eaeaea;' : ''" t-att-class="{'text-muted text-decoration-line-through': props.todo.isCompleted}"> | ||
<span class="pe-2" style="border-right: 1px solid #999;"><t t-esc="props.todo.id"></t>.</span> | ||
<span class="ms-2"><t t-esc="props.todo.description"></t></span> | ||
</div> | ||
<span class="fa fa-trash-o text-danger mb-2" t-on-click="taskDelete"/> | ||
</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,38 @@ | ||
import { Component, useState } 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 } | ||
id = 1; | ||
|
||
setup () { | ||
this.todos = useState([]); | ||
useAutoFocus(); | ||
} | ||
|
||
addTask(event) { | ||
const { target: { value }, keyCode } = event; | ||
if (keyCode != 13 || !value.trim()) return; | ||
this.todos.push({ | ||
id: this.id++, | ||
description: value, | ||
isCompleted: false, | ||
}); | ||
event.target.value = ''; | ||
} | ||
|
||
toggleTaskState(todo_id) { | ||
const task = this.todos.find((t) => t.id === todo_id); | ||
if (!task) return; | ||
task.isCompleted = !task.isCompleted; | ||
} | ||
|
||
taskDelete(todo_id) { | ||
const taskIndex = this.todos.findIndex((t) => t.id === todo_id) | ||
if (taskIndex >= 0) { | ||
this.todos.splice(taskIndex, 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"> | ||
<div class="border p-2 m-5" style="width: 400px;"> | ||
<h3 class="mb-3">Todo List</h3> | ||
<input id="task-entry" placeholder="Enter a new task" class="form-control mb-3" t-on-keyup="addTask" t-ref="focus-input"></input> | ||
<t t-foreach="todos" t-as="todo" t-key="todo.id"> | ||
<TodoItem todo="todo" toggleTaskState.bind="toggleTaskState" taskDelete.bind="taskDelete"/> | ||
</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,8 @@ | ||
import { useRef, onMounted } from "@odoo/owl"; | ||
|
||
export const useAutoFocus = () => { | ||
const inputRef = useRef("focus-input"); | ||
onMounted(() => { | ||
inputRef.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 @@ | ||
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,21 @@ | ||
{ | ||
'name': 'Real Estate', | ||
'description': 'Real Estate Application.', | ||
'summary': 'Real Estate Application for beginner.', | ||
'depends': ['base'], | ||
'author': 'Aaryan Parpyani (aarp)', | ||
'category': 'Tutorials/RealEstate', | ||
'version': '1.0', | ||
'application': True, | ||
'installable': True, | ||
'license': 'LGPL-3', | ||
'data': [ | ||
'views/estate_property_offer_views.xml', | ||
'views/estate_property_type_views.xml', | ||
'views/estate_property_tags_views.xml', | ||
'views/res_users_views.xml', | ||
'views/estate_property_views.xml', | ||
'views/estate_menus_views.xml', | ||
'security/ir.model.access.csv', | ||
] | ||
} |
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 inherited_user |
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 the end of the file.