[ADD] estate: implement estate module (setup, models, fields, security)#1226
[ADD] estate: implement estate module (setup, models, fields, security)#1226
Conversation
Initialize the estate module by creating its base structure. This includes adding the required __init__.py and __manifest__.py files, and defining the module with its name and dependency on the base module. The purpose of this step is to register the module in Odoo so it can be detected, listed in the Apps menu, and installed for further development.
Define the estate.property model to enable data storage for real estate properties. This introduces the initial ORM model with a basic definition, allowing Odoo to automatically create the corresponding database table. The model is integrated into the module by adding the models directory and updating the __init__.py files accordingly. A _description field is also added to provide a clear representation of the model and remove related warnings during server startup. This step establishes the foundation for storing and managing property data in the upcoming development stages. Chapter 3: Models And Basic Fields Task: Define and initialize estate.property model
Add basic fields to the estate.property model to store property details. This includes fields such as name, description, pricing, location, and property characteristics using appropriate Odoo field types. The purpose of this change is to enable structured data storage for real estate properties and prepare the model for further business logic and UI integration. Additionally, set required=True on name and expected_price to enforce data integrity and ensure these critical fields are always provided. Chapter 3: Models And Basic Fields Task: Add basic fields and set required attributes
Add basic access rights for the estate module to allow users to interact with the estate.property model. A new ir.model.access.csv file is introduced to define permissions for the model. Access is granted to internal users to read, create, write, and delete records. This ensures the model is usable and resolves the missing access rules warning during module upgrade. Chapter: 4 (Security Intro) Task: Define access rights using ir.model.access.csv
The __manifest__.py file contained unnecessary whitespace which could affect readability and consistency. This commit removes the extra blank spaces to keep the file clean and aligned with coding standards. Chapter: 4
Create initial user interface for the estate module including: - window action for estate.property model - tree (list) and form views for property records - menu hierarchy to access the model from the UI Fix issues related to view types and field definitions during implementation. Chapter 5: First UI – Menus, Actions, and Views
Refined the list and form views of the estate.property model to make the UI more structured and easier to use. Added a custom list view to display the main property fields in a clear tabular format. Updated the form view layout using sheet and group to organize fields properly. Also introduced basic UI behaviors such as readonly fields and conditional visibility using attrs, so the form reacts dynamically based on user input. Chapter: 6 (Basic Views) Task: list and form view structure with basic UI behavior
Add relational fields to the property model. Linked each property with a property type, a buyer, and a salesperson using Many2one fields. This allows us to connect records instead of storing plain data. Set the default salesperson as the current user and ensured the buyer is not copied when duplicating a property. Chapter: 7 (Relations Between Models) Task: Add buyer, salesperson, and property type using Many2one
bit-odoo
left a comment
There was a problem hiding this comment.
Hello @sngohodoo
Good Work!
Can you please follow the git commit message guidelines?
https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html
Thanks
estate/security/ir.model.access.csv
Outdated
| @@ -0,0 +1,3 @@ | |||
| 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 No newline at end of file | |||
There was a problem hiding this comment.
should be one empty line at the end of the file.
| <menuitem id="property_types" action="estate_property_type_action" /> | ||
| </menuitem> | ||
| </menuitem> | ||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
should be one empty line at the end of the file.
| <field name="view_mode">form</field> | ||
| </record> | ||
|
|
||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
should be one empty line at the end of the file.
| </search> | ||
| </field> | ||
| </record> | ||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
should be one empty line at the end of the file.
| </form> | ||
| </field> | ||
| </record> | ||
| <record id="estate_property_view_search" model="ir.ui.view"> |
There was a problem hiding this comment.
It is good to have one empty line before it.
| </list> | ||
| </field> | ||
| </record> | ||
| <record id="estate_property_view_form" model="ir.ui.view"> |
There was a problem hiding this comment.
It is good to have one empty line before it.
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
| <record id="estate_property_view_list" model="ir.ui.view"> |
There was a problem hiding this comment.
It is good to have one empty line before it.
Improve UI for property type model. Added a list view to display all property types instead of always opening the form view directly. Also adjusted the form view for better usability. Chapter: 7 (Relations Between Models) Task: Add buyer, salesperson, and property type using Many2one
Add relations to improve property model. Added property tags using Many2many and created the tag model with custom basic views. Also implemented property offers using One2many with a new offer model. Chapter: 7 (Relations Between Models) Task: Add tags (Many2many) and offers (One2many)
3d4c9fe to
1bd66ff
Compare
Add computed fields to derive values in property model. Implemented computed fields based on other field values to avoid storing redundant data and keep values consistent. Chapter: 8 (Computed Fields And Onchanges) Task: Add computed fields
e706529 to
c2e311c
Compare

This PR introduces the initial implementation of the estate module following the Odoo tutorials.
The following features have been implemented:
This work establishes the foundation for managing real estate properties within Odoo.
Chapter: 1, 2, 3, 4
Task: Setup environment, create module, define models, add fields, and implement security access