-
Notifications
You must be signed in to change notification settings - Fork 2k
ADD: Real Estate Module Added #730
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
abyo-odoo
wants to merge
6
commits into
odoo:18.0
Choose a base branch
from
odoo-dev:18.0-abyo-TechnicalTraining
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 all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e1b5c44
ADD: Real Estate Module Added
abyo-odoo c4ebab7
IMP: Access Rights Added
abyo-odoo e89900c
IMP: Chapter 5
abyo-odoo cb795ff
IMP: Chapter 5 CONT.
abyo-odoo fb6b8c4
Chapter 6
abyo-odoo 9ba7851
[ADD] : Chapter 7 + Fixes
abyo-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,2 @@ | ||
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,17 @@ | ||
{ | ||
"name": "Real Estate", | ||
"depends": [ | ||
"base", | ||
], | ||
"author": "Youssef Abdelmoneim", | ||
"description": "A module for managing real estate properties.", | ||
"application": True, | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"views/estate_views.xml", | ||
"views/property_type_views.xml", | ||
"views/property_tag_views.xml", | ||
"views/estate_menus.xml", | ||
"views/settings_menu.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,2 @@ | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
from . import estate, property_tag, propery_type, property_offer |
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,54 @@ | ||||||||||||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||||||||||||
|
||||||||||||
from odoo import fields, models | ||||||||||||
from dateutil.relativedelta import relativedelta | ||||||||||||
|
||||||||||||
|
||||||||||||
class Estate(models.Model): | ||||||||||||
_name = "estate_property" | ||||||||||||
_description = "RE Initial Model" | ||||||||||||
name = fields.Char(required=True) | ||||||||||||
Comment on lines
+9
to
+10
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. Use a space to separate this
Suggested change
|
||||||||||||
active = fields.Boolean(default=True) | ||||||||||||
description = fields.Text() | ||||||||||||
postcode = fields.Text() | ||||||||||||
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. Maybe better use a Char here |
||||||||||||
date_availability = fields.Date( | ||||||||||||
copy=False, default=fields.Date.today() + relativedelta(months=+3) | ||||||||||||
) | ||||||||||||
expected_price = fields.Float(required=True) | ||||||||||||
selling_price = fields.Float(readonly=True, copy=False) | ||||||||||||
bedrooms = fields.Integer(default=2) | ||||||||||||
living_area = fields.Integer() | ||||||||||||
facades = fields.Integer() | ||||||||||||
garage = fields.Boolean() | ||||||||||||
garden = fields.Boolean() | ||||||||||||
garden_area = fields.Integer() | ||||||||||||
garden_orientation = fields.Selection( | ||||||||||||
string="Garden Orientation", | ||||||||||||
selection=[ | ||||||||||||
("north", "North"), | ||||||||||||
("south", "South"), | ||||||||||||
("east", "East"), | ||||||||||||
("west", "West"), | ||||||||||||
], | ||||||||||||
) | ||||||||||||
|
||||||||||||
state = fields.Selection( | ||||||||||||
string="State", | ||||||||||||
required=True, | ||||||||||||
default="new", | ||||||||||||
copy=False, | ||||||||||||
selection=[ | ||||||||||||
("new", "New"), | ||||||||||||
("offer_received", "Offer Received"), | ||||||||||||
("offer_accepted", "Offer Accepted"), | ||||||||||||
("sold", "Sold"), | ||||||||||||
("cancelled", "Canceled"), | ||||||||||||
], | ||||||||||||
) | ||||||||||||
property_type_id = fields.Many2one("property_type", string="property_type") | ||||||||||||
buyer = fields.Many2one("res.partner", copy=False) | ||||||||||||
salesperson = fields.Many2one("res.users", default=lambda self: self.env.user) | ||||||||||||
property_tag_ids = fields.Many2many("property_tag", string="property_tag") | ||||||||||||
property_offer_ids = fields.One2many( | ||||||||||||
"property_offer", "property_id", string="property_offer" | ||||||||||||
) |
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 @@ | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
from odoo import fields, models | ||
|
||
|
||
class PropertyOffer(models.Model): | ||
_name = "property_offer" | ||
_description = "Property Offer Model" | ||
name = fields.Char(required=True) | ||
price = fields.Float() | ||
state = fields.Selection( | ||
string="State", | ||
required=True, | ||
default="new", | ||
copy=False, | ||
selection=[ | ||
("accepted", "Accepted"), | ||
("refused", "Refused"), | ||
], | ||
) | ||
partner_id = fields.Many2one("res.partner", required=True) | ||
property_id = fields.Many2one("estate_property", required=True) |
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 @@ | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
from odoo import fields, models | ||
|
||
|
||
class PropertyTag(models.Model): | ||
_name = "property_tag" | ||
_description = "Property Tag Model" | ||
name = fields.Char(required=True) |
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 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class PropertyType(models.Model): | ||
_name = "property_type" | ||
_description = "Property Types" | ||
name = fields.Char(required=True) |
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,6 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1 | ||
estate.access_property_type,access_property_type,estate.model_property_type,base.group_user,1,1,1,1 | ||
estate.access_property_offer,access_property_offer,estate.model_property_offer,base.group_user,1,1,1,1 | ||
estate.access_property_type,access_property_type,estate.model_property_type,base.group_user,1,1,1,1 | ||
estate.access_property_tag,access_property_tag,estate.model_property_tag,base.group_user,1,1,1,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,7 @@ | ||
<odoo> | ||
<menuitem id="menu_root" name="Real Estate"> | ||
<menuitem id="first_level_menu" name="Advertisement"> | ||
<menuitem id="model_menu_action" action="re_action_model"/> | ||
</menuitem> | ||
</menuitem> | ||
</odoo> |
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,92 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
<!-- Action --> | ||
<record id="re_action_model" model="ir.actions.act_window"> | ||
<field name="name">Real Estate Listings</field> | ||
<field name="res_model">estate_property</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
<!-- List --> | ||
<record id="re_view_list" model="ir.ui.view"> | ||
<field name="name">Estate List</field> | ||
<field name="model">estate_property</field> | ||
<field name="arch" type="xml"> | ||
<list string = "Listings"> | ||
<field name="name"/> | ||
<field name="expected_price"/> | ||
<field name="postcode"/> | ||
<field name="bedrooms"/> | ||
<field name="state"/> | ||
</list> | ||
</field> | ||
</record> | ||
<!-- Form --> | ||
<record id="re_view_form" model="ir.ui.view"> | ||
<field name="name">name</field> | ||
<field name="model">estate_property</field> | ||
<field name="arch" type="xml"> | ||
<form string="Estate_Forms"> | ||
<sheet> | ||
<h1> | ||
<field name="name" placeholder="My new house"/> | ||
</h1> | ||
<group> | ||
<group> | ||
<field name="postcode"/> | ||
<field name="date_availability"/> | ||
</group> | ||
<group> | ||
<field name="expected_price"/> | ||
<field name="selling_price"/> | ||
</group> | ||
</group> | ||
<notebook> | ||
<page string="Description"> | ||
<group> | ||
<field name="description"/> | ||
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="facades"/> | ||
<field name="garage"/> | ||
<field name="garden"/> | ||
<field name="garden_area"/> | ||
<field name="garden_orientation"/> | ||
</group> | ||
</page> | ||
</notebook> | ||
|
||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<!-- Search --> | ||
<record id="re_view_search" model="ir.ui.view"> | ||
<field name="name">search</field> | ||
<field name="model">estate_property</field> | ||
<field name="arch" type="xml"> | ||
<search> | ||
<field name="name"/> | ||
<field name="expected_price"/> | ||
<field name="bedrooms"/> | ||
<field name="garage"/> | ||
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/> | ||
<filter string="New" name="new" domain="[('state', '=', 'new')]"/> | ||
<filter string="Offer Received" name="Offer Received" domain="[('state', '=', 'offer_received')]"/> | ||
<group expand="1" string="Group By"> | ||
<filter string="Group" name="Groupby" context="{'group_by':'postcode'}"/> | ||
</group> | ||
</search> | ||
</field> | ||
</record> | ||
<!-- Offer List --> | ||
<record id="offer_list" model="ir.ui.view"> | ||
<field name="name">offers List</field> | ||
<field name="model">property_offer</field> | ||
<field name="arch" type="xml"> | ||
<list string = "offers"> | ||
<field name="name" /> | ||
</list> | ||
</field> | ||
</record> | ||
</odoo> |
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,37 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
|
||
<!-- List --> | ||
<record id="offer_list" model="ir.ui.view"> | ||
<field name="name">offers List</field> | ||
<field name="model">property_offer</field> | ||
<field name="arch" type="xml"> | ||
<list string = "offers"> | ||
<field name="name" /> | ||
<field name="partner_id" /> | ||
<field name="status" /> | ||
</list> | ||
</field> | ||
</record> | ||
<!-- Form --> | ||
<!-- Offer form --> | ||
<record id="offer_form" model="ir.ui.view"> | ||
<field name="name">offers Form</field> | ||
<field name="model">property_offer</field> | ||
<field name="arch" type="xml"> | ||
<form string="offer_Forms"> | ||
<sheet> | ||
<notebook> | ||
<page string="Offers"> | ||
<group> | ||
<field name="price"/> | ||
<field name="partner_id"/> | ||
<field name="status"/> | ||
</group> | ||
</page> | ||
</notebook> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
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,33 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
<!-- Action --> | ||
<record id="property_tag_action_model" model="ir.actions.act_window"> | ||
<field name="name">Property Tags</field> | ||
<field name="res_model">property_tag</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
<!-- List --> | ||
<record id="tag_list" model="ir.ui.view"> | ||
<field name="name">Tags List</field> | ||
<field name="model">property_tag</field> | ||
<field name="arch" type="xml"> | ||
<list string = "Tags"> | ||
<field name="name" widget="many2many_tags"/> | ||
</list> | ||
</field> | ||
</record> | ||
<!-- Form --> | ||
<record id="tag_form" model="ir.ui.view"> | ||
<field name="name">Tags Form</field> | ||
<field name="model">property_tag</field> | ||
<field name="arch" type="xml"> | ||
<form string="Tag_Forms"> | ||
<sheet> | ||
<h1> | ||
<field name="name" widget="many2many_tags"/> | ||
</h1> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
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,28 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
<record id="property_type_action_model" model="ir.actions.act_window"> | ||
<field name="name">Property Types</field> | ||
<field name="res_model">property_type</field> | ||
<field name="view_mode">list</field> | ||
</record> | ||
<record id="re_view_list" model="ir.ui.view"> | ||
<field name="name">name</field> | ||
<field name="model">property_type</field> | ||
<field name="arch" type="xml"> | ||
<list> | ||
<field name="name"/> | ||
</list> | ||
</field> | ||
</record> | ||
<record id="re_view_form" model="ir.ui.view"> | ||
<field name="name">name</field> | ||
<field name="model">property_type</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet> | ||
<field name="name" placeholder="Property Type"/> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
</odoo> |
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 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
<menuitem id="menu_root" name="Real Estate"> | ||
<menuitem id="first_level_property_menu" name="Settings"> | ||
<menuitem id="property_type_menu" action="property_type_action_model"/> | ||
<menuitem id="property_tag_menu" action="property_tag_action_model"/> | ||
</menuitem> | ||
</menuitem> | ||
</odoo> |
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.
_name is defined with dots, not underscores + the class name should reflect the name