-
Notifications
You must be signed in to change notification settings - Fork 3k
[ADD] real_estate: added real_estate module #1227
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
Arbaaz-Khan-Tech
wants to merge
6
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorials-asurk
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.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8de6abe
[ADD] real_estate: added real_estate module
Arbaaz-Khan-Tech 5775c43
[ADD] real_estate: Add required fields for property details
Arbaaz-Khan-Tech 8dad73a
[ADD] real_estate: add access rights for users
Arbaaz-Khan-Tech fe97ac7
[ADD] real_estate: Add UI views for estate model display
Arbaaz-Khan-Tech 7e244b4
[ADD] real_estate: Add property status, dashboard logo, and refactor
Arbaaz-Khan-Tech 847c363
[FIX] real_estate: Prevent build failures
Arbaaz-Khan-Tech 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': "Asurk", | ||
| 'category': 'Real Estate/Brokerage', | ||
| 'description': """ | ||
| A module so that customers can bid on real estates | ||
| """, | ||
| 'data': [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_menus.xml' | ||
| ], | ||
| 'license': 'LGPL-3', # Default License | ||
| 'application': True, | ||
| 'installable': True, | ||
| # data files always loaded at installation | ||
|
|
||
| } | ||
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 |
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 odoo import fields, models, api | ||
| from odoo.exceptions import ValidationError | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
|
|
||
| _name = 'estate.property' | ||
| _description = "A real estate model with many fields" | ||
| active = fields.Boolean(string="Active", default="Active") | ||
| bedrooms = fields.Integer(string="Bedrooms", default="2") | ||
| date_availability = fields.Datetime( | ||
| string="Available From", copy=False, default=lambda self: fields.Date.add(fields.Date.context_today(self), months=3)) | ||
| description = fields.Text(string="Description") | ||
| expected_price = fields.Float(string="Expected Price", required=True) | ||
| facades = fields.Integer(string="Facades") | ||
| garden = fields.Boolean(string="Garden") | ||
| garden_area = fields.Integer(string="Garden Area (sqm)") | ||
| garden_orientation = fields.Selection( | ||
| string="Direction", | ||
| selection=[ | ||
| ('north', "North"), | ||
| ('south', "South"), | ||
| ('east', "East"), | ||
| ('west', "West") | ||
| ], | ||
| help="Type is used to specify the garden orientation" | ||
| ) | ||
| garage = fields.Boolean(string="Garage") | ||
| living_area = fields.Integer(string="Living Area (sqm)") | ||
| name = fields.Char(string="Title", required=True, default="Unknown") | ||
| postcode = fields.Integer(string="Postcode") | ||
| selling_price = fields.Float( | ||
| string="Selling Price", readonly=True, copy=False) | ||
| state = fields.Selection([('new', "New"), | ||
| ('offer_received', "Offer Received"), | ||
| ('offer_accepted', "Offer Accepted"), | ||
| ('sold', "Sold"), | ||
| ('cancelled', "Cancelled") | ||
| ], | ||
| default='new') | ||
|
|
||
| @api.constrains('expected_price') | ||
| def _check_price(self): | ||
| for rec in self: | ||
| if rec.expected_price <= 0: | ||
| raise ValidationError("Price must be positive") |
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 @@ | ||
| 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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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="real_estate_root" name="Real Estate" web_icon="estate,static/description/6888420.jpg" /> | ||
|
|
||
| <menuitem id="real_estate_properties_menu" name="Properties" parent="real_estate_root"/> | ||
|
|
||
| <menuitem id="real_estate_menu_action" name="All Properties" parent="real_estate_properties_menu" action="test_property_action"/> | ||
| </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,10 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
|
|
||
| <record id="test_property_action" model="ir.actions.act_window"> | ||
| <field name="name">Property Action</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.
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.
What's the purpose of using
'installable': True?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.
When installable is set to true , user can install the module from web interface