-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[ADD] estate: Bootstrap new 'estate' module #1020
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
haahi-odoo
wants to merge
8
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorial-haahi
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f9e58d2
[ADD] estate: Bootstrap new 'estate' module
haahi-odoo a8b1737
[ADD] estate: Bootstrap new 'estate' module
haahi-odoo b1d4714
[IMP] Estate Configure field defaults and UI menus
haahi-odoo 5ddda6c
[IMP] estate : Added list & form view
haahi-odoo c0bc17c
[FIX] estate : mismatch field name
haahi-odoo 5d220be
[FIX]: indentation Error
haahi-odoo a3a92c5
[IMP] estate: Implement list, form, and search views with grouping fu…
haahi-odoo fa72a21
[IMP] Real Estate: Enhanced Data Models and Functionalities
haahi-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,2 @@ | ||
| 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,17 @@ | ||
| { | ||
| 'name': 'Real Estate', | ||
| 'depends': ['base'], | ||
| 'license': 'AGPL-3', | ||
| 'application': True, | ||
| 'installable': True, | ||
| 'author': 'Odoo S.A.', | ||
| 'category':'Tutorials', | ||
| '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' | ||
| ], | ||
| } | ||
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,49 @@ | ||
| from odoo import models, fields | ||
| from dateutil.relativedelta import relativedelta | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
| _name = "estate.property" | ||
| _description = "Real Estate Property" | ||
|
|
||
| name = fields.Char(required=True) | ||
| description = fields.Text() | ||
| postcode = fields.Char() | ||
| date_availability = fields.Date("Availability Date", default=fields.Date.today() + relativedelta(months=3)) | ||
| expected_price = fields.Float("Expected Price", required=True) | ||
| selling_price = fields.Float("Selling Price", readonly=True) | ||
| bedrooms = fields.Integer(default=2) | ||
| living_area = fields.Integer("Living Area(sqm)") | ||
| facades = fields.Integer() | ||
| garage = fields.Boolean() | ||
| garden = fields.Boolean() | ||
| garden_area = fields.Integer("Garden Area(sqm)") | ||
| garden_orientation = fields.Selection( | ||
| selection=[ | ||
| ("north", "North"), | ||
| ("south", "South"), | ||
| ("east", "East"), | ||
| ("west", "West"), | ||
| ], | ||
| string="Garden Orientation", | ||
| ) | ||
| 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", | ||
| ) | ||
| active = fields.Boolean(default=True) | ||
| 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") | ||
| tag_ids = fields.Many2many("estate.property.tag", string="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,15 @@ | ||
| 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", 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 fields, models | ||
|
|
||
|
|
||
| class EstatePropertyTag(models.Model): | ||
| _name = "estate.property.tag" | ||
| _description = "Real Estate Property Tag" | ||
|
|
||
| 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,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 | ||
| access_estate_property_tag,estate.property.tag.access,model_estate_property_tag,base.group_user,1,1,1,1 | ||
| access_estate_property_offer,estate.property.offer.access,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,26 @@ | ||
| <odoo> | ||
| <menuitem id="estate_menu_root" name="Real Estate" /> | ||
|
|
||
| <menuitem id="menu_estate_advertisements" | ||
| name="Advertisements" | ||
| parent="estate_menu_root" /> | ||
|
|
||
| <menuitem id="menu_estate_property_action" | ||
| name="Properties" | ||
| parent="menu_estate_advertisements" | ||
| action="action_estate_property" /> | ||
|
|
||
| <menuitem id="menu_estate_settings" | ||
| name="Settings" | ||
| parent="estate_menu_root" /> | ||
|
|
||
| <menuitem id="menu_estate_property_type_action_settings" | ||
| name="Property Types" | ||
| parent="menu_estate_settings" | ||
| action="estate_property_type_action" /> | ||
|
|
||
| <menuitem id="menu_estate_property_tag_action_settings" | ||
| name="Property Tags" | ||
| parent="menu_estate_settings" | ||
| action="action_estate_property_tag" /> | ||
| </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,29 @@ | ||
| <odoo> | ||
| <record id="estate_property_offer_tree_view" 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> | ||
| <field name="price" /> | ||
| <field name="partner_id" /> | ||
| <field name="status" /> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_offer_form_view" 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"/> | ||
| </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,8 @@ | ||
| <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> | ||
| </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,7 @@ | ||
| <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,109 @@ | ||
| <odoo> | ||
| <record id="action_estate_property" model="ir.actions.act_window"> | ||
| <field name="name">Properties</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| <field name="help" type="html"> | ||
| <p class="o_view_nocontent_smiling_face"> | ||
| Create a new property | ||
| </p> | ||
| </field> | ||
| </record> | ||
|
|
||
| <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="lists"> | ||
| <field name="name" /> | ||
| <field name="postcode" /> | ||
| <field name="bedrooms" /> | ||
| <field name="living_area" /> | ||
| <field name="expected_price" /> | ||
| <field name="selling_price" /> | ||
| <field name="date_availability" /> | ||
| <field name="property_type_id" /> | ||
| <field name="tag_ids" widget="many2many_tags" /> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="view_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="form"> | ||
| <sheet> | ||
| <group> | ||
| <group> | ||
| <field name="name" /> | ||
| <field name="postcode" /> | ||
| <field name="date_availability" /> | ||
| <field name="property_type_id" /> | ||
| <field name="tag_ids" widget="many2many_tags" /> | ||
| </group> | ||
| <group> | ||
| <field name="expected_price" /> | ||
| <field name="selling_price" /> | ||
| <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> | ||
| </group> | ||
| <notebook> | ||
| <page string="Discription"> | ||
| <field name="description"></field> | ||
| </page> | ||
|
|
||
| <page string="Offers"> | ||
| <field name="offer_ids"> | ||
| <list> | ||
| <field name="price" /> | ||
| <field name="partner_id" /> | ||
| <field name="status" /> | ||
| </list> | ||
| <form> | ||
| <group> | ||
| <field name="price" /> | ||
| <field name="partner_id" /> | ||
| <field name="status" /> | ||
| </group> | ||
| </form> | ||
| </field> | ||
| </page> | ||
|
|
||
| <page string="Other Info"> | ||
| <group> | ||
| <field name="buyer_id" /> | ||
| <field name="salesperson_id" /> | ||
| </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="search"> | ||
| <field name="name" /> | ||
| <field name="postcode" /> | ||
| <field name="expected_price" /> | ||
| <field name="property_type_id" /> | ||
| <filter | ||
| string="Available" | ||
| name="available_properties" | ||
| domain="['|', ('state', '=', 'New'), ('state', '=', 'Offer Received')]" /> | ||
| <filter string="Postcode" name="group_by_postcode" | ||
| context="{'group_by': 'postcode'}" /> | ||
| </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.
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.