-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Day 1 : Chapter 2 : Created Folder Structure for Real-estate module Chapter 3 : Created estate_properties model with all the basic fields [IMP] real-estate: security , ui and search filters Day 2 : Chapter 4: Understood Data files(CSV) and gave access-rights Chapter 5: Understood Data files(XML) and Implemented actions , menus and fields Chapter 6: Understood Basic views and Implemented List , Form and Search filters
- Loading branch information
Showing
8 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains 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 estate_property |
This file contains 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,48 @@ | ||
from odoo import fields, models | ||
from dateutil.relativedelta import relativedelta | ||
|
||
|
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_description = "Properties involved in estate" | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Date( | ||
"Availability Date", | ||
copy=False, | ||
default=fields.Date.add(fields.Date.today(), 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.Float() | ||
garden_orientation = fields.Selection( | ||
selection=[ | ||
("north", "North"), | ||
("south", "South"), | ||
("east", "East"), | ||
("west", "West"), | ||
] | ||
) | ||
|
||
# reserved fields | ||
active = fields.Boolean(default=False) | ||
state = fields.Selection( | ||
[ | ||
("new", "New"), | ||
("offer_recieved", "Offer Recieved"), | ||
("offer_accepted", "Offer Accepted"), | ||
("sold", "Sold"), | ||
("cancelled", "Cancelled"), | ||
], | ||
string="Invoice Status", | ||
default="new", | ||
required=True, | ||
copy=False, | ||
) |
This file contains 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 @@ | ||
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 |
This file contains 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 @@ | ||
hello |
This file contains 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 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
<menuitem id="estate_property_root" name="Real Estate"> | ||
<menuitem id="test_first_level_menu" name="Properties"> | ||
<menuitem id="estate_property_menu_action" action="estate_property_action"/> | ||
</menuitem> | ||
</menuitem> | ||
</odoo> |
This file contains 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,80 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
|
||
<!-- list view --> | ||
<record id="view_estate_property_list" model="ir.ui.view"> | ||
<field name="name">estate.property.list</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<list string="Properties"> | ||
<field name="name" /> | ||
<field name="expected_price" /> | ||
<field name="selling_price" /> | ||
<field name="state" /> | ||
<field name="postcode" /> | ||
<field name="date_availability" /> | ||
<field name="active" /> | ||
</list> | ||
</field> | ||
</record> | ||
|
||
<!-- form view --> | ||
<record id="view_estate_property_form" model="ir.ui.view"> | ||
<field name="name">estate.property.form</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<form string="Property"> | ||
<sheet> | ||
<group> | ||
<field name="name" /> | ||
<field name="expected_price" /> | ||
<field name="selling_price" /> | ||
<field name="state" /> | ||
<field name="postcode" /> | ||
<field name="date_availability" /> | ||
<field name="active" /> | ||
</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 view --> | ||
|
||
<record id="view_estate_property_search" model="ir.ui.view"> | ||
<field name="name">estate.property.search</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<search string="Search Properties"> | ||
<field name="name" /> | ||
<filter string="Archived" name="inactive" | ||
domain="[('active', '=', False)]" /> | ||
<filter string="Available" name="aadfae" | ||
domain="[('state', 'in', ['New', 'Offer Received'])]" /> | ||
<filter name="fadsfef" | ||
string="Postcode" | ||
context="{'group_by': 'postcode'}" /> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
<record id="estate_property_action" 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> |