-
Notifications
You must be signed in to change notification settings - Fork 2.9k
ibrha - first commit #1121
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
HazemWaheed2050
wants to merge
6
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-technical-training-ibrha
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.
Open
ibrha - first commit #1121
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
98a475e
ibrha - first commit
HazemWaheed2050 a598836
[ADD] estate: add real estate module
HazemWaheed2050 de23281
[IMP] estate: added access rights for estate property model
HazemWaheed2050 6f915cd
[IMP] estate: add views, menus and property fields
HazemWaheed2050 e9dffd5
[IMP] Estate: Add list, form, search views
HazemWaheed2050 be45f5d
[IMP] estate: add property offers, tags, types and relational fields
HazemWaheed2050 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,24 @@ | ||
| { | ||
| 'name': 'Real Estate', | ||
| 'category': 'tutorials', | ||
| 'summary': 'Real estate module to sell/rent houses and offices', | ||
| 'description': """ | ||
| immoweb alias xd | ||
| """, | ||
| 'website': 'https://www.odoo.com/app/real_estate', | ||
| 'depends': [ | ||
| 'base_setup', | ||
| 'base' | ||
| ], | ||
| 'data': [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_type_views.xml', | ||
| 'views/estate_property_tag_views.xml', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_menus.xml', | ||
| ], | ||
| 'installable': True, | ||
| 'application': True, | ||
| 'author': 'ibrha', | ||
| 'license': 'LGPL-3', | ||
| } |
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 estate_property, estate_property_type, estate_property_tag, estate_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,46 @@ | ||
| from dateutil.relativedelta import relativedelta | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class Property(models.Model): | ||
| _name = "estate.property" | ||
| _description = "Estate Property app like immoweb" | ||
|
|
||
| name = fields.Char(string="Title", required=True) | ||
| description = fields.Text(string="Description") | ||
| postcode = fields.Char(string="Postcode") | ||
| property_type_id = fields.Many2one("estate.property.type", string="Property Type") | ||
| offer_ids = fields.One2many("estate.property.offer", string="Offers", inverse_name="property_id") | ||
| tag_ids = fields.Many2many("estate.property.tag", string="Tags") | ||
| salesman = fields.Many2one("res.users", string ="Salesman", default=lambda self: self.env.uid) | ||
| buyer = fields.Many2one("res.partner", string="Buyer", copy=False) | ||
| date_availability = fields.Date(string="Available From", default=fields.Date.today() + relativedelta(months=3), copy=False) | ||
| expected_price = fields.Float(string="Expected Price", required=True) | ||
| selling_price = fields.Float(string="Selling Price", readonly=True, copy=False) | ||
| bedrooms = fields.Integer(string="Bedrooms", default=2) | ||
| living_area = fields.Integer(string="Living Area") | ||
| facades = fields.Integer(string="Facades") | ||
| garage = fields.Boolean(string="Garage") | ||
| garden = fields.Boolean(string="Garden") | ||
| garden_area = fields.Integer(string="Garden Area") | ||
| active = fields.Boolean(string="Active", default=True) | ||
| garden_orientation = fields.Selection( | ||
| string="Garden Orientation", | ||
| selection=[ | ||
| ("north", "North"), | ||
| ("south", "South"), | ||
| ("east", "East"), | ||
| ("west", "West") | ||
| ] | ||
| ) | ||
| state = fields.Selection( | ||
| string="Status", | ||
| selection=[ | ||
| ("new", "New"), | ||
| ("offer_received", "Offer Received"), | ||
| ("offer_accepted", "Offer Accepted"), | ||
| ("sold", "Sold"), | ||
| ("cancelled", "Cancelled") | ||
| ], | ||
| default="new" | ||
| ) | ||
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 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class PropertyOffer(models.Model): | ||
| _name = "estate.property.offer" | ||
| _description = "Estate Property Offer" | ||
|
|
||
| price = fields.Float(string="Price", required=True) | ||
| status = fields.Selection( | ||
| string="Status", | ||
| selection=[ | ||
| ("accepted", "Accepted"), | ||
| ("refused", "Refused") | ||
| ], | ||
| copy=False | ||
| ) | ||
| property_id = fields.Many2one("estate.property", string="Property", required=True) | ||
| partner_id = fields.Many2one("res.partner", string="Partner", 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 models, fields | ||
|
|
||
|
|
||
| class PropertyTag(models.Model): | ||
| _name = "estate.property.tag" | ||
| _description = "Estate Property Tag" | ||
|
|
||
| name = fields.Char(string="Name", 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,9 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class PropertyType(models.Model): | ||
| _name = "estate.property.type" | ||
| _description = "Estate Property Type" | ||
|
|
||
| name = fields.Char(string="Name", 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,5 @@ | ||
| 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 | ||
| access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1 | ||
| access_estate_property_offer,access_estate_property_offer,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,11 @@ | ||
| <odoo> | ||
| <menuitem id="estate_menu_root" name="Real Estate"> | ||
| <menuitem id="estate_first_level_menu" name="Properties"> | ||
| <menuitem id="estate_property_menu_action" name="Properties" action="estate_property_action"/> | ||
| </menuitem> | ||
| <menuitem id="settings_menu" name="Settings"> | ||
| <menuitem id="estate_property_type_menu" name="Property Types" action="estate_property_type_action"/> | ||
| <menuitem id="estate_property_tag_menu" name="Property Tags" action="estate_property_tag_action"/> | ||
| </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,32 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <record id="estate_property_tag_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.tag.view.list</field> | ||
| <field name="model">estate.property.tag</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Property Tags"> | ||
| <field name="name"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_tag_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.tag.view.form</field> | ||
| <field name="model">estate.property.tag</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Property Tag"> | ||
| <sheet> | ||
| <group> | ||
| <field name="name"/> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <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,32 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <record id="estate_property_type_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.type.view.list</field> | ||
| <field name="model">estate.property.type</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Property Types"> | ||
| <field name="name"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_type_view_form" model="ir.ui.view"> | ||
| <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> | ||
| <field name="name"/> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <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,108 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <record id="estate_property_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.view.list</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Properties"> | ||
| <field name="name"/> | ||
| <field name="postcode"/> | ||
| <field name="property_type_id"/> | ||
| <field name="tag_ids" widget="many2many_tags"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area"/> | ||
| <field name="expected_price"/> | ||
| <field name="selling_price"/> | ||
| <field name="date_availability"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.view.form</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Estate Property"> | ||
| <sheet> | ||
| <h1> | ||
| <field name="name"/> | ||
| </h1> | ||
| <group> | ||
| <group> | ||
| <field name="property_type_id"/> | ||
| <field name="tag_ids" widget="many2many_tags"/> | ||
| <field name="postcode"/> | ||
| <field name="expected_price"/> | ||
| </group> | ||
| <group> | ||
| <field name="date_availability"/> | ||
| <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"/> | ||
| <field name="active"/> | ||
| <field name="state"/> | ||
| </group> | ||
| </page> | ||
|
|
||
| <page string="Offers"> | ||
| <field name="offer_ids"> | ||
| <list> | ||
| <field name="price"/> | ||
| <field name="partner_id"/> | ||
| <field name="status"/> | ||
| </list> | ||
| </field> | ||
| </page> | ||
|
|
||
| <page string="Other Info"> | ||
| <group> | ||
| <field name="buyer"/> | ||
| <field name="salesman"/> | ||
| </group> | ||
| </page> | ||
| </notebook> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_view_search" model="ir.ui.view"> | ||
| <field name="name">estate.property.view.search</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <search string="Property Search"> | ||
| <field name="name"/> | ||
| <field name="postcode"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area"/> | ||
| <field name="expected_price"/> | ||
| <field name="facades"/> | ||
| <field name="property_type_id"/> | ||
| <filter string="Available Properties" name="available" domain="[ | ||
| '&', | ||
| ('active', '=', True), '|' | ||
| ,('state', '=', 'new'), ('state', '=', 'offer_received') | ||
| ]"/> | ||
|
|
||
| <filter string="Postcode" name="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> |
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.