-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[ADD] estate : real estate module implementation #1232
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
aykhu-odoo
wants to merge
17
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorials-estate-aykhu
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 all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
15bd5fa
[ADD] estate : implement estate module and estate_property table cre…
aykhu-odoo 52fa0f3
[IMP] estate : added access rights
aykhu-odoo 99d70a3
[IMP] estate: added action and menu
aykhu-odoo 53c0bc3
[IMP] estate: improved list view and form view
aykhu-odoo c83862c
[IMP] estate: Implemented model relations and search views
aykhu-odoo ff255a5
[IMP] estate: Added computed fields
aykhu-odoo d927193
[IMP] estate: Implemented onchange logic and validity with inverse fu…
aykhu-odoo 2018ac5
[IMP] estate: add state transition actions with validation
aykhu-odoo e47d710
[IMP] estate: add offer state actions and enforce single acceptance
aykhu-odoo 6fc1fcb
[IMP] estate: add SQL constraints for prices and uniqueness
aykhu-odoo cdba32e
[IMP] estate: enforce minimum selling price at 90% of expected
aykhu-odoo f4a48cc
[IMP] estate: ui improvements and stat button integration
aykhu-odoo fee412e
[IMP] estate: implement model and view inheritance
aykhu-odoo f00c08d
[IMP] estate: integrate accounting module and add kanban view
aykhu-odoo 5241d27
[IMP] estate: add visit scheduling and issue reporting
aykhu-odoo 54901bb
[IMP] estate: enhance offers workflow and UI improvements
aykhu-odoo 5fa3a74
[IMP] awesome_owl: complete Owl component tutorial (counter, todos, c…
aykhu-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,20 @@ | ||
| import { Component, useState } from "@odoo/owl"; | ||
|
|
||
| export class Card extends Component { | ||
| static template = "awesome_owl.Card"; | ||
|
|
||
| setup(){ | ||
| this.state = useState({ | ||
| isOpen: true, | ||
| }); | ||
| } | ||
|
|
||
| toggle() { | ||
| this.state.isOpen = !this.state.isOpen; | ||
| } | ||
|
|
||
| static props = { | ||
| title : String, | ||
| slots: Object, | ||
| } | ||
| } |
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 @@ | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Card"> | ||
| <div class="card m-3 d-inline-block shadow-sm"> | ||
| <div class="card-header"> | ||
| <t t-esc="props.title"/> | ||
| <button class="btn btn-secondary" t-on-click="toggle"> | ||
| <t t-if="state.isOpen">Hide</t> | ||
| <t t-else="">Show</t> | ||
| </button> | ||
| </div> | ||
| <t t-if="state.isOpen"> | ||
| <div class="card-body"> | ||
| <t t-slot="default"/> | ||
| </div> | ||
| </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,16 @@ | ||
| import { Component, useState } from "@odoo/owl"; | ||
|
|
||
| export class Counter extends Component { | ||
| static template = "awesome_owl.Counter"; | ||
|
|
||
| setup() { | ||
| this.state = useState({ value: 0 }); | ||
| } | ||
|
|
||
| increment() { | ||
| this.state.value++; | ||
| if (this.props.onincrement) { | ||
| this.props.onincrement(); | ||
| } | ||
| } | ||
| } | ||
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 @@ | ||
| <templates xml:space="preserve"> | ||
| <t t-name="awesome_owl.Counter"> | ||
| <div class="p-3"> | ||
| Counter: <t t-esc="state.value"/> | ||
| <button class="btn ms-3 bg-primary" 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,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 components = { Counter, Card, TodoList }; | ||
|
|
||
| setup() { | ||
| this.sum = useState({ value: 0 }); | ||
| } | ||
|
|
||
| incrementSum() { | ||
| this.sum.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 |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <templates xml:space="preserve"> | ||
|
|
||
| <t t-name="awesome_owl.playground"> | ||
| <Card title="'Counter Card'"> | ||
| <Counter onincrement.bind="incrementSum"/> | ||
| </Card> | ||
| <div class="p-3"> | ||
| hello world | ||
| <Counter onincrement.bind="incrementSum"/> | ||
| <Counter onincrement.bind="incrementSum"/> | ||
| "The sum is :" <t t-esc="sum.value"/> | ||
| </div> | ||
| <div> | ||
| <TodoList/> | ||
| </div> | ||
| </t> | ||
|
|
||
|
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. unneccary diff. |
||
| </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,14 @@ | ||
| <t t-name="awesome_owl.TodoList"> | ||
| Todo Input: <input type="text" name="desc" t-on-keyup="addTodo" t-model="inputValue.text" t-ref="InputValue"/> | ||
| <div> | ||
| <t t-foreach="todos" t-as="todo" t-key="todo.id"> | ||
| <TodoItem | ||
| id="todo.id" | ||
| description="todo.description" | ||
| isCompleted="todo.isCompleted" | ||
| toggleTodo = "toggleTodo" | ||
| removeTodo = "removeTodo" | ||
| /> | ||
| </t> | ||
| </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,21 @@ | ||
| import { Component } from "@odoo/owl"; | ||
|
|
||
| export class TodoItem extends Component { | ||
| static template = "awesome_owl.TodoItem"; | ||
|
|
||
| static props = { | ||
| id: Number, | ||
| description: String, | ||
| isCompleted: Boolean, | ||
| toggleTodo: Function, | ||
| removeTodo: Function, | ||
| }; | ||
|
|
||
| onToggle() { | ||
| this.props.toggleTodo(this.props.id); | ||
| } | ||
|
|
||
| onRemove(){ | ||
| this.props.removeTodo(this.props.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,41 @@ | ||
| 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 }; | ||
|
|
||
| setup(){ | ||
| this.inputRef = useAutofocus("InputValue") | ||
| this.todos = useState([]); | ||
| this.nextId = 1 | ||
| this.inputValue = useState({ text: "" }); | ||
| this.removeTodo = this.removeTodo.bind(this); | ||
| } | ||
|
|
||
| addTodo(ev) | ||
| { | ||
| if (ev.keyCode != 13) return | ||
| this.todos.push({ | ||
| id : this.nextId++, | ||
| description : this.inputValue.text, | ||
| isCompleted : false | ||
| }) | ||
| this.inputValue.text = "" | ||
| } | ||
|
|
||
| toggleTodo = (id) => { | ||
| const todo = this.todos.find(t => t.id == id); | ||
| if (todo) { | ||
| todo.isCompleted = !todo.isCompleted; | ||
| } | ||
| } | ||
|
|
||
| removeTodo(id) { | ||
| const index = this.todos.findIndex(todo => todo.id === id); | ||
| if (index !== -1) { | ||
| this.todos.splice(index, 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,14 @@ | ||
| <t t-name="awesome_owl.TodoItem"> | ||
| <div class="ms-3" t-att-class="{ | ||
| 'text-muted': props.isCompleted, | ||
| 'text-decoration-line-through': props.isCompleted | ||
| }"> | ||
| <input type="checkbox" t-att-checked="props.isCompleted" t-on-change="onToggle"/> | ||
| <span> | ||
| id: <t t-esc="props.id"/> - | ||
| description: <t t-esc="props.description"/> - | ||
| iscompleted: <t t-esc="props.isCompleted"/> | ||
| </span> | ||
| <span role="button" class="fa fa-remove" t-on-click="onRemove" /> | ||
| </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,11 @@ | ||
| import { useRef, onMounted } from "@odoo/owl"; | ||
|
|
||
| export function useAutofocus(refName) { | ||
| const ref = useRef(refName); | ||
|
|
||
| onMounted(() => { | ||
| ref.el.focus(); | ||
|
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. same linting issue. |
||
| }); | ||
|
|
||
| return ref; | ||
| } | ||
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,26 @@ | ||
| { | ||
| 'name': "Estate", | ||
| 'version': '0.1', | ||
| 'summary': "Real Estate Advertisement", | ||
| 'description': """ | ||
| This module allows you to manage real estate advertisements, including | ||
| properties, agents, and customer inquiries. | ||
| """, | ||
| 'author': "aykhu", | ||
| 'license': 'LGPL-3', | ||
| 'website': "https://www.odoo.com/app/estate", | ||
| 'category': 'Tutorials', | ||
| 'application': True, | ||
| 'depends': ['base', 'calendar', 'mail'], | ||
| 'data': [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_issue_views.xml', | ||
| 'views/estate_property_visit_views.xml', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_property_offer_views.xml', | ||
| 'views/estate_property_type_views.xml', | ||
| 'views/estate_property_tag_views.xml', | ||
| 'views/estate_menus.xml', | ||
| 'views/res_users_views.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,7 @@ | ||
| from . import estate_property | ||
| from . import estate_property_type | ||
| from . import estate_property_tag | ||
| from . import estate_property_offer | ||
| from . import res_users | ||
| from . import estate_property_visit | ||
| from . import estate_property_issues |
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.
can you please enable linter -> ./addons/web/tooling/enable.sh