-
Notifications
You must be signed in to change notification settings - Fork 3k
[ADD] Module - Estate Property Created #1197
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
sumai-odoo
wants to merge
9
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorials-estate-sumai
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
9 commits
Select commit
Hold shift + click to select a range
8c49ccd
[ADD] Estate: Finished Chapters 2-3
sumai-odoo 97ba15a
[ADD] Estate: Finished Chapters 4
sumai-odoo 1fe4ef9
[IMP] Estate: Chapter 5 - Ongoing
sumai-odoo fe44d9a
[IMP] Estate: Chapter 5 - Completed
sumai-odoo 8ae1a0b
[IMP] Estate: Chapter 6- Ongoing
sumai-odoo dcf4d0c
[IMP] Estate: Chapter 6- Completed
sumai-odoo 49cfdfc
[IMP] Estate: Chapter 7- Started
sumai-odoo 49c7c2d
[IMP] Estate: Chapter 7- Ongoing
sumai-odoo 9b534dd
[IMP] Estate: Chapter 7- Completed
sumai-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,25 @@ | ||
| { | ||
| 'name': 'Real Estate', | ||
| 'summary': 'Manage real estate properties and offers', | ||
| 'description': "This module allows managing property advertisements,including property details, offers, and related data.", | ||
| 'author': 'Sudarshan Maity (sumai)', | ||
| 'website': '', | ||
| 'category': 'Real Estate', | ||
| 'version': '1.0', | ||
| 'license': 'LGPL-3', | ||
| 'depends': [ | ||
| 'base', | ||
| ], | ||
|
|
||
| 'data': [ | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_property_type_views.xml', | ||
| 'views/estate_property_tag_views.xml', | ||
| 'views/estate_property_offer_views.xml', | ||
| 'views/estate_menus.xml', | ||
| ], | ||
|
|
||
| 'installable': True, | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'application': 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,4 @@ | ||
| from . import estate_property | ||
| from . import estate_property_type | ||
| from . import estate_property_tag | ||
| from . import 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,56 @@ | ||
| from datetime import timedelta | ||
|
|
||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| _name = 'estate.property' | ||
| _description = 'Real Estate Property' | ||
|
|
||
| name = fields.Char(string="Title", required=True) | ||
| description = fields.Text() | ||
| postcode = fields.Char() | ||
| date_availability = fields.Date(string="Available From", copy=False, default=lambda self: fields.Date.today() + timedelta(days=90)) | ||
| 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 (sqm)", copy=False) | ||
| facades = fields.Integer() | ||
| garage = fields.Boolean() | ||
| garden = fields.Boolean() | ||
| garden_area = fields.Integer(string="Garden Area (sqm)") | ||
| garden_orientation = fields.Selection( | ||
| [ | ||
| ('north', "North"), | ||
| ('south', "South"), | ||
| ('east', "East"), | ||
| ('west', "West"), | ||
| ], | ||
| string="Garden Orientation" | ||
| ) | ||
| active = fields.Boolean(string="is Active", default=True) | ||
| state = fields.Selection( | ||
| [ | ||
| ('new', "New"), | ||
| ('offer_received', "Offer Received"), | ||
| ('offer_accepted', "Offer Accepted"), | ||
| ('sold', "Sold"), | ||
| ('cancelled', "Cancelled") | ||
| ], | ||
| string="Status", required=True, copy=False, default="new") | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| swimming_pool = fields.Boolean(string="Swimming Pool") # extra fields | ||
| # property_type = fields.Selection( | ||
| # [ | ||
| # ('house', "House"), | ||
| # ('apartment', "Apartment"), | ||
| # ('villa', "Villa"), | ||
| # ('land', "Land") | ||
| # ], | ||
| # string="Property Type" | ||
| # ) | ||
| property_age = fields.Integer(string="Property Age") | ||
| property_type_id = fields.Many2one("estate.property.type", string="Property Type") | ||
| buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False) | ||
| salesperson_id = fields.Many2one("res.users", string="Salesperson", default=lambda self: self.env.user) | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| tags_ids = fields.Many2many("estate.property.tag", string="Property Tags") | ||
| offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers") | ||
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,16 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstatePropertyOffer(models.Model): | ||
| _name = "estate.property.offer" | ||
| _description = "Property Offer" | ||
|
|
||
| price = fields.Float() | ||
| status = fields.Selection( | ||
| [ | ||
| ('accepted', "Accepted"), | ||
| ('refused', "Refused"), | ||
| ], | ||
| string="Current Status", copy=False) | ||
| partner_id = fields.Many2one("res.partner", string="Partner", required=True) | ||
| property_id = fields.Many2one("estate.property", string="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 models, fields | ||
|
|
||
|
|
||
| class EstatePropertyTag(models.Model): | ||
| _name = 'estate.property.tag' | ||
| _description = 'Estate Property Tag' | ||
|
|
||
| name = fields.Char(string="Tags 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,8 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstatePropertyType(models.Model): | ||
| _name = 'estate.property.type' | ||
| _description = 'Real Estate Property Types' | ||
|
|
||
| name = fields.Char(string="Type 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,51 @@ | ||
| <odoo> | ||
|
|
||
| <!-- Root Menu --> | ||
| <menuitem | ||
| id="menu_real_estate_root" | ||
| name="Real Estate" | ||
| sequence="1"/> | ||
|
|
||
| <!-- First Level Menu Advertisement --> | ||
| <menuitem | ||
| id="menu_real_estate_advertisements" | ||
| name="Advertisements" | ||
| parent="menu_real_estate_root" | ||
| sequence="1"/> | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| <!-- Second Level Menu --> | ||
| <menuitem | ||
| id="menu_real_estate_properties" | ||
| name="Properties" | ||
| parent="menu_real_estate_advertisements" | ||
| action="action_estate_property" | ||
| sequence="1"/> | ||
|
|
||
| <!-- First Level Menu Settings --> | ||
| <menuitem | ||
| id="menu_real_estate_settings" | ||
| name="Settings" | ||
| parent="menu_real_estate_root" | ||
| sequence="2"/> | ||
|
|
||
| <menuitem | ||
| id="menu_real_estate_property_types" | ||
| name="Property Types" | ||
| parent="menu_real_estate_settings" | ||
| action="action_estate_property_type" | ||
| sequence="1"/> | ||
|
|
||
| <menuitem | ||
| id="menu_real_estate_property_tags" | ||
| name="property Tags" | ||
| parent="menu_real_estate_settings" | ||
| action="action_estate_property_tag" | ||
| sequence="2"/> | ||
|
|
||
| <!-- <menuitem | ||
| id="menu_real_estate_property_offer" | ||
| name="Property Offfer" | ||
| parent="menu_real_estate_settings" | ||
| action="action_estate_property_offer"/> --> | ||
|
|
||
| </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,39 @@ | ||
| <odoo> | ||
|
|
||
| <!-- <record id="action_estate_property_offer" model="ir.actions.act_window"> | ||
| <field name="name">Property Offer</field> | ||
| <field name="res_model">estate.property.offer</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> --> | ||
|
|
||
| <record id="list_estate_property_offer" 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="Property Offer"> | ||
| <field name="price"/> | ||
| <field name="status"/> | ||
| <field name="partner_id"/> | ||
| <field name="property_id"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="form_estate_propety_offer" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.form</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <form> | ||
| <sheet> | ||
| <group> | ||
| <field name="price"/> | ||
| <field name="partner_id"/> | ||
| <field name="status"/> | ||
| <field name="property_id"/> | ||
| </group> | ||
| </sheet> | ||
| </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,33 @@ | ||
| <odoo> | ||
|
|
||
| <record id="action_estate_property_tag" 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> | ||
|
|
||
| <record id="list_estate_property_tag" model="ir.ui.view"> | ||
| <field name="name">estate.property.tag.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="form_estate_property_tag" model="ir.ui.view"> | ||
| <field name="name">estate.property.tag.form</field> | ||
| <field name="model">estate.property.tag</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Property Tags"> | ||
| <sheet> | ||
| <group> | ||
| <field name="name"></field> | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| </odoo> | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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,34 @@ | ||
| <odoo> | ||
|
|
||
| <record id="action_estate_property_type" model="ir.actions.act_window"> | ||
| <field name="name">Porperty Types</field> | ||
| <field name="res_model">estate.property.type</field> | ||
| <field name='view_mode'>list,form</field> | ||
| </record> | ||
|
|
||
| <record id="view_estate_property_type_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.type.list</field> | ||
| <field name="model">estate.property.type</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Property types"> | ||
|
|
||
| <field name="name" /> | ||
sumai-odoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="view_estate_property_types_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.type.form</field> | ||
| <field name="model">estate.property.type</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Property Types"> | ||
| <sheet> | ||
| <group> | ||
| <field name="name"/> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| </odoo> | ||
Oops, something went wrong.
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.