-
Notifications
You must be signed in to change notification settings - Fork 2.8k
real estate module (ibmah) #1069
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
Open
ibmah-odoo
wants to merge
6
commits into
odoo:master
Choose a base branch
from
odoo-dev:master-real-estate-ibmah
base: master
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.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9f7d1ac
[ADD] estate: introduce structure for estate module
ibmah-odoo d5962a2
[IMP] estate: Add estate_property model
ibmah-odoo f2a9463
[IMP] estate: Add access right rules to estate module data
ibmah-odoo 709dd42
[IMP] estate: Implemet menus and new model customizations
ibmah-odoo 43dc52a
[IMP] estate: Add list, form, search views to real estate module
ibmah-odoo a2ae3a1
[IMP] estate: Add relations between real estate property models
ibmah-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 @@ | ||
| 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,20 @@ | ||
| { | ||
| "name": "estate", | ||
| "version": "1.0", | ||
| "depends": ["base"], | ||
| "author": "Odoo S.A.", | ||
| "category": "Real Estate", | ||
| "description": """ | ||
| Description text | ||
| """, | ||
| "application": True, | ||
| "installable": True, | ||
| "data": [ | ||
| "data/ir.model.access.csv", | ||
| "views/estate_property_views.xml", | ||
| "views/estate_property_type.xml", | ||
| "views/estate_property_tag.xml", | ||
| "views/estate_property_offer.xml", | ||
| "views/estate_menus.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,5 @@ | ||
| 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_estate_property_type,access_estate_property_type,estate.model_estate_property_type,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_tag,access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,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,2 @@ | ||
| from . import (estate_property, estate_property_offer, estate_property_tag, | ||
| estate_property_type) |
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 @@ | ||
| from datetime import datetime | ||
|
|
||
| from dateutil.relativedelta import relativedelta | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
| _name = "estate.property" | ||
| _description = "Estate Property data model" | ||
|
|
||
| name = fields.Char(required=True) | ||
| description = fields.Text() | ||
| active = fields.Boolean(default=True) | ||
| postcode = fields.Char() | ||
| date_availability = fields.Date( | ||
| copy=False, default=datetime.now() + relativedelta(month=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( | ||
| [ | ||
| ("north", "North"), | ||
| ("south", "South"), | ||
| ("east", "East"), | ||
| ("west", "West"), | ||
| ], | ||
| help="Indicates the direction the garden is facing with respect to the house", | ||
| ) | ||
| state = fields.Selection( | ||
| [ | ||
| ("new", "New"), | ||
| ("offer_received", "Offer Received"), | ||
| ("offer_accepted", "Offer Accepted"), | ||
| ("sold", "Sold"), | ||
| ("cancelled", "Cancelled"), | ||
| ], | ||
| required=True, | ||
| copy=False, | ||
| default="new", | ||
| help="State of the proprty listing lifecycle", | ||
| ) | ||
| property_type_id = fields.Many2one("estate.property.type", string="Property Type") | ||
| buyer_id = fields.Many2one("res.partner", string="Buyer") | ||
| salesperson_id = fields.Many2one( | ||
| "res.users", string="Salesman", default=lambda self: self.env.user | ||
| ) | ||
| tag_ids = fields.Many2many("estate.property.tag", string="Property Tags") | ||
| offer_ids = fields.One2many("estate.property.offer", "property_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 @@ | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class EstatePropertyOffer(models.Model): | ||
| _name = "estate.property.offer" | ||
| _description = "Real estate property offer" | ||
|
|
||
| price = fields.Float() | ||
| status = fields.Selection( | ||
| [("accepted", "Accepted"), ("refused", "Refused")], copy=False | ||
| ) | ||
| partner_id = fields.Many2one("res.partner", required=True, string="Sales") | ||
| 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 @@ | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class EstatePropertyTag(models.Model): | ||
| _name = "estate.property.tag" | ||
| _description = "Real estate property tags" | ||
|
|
||
| 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,8 @@ | ||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class EstatePropertyType(models.Model): | ||
| _name = "estate.property.type" | ||
| _description = "Real Estate property type" | ||
|
|
||
| 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,14 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <menuitem id="estate_property_menu_root" name="Real Estate"> | ||
| <menuitem id="estate_property_first_level_menu" name="Advertisements"> | ||
| <menuitem id="estate_property_model_menu_action" action="estate_property_action" /> | ||
| </menuitem> | ||
| <menuitem id="estate_property_settings_menu" name="Settings"> | ||
| <menuitem id="estate_property_type_model_menu_action" action="estate_property_type_action" | ||
| name="Property Types" /> | ||
| <menuitem id="estate_property_tag_model_menu_action" action="estate_property_tag_action" | ||
| name="Property Tags" /> | ||
| </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,15 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <odoo> | ||
| <record id="estate_property_offer_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.list</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Properties"> | ||
| <field name="price" string="Price" /> | ||
| <field name="partner_id" string="Partner" /> | ||
| <field name="status" /> | ||
| </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,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <odoo> | ||
| <record id="estate_property_tag_action" model="ir.actions.act_window"> | ||
| <field name="name">Property Tags</field> | ||
| <field name="res_model">estate.property.tag</field> | ||
| <field name="view_mode">list,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,8 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <odoo> | ||
| <record id="estate_property_type_action" model="ir.actions.act_window"> | ||
| <field name="name">Property Types</field> | ||
| <field name="res_model">estate.property.type</field> | ||
| <field name="view_mode">list,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,104 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <record id="estate_property_action" model="ir.actions.act_window"> | ||
| <field name="name">estate property action</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_view_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" string="Title" /> | ||
| <field name="postcode" string="Postcode" /> | ||
| <field name="bedrooms" string="Bedrooms" /> | ||
| <field name="living_area" string="Living Area (sqm)" /> | ||
| <field name="expected_price" /> | ||
| <field name="selling_price" /> | ||
| <field name="date_availability" string="Available From" /> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_view_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="Test"> | ||
| <sheet> | ||
| <group> | ||
| <h1 class="mb32"> | ||
| <field name="name" placeholder="TITLE" /> | ||
| </h1> | ||
| </group> | ||
| <field name="tag_ids" widget="many2many_tags" /> | ||
| <separator /> | ||
| <group> | ||
| <group> | ||
| <field name="property_type_id" string="Property Type" /> | ||
| <field name="postcode" string="Postcode" /> | ||
| <field name="date_availability" string="Available From" /> | ||
| </group> | ||
| <group> | ||
| <field name="expected_price" /> | ||
| <field name="selling_price" /> | ||
| </group> | ||
| </group> | ||
| <group> | ||
| </group> | ||
| <notebook> | ||
| <page string="Description"> | ||
| <group> | ||
| <field name="description" /> | ||
| <field name="bedrooms" string="Bedrooms" /> | ||
| <field name="living_area" string="Living Area (sqm)" /> | ||
| <field name="facades" /> | ||
| <field name="garage" /> | ||
| <field name="garden" /> | ||
| <field name="garden_area" /> | ||
| <field name="garden_orientation" /> | ||
| </group> | ||
| </page> | ||
| <page string="Offers"> | ||
| <group> | ||
| <field name="offer_ids" /> | ||
| </group> | ||
| </page> | ||
| <page string="Other Info"> | ||
| <group> | ||
| <field name="salesperson_id" /> | ||
| <field name="buyer_id" /> | ||
| </group> | ||
| </page> | ||
| </notebook> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="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" string="Title" /> | ||
| <field name="postcode" /> | ||
| <field name="expected_price" /> | ||
| <field name="bedrooms" /> | ||
| <field name="living_area" /> | ||
| <field name="facades" /> | ||
| <separator /> | ||
| <filter string="Available" name="available" domain="[('active', '=', True)]" /> | ||
| <filter string="New" name="new" domain="[('state', '=', 'new')]" /> | ||
| <filter string="Offer Received" name="offer_received" | ||
| domain="[('state', '=', 'offer_received')]" /> | ||
| <group> | ||
| <filter string="Postcode" name="postcode" | ||
| context="{'group_by':'postcode'}" /> | ||
| </group> | ||
| </search> | ||
| </field> | ||
| </record> | ||
| </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.
Uh oh!
There was an error while loading. Please reload this page.