-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[ADD] estate: initial module with property management #952
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
base: 18.0
Are you sure you want to change the base?
Changes from 1 commit
56a3a92
787a31c
0bf8aa8
e3df877
c3e0054
40ee634
d17d142
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
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 to declare. |
||
{ | ||
"name": "Real Estate", | ||
"version": "0.1", | ||
"depends": ["base"], | ||
"author": "Madhav Pancholi", | ||
"category": "Real Estate", | ||
"description": """ | ||
Manage properties, rentals, and real estate sales. | ||
""", | ||
"installable": True, | ||
"application": True, | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"views/estate_property_view.xml", | ||
"views/estate_property_type_view.xml", | ||
"views/estate_menus.xml", | ||
], | ||
"demo": [], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
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 to declare here. |
||
from . import estate_property | ||
from . import estate_property_type |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- coding: utf-8 -*- | ||
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 to declare. |
||
from odoo import fields, models | ||
from dateutil.relativedelta import relativedelta | ||
|
||
|
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_description = "Estate Property" | ||
|
||
name = fields.Char(required=True, string="Title") | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Date( | ||
string="Available From", | ||
copy=False, | ||
default=lambda self: fields.Date.today() + relativedelta(months=3), | ||
) | ||
expected_price = fields.Float(required=True) | ||
selling_price = fields.Float(copy=False, readonly=True) | ||
bedrooms = fields.Integer(default=2) | ||
living_area = fields.Integer(string="Living Area(sqm)") | ||
facades = fields.Integer() | ||
garage = fields.Boolean() | ||
garden = fields.Boolean() | ||
garden_area = fields.Integer() | ||
garden_orientation = fields.Selection( | ||
selection=[ | ||
("north", "North"), | ||
("south", "South"), | ||
("east", "East"), | ||
("west", "West"), | ||
] | ||
) | ||
active = fields.Boolean(default=True) | ||
state = fields.Selection( | ||
selection=[ | ||
("new", "New"), | ||
("offer_received", "Offer Received"), | ||
("offer_accepted", "Offer Accepted"), | ||
("sold", "Sold"), | ||
("cancelled", "Cancelled"), | ||
], | ||
default="new", | ||
required=True, | ||
) | ||
salesman_id = fields.Many2one( | ||
"res.users", | ||
string="Salesman", | ||
default=lambda self: self.env.user.id, | ||
) | ||
buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False) | ||
property_type_id = fields.Many2one( | ||
"estate.property.type", string="Property Type", copy=False | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
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 to declare. |
||
from odoo import fields, models | ||
|
||
|
||
class EstatePropertyType(models.Model): | ||
_name = "estate.property.type" | ||
_description = "Property Type" | ||
|
||
name = fields.Char(required=True, string="Type") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 | ||
access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<menuitem | ||
id="estate_property_menu_root" | ||
name="Real Estate" | ||
sequence="5" | ||
/> | ||
<menuitem | ||
id="estate_property_advertisements" | ||
name="Advertisements" | ||
parent="estate.estate_property_menu_root" | ||
sequence="1" | ||
/> | ||
<menuitem | ||
id="estate_property_menu_properties" | ||
name="Properties" | ||
parent="estate.estate_property_advertisements" | ||
action="estate_property_action_menu" | ||
sequence="1" | ||
/> | ||
<menuitem | ||
id="estate_property_menu_settings" | ||
name="Settings" | ||
parent="estate.estate_property_menu_root" | ||
sequence="2" | ||
/> | ||
<menuitem | ||
id="estate_property_menu_property_type" | ||
name="Property Type" | ||
parent="estate.estate_property_menu_settings" | ||
action="estate_property_type_action" | ||
sequence="1" | ||
/> | ||
</odoo> | ||
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. Should be one empty line at the end of the file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="estate_property_type_view_tree" model="ir.ui.view"> | ||
<field name="name">estate.property.type.view.tree</field> | ||
<field name="model">estate.property.type</field> | ||
<field name="arch" type="xml"> | ||
<list string="Property Type"> | ||
<field name="name"/> | ||
</list> | ||
</field> | ||
</record> | ||
<record id="estate_property_type_view_form" model="ir.ui.view"> | ||
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. Should be one empty line before it. |
||
<field name="name">estate.property.type.view.form</field> | ||
<field name="model">estate.property.type</field> | ||
<field name="arch" type="xml"> | ||
<form string="Property Type"> | ||
<sheet> | ||
<group> | ||
<group> | ||
<field name="name"/> | ||
</group> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
<record id="estate_property_type_view_search" model="ir.ui.view"> | ||
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. Should be one empty line before it. |
||
<field name="name">estate.property.type.search</field> | ||
<field name="model">estate.property.type</field> | ||
<field name="arch" type="xml"> | ||
<search string="Property Type"> | ||
<field name="name"/> | ||
</search> | ||
</field> | ||
</record> | ||
<record id="estate_property_type_action" model="ir.actions.act_window"> | ||
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. Should be one empty line before it. |
||
<field name="name">Property Type</field> | ||
<field name="res_model">estate.property.type</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
</odoo> | ||
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. Should be one empty line at the end of the file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="estate_property_view_tree" model="ir.ui.view"> | ||
<field name="name">estate.property.view.tree</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<list string="Properties"> | ||
<field name="name"/> | ||
<field name="postcode"/> | ||
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="expected_price"/> | ||
<field name="date_availability"/> | ||
</list> | ||
</field> | ||
</record> | ||
<record id="estate_property_view_form" model="ir.ui.view"> | ||
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. Should be one empty line before it. |
||
<field name="name">estate.property.view.form</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<form string="Properties"> | ||
<sheet> | ||
<div class="oe_title"> | ||
<label for="name"/> | ||
<h1><field name="name" class="oe_inline"/></h1> | ||
</div> | ||
<group> | ||
<group> | ||
<field name="property_type_id"/> | ||
<field name="postcode"/> | ||
<field name="expected_price"/> | ||
</group> | ||
<group> | ||
<field name="date_availability"/> | ||
<field name="selling_price"/> | ||
</group> | ||
</group> | ||
<notebook> | ||
<page name="description" 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> | ||
<page name="other_info" string="Other Info"> | ||
<group> | ||
<field name="salesman_id"/> | ||
<field name="buyer_id"/> | ||
</group> | ||
</page> | ||
</notebook> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
<record id="estate_property_view_search" model="ir.ui.view"> | ||
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. Should be one empty line before it. |
||
<field name="name">estate.property.search</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<search string="Properties"> | ||
<field name="name"/> | ||
<field name="postcode"/> | ||
<field name="expected_price"/> | ||
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="facades"/> | ||
<separator/> | ||
<filter name="available_properties" domain="[('state','in',('new', 'offer_received'))]"/> | ||
<group expand="1" string="Group By"> | ||
<filter string="Postcode" name='postcode' context="{'group_by':'postcode'}"/> | ||
</group> | ||
</search> | ||
</field> | ||
</record> | ||
<record id="estate_property_action_menu" model="ir.actions.act_window"> | ||
<field name="name">Properties</field> | ||
<field name="res_model">estate.property</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
</odoo> | ||
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. Should be one empty line at the end of the file. |
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.
No need to declare.