-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ADD] estate: added a new Estate Module #844
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
base: 18.0
Are you sure you want to change the base?
Conversation
Created a new 'estate' module as per Chapters 2 and 3. Defined the module structure, added the business object 'estate.property' in a Python class, and configured the __manifest__.py and __init__.py to make the app visible in the Apps page.
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.
Here is the review!
Some comments:
- Follow commit message guidelines. This tool can be helpful.
- Commit 2 and 7 are useless you should use
git commit --amend
to do such stuff. - Can you have a look at linting in all your files. I see too many linting issues.
'author': "Kalpan Desai", | ||
'category': 'Estate/sales', | ||
'description': """ | ||
Module specifically designed for real estate buisness case. |
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.
typo with "business".
""", | ||
'installable': True, | ||
'application': 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.
Unnecessary empty line here. Also you can add "license" key.
estate/models/estate_property.py
Outdated
@@ -0,0 +1,23 @@ | |||
from odoo import models , fields |
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.
Should not have a space after models, which you remove later in other commit.
|
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_description = "Details of all the properties will be stored over here." |
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.
_description
should be a concise name like "Real Estate Property", not a sentence.
estate/models/estate_property.py
Outdated
|
||
|
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.
Should only have one empty line not two.
best_price = fields.Float(compute="_compute_best_price", string="Best Price", readonly=True) | ||
|
||
_sql_constraints = [ | ||
('check_expected_price', 'CHECK(expected_price > 0)', 'The expected price must strictly Positive.'), |
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.
('check_expected_price', 'CHECK(expected_price > 0)', 'The expected price must strictly Positive.'), | |
('check_expected_price', 'CHECK(expected_price > 0)', 'The expected price must be strictly Positive.'), |
|
||
_sql_constraints = [ | ||
('check_expected_price', 'CHECK(expected_price > 0)', 'The expected price must strictly Positive.'), | ||
('check_selling_price', 'CHECK(selling_price > 0)', 'The selling price must be positive.'), |
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.
Different sentence, why not strictly here ^^'.
|
||
_sql_constraints = [ | ||
("check_price", "CHECK(price > 0)", "The price must be strictly positive.") | ||
] |
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.
linting.
_inherit = "estate.property" | ||
|
||
def action_sold(self): | ||
print("Log by kdes inside Child model", flush=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.
remove this print.
(ref('estate_property_view_list'), 'list'), | ||
(ref('estate_property_properties_form_view'), 'form'), | ||
(ref('estate_property_kanban'), 'kanban') | ||
]"/> |
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.
Linting
Created a new 'estate' module as per Chapters 2 and 3. Defined the module structure added the business object 'estate.property' in a Python class, and configured the __manifest__.py and __init__.py to make the app visible in the Apps page.
Applied the security access to base users group using CSV. Started working on UI: Create the estate_property_views.xml file in the Views folder Created an action for the model estate.property. Created the estate_menus.xml Created the three levels of menus for the estate.property Added the appropriate default attributes so that: the default number of bedrooms is 2 the default availability date is in 3 months Added active and state field. Defined a custom list view for the estate.property Defined a custom form view for the estate.property Defined a custom search view for the estate.property
Added Property type model, created view and added it to menu Added filed to Buyer and salesperson field to property model Added Property tag model, created view and added it to menu Created many2many relation between property tags and property model Added Property offer model, created view and added property form page. Added the total_area field to estate.property. It is defined as the sum of the living_area and the garden_area. Added the best_price field to estate.property. It is defined as the highest (i.e. maximum) of the offers’ price. Added validity and date_deadline to property offer Defined inverse function so that the user can set either the date or the validity. Created an onchange in the estate.property model in order to set values for the garden area (10) and orientation (North) when garden is set to True. When unset, clear the fields. Added the buttons ‘Cancel’ and ‘Sold’ to the estate.property model. A cancelled property cannot be set as sold, and a sold property cannot be cancelled. Added the buttons ‘Accept’ and ‘Refuse’ to the estate.property.offer model. When an offer is accepted, set the buyer and the selling price for the corresponding property.
Added the following constraints to their corresponding models: A property expected price must be strictly positive A property selling price must be positive An offer price must be strictly positive A property tag name and property type name must be unique Added a python constraint so that the selling price cannot be lower than 90% of the expected price. Used the statusbar widget in order to display the state of the estate.property Added ordering to each model as per requirement. Added manual ordering to property type field. Added widget options to color the tag. Added conditional display of buttons Using the invisible attribute Made property tag and offers list view editable Made the field date_availability on the estate.property list view optional and hidden by default Added conditional decoration to property and offer list view. Added availability to the default search filter Added a stat button to the property type to view offers for each property.
Added the following constraints to their corresponding models: A property expected price must be strictly positive A property selling price must be positive An offer price must be strictly positive A property tag name and property type name must be unique Added a python constraint so that the selling price cannot be lower than 90% of the expected price. Used the statusbar widget in order to display the state of the estate.property Added ordering to each model as per requirement. Added manual ordering to property type field. Added widget options to color the tag. Added conditional display of buttons Using the invisible attribute Made property tag and offers list view editable Made the field date_availability on the estate.property list view optional and hidden by default Added conditional decoration to property and offer list view. Added availability to the default search filter Added a stat button to the property type to view offers for each property. Added kanban view to the estate property
Modified code to meet coding guidelines. Solved all Runbot Errors.
8537953
to
fe2ca9a
Compare
An Odoo real estate module, created by following Odoo's tutorials, is a
specialized application designed to streamline property management within the
Odoo platform. This module provides a centralized system for managing property
listings, including key details like property type, price, and location. It
allows users to efficiently track property offers, manage their status, and
oversee the entire sales process from initial offer to final sale. Additionally,
the module helps in organizing property types and tags for better categorization
and searching, while also managing real estate agents and their associated
properties. By leveraging Odoo's integrated framework, this module offers a
practical, hands-on introduction to building business applications,
demonstrating how to create models, design views, and implement business logic
specific to the real estate industry.