Skip to content

[ADD] estate: implement estate module (setup, models, fields, security)#1226

Draft
sngohodoo wants to merge 11 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-sngoh
Draft

[ADD] estate: implement estate module (setup, models, fields, security)#1226
sngohodoo wants to merge 11 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-sngoh

Conversation

@sngohodoo
Copy link
Copy Markdown

This PR introduces the initial implementation of the estate module following the Odoo tutorials.

The following features have been implemented:

  • Development environment setup and configuration
  • Creation of the estate module structure
  • Definition of the estate.property model
  • Implementation of basic fields
  • Addition of required attributes on fields
  • Creation of access control rules for the module

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

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
@robodoo
Copy link
Copy Markdown

robodoo commented Apr 3, 2026

Pull request status dashboard

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
Copy link
Copy Markdown

@bit-odoo bit-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneccary diff.

@@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be one empty line at the end of the file.

</search>
</field>
</record>
</odoo> No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be one empty line at the end of the file.

</form>
</field>
</record>
<record id="estate_property_view_search" model="ir.ui.view">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to have one empty line before it.

</list>
</field>
</record>
<record id="estate_property_view_form" model="ir.ui.view">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
@sngohodoo sngohodoo force-pushed the 19.0-tutorials-sngoh branch from 3d4c9fe to 1bd66ff Compare April 8, 2026 12:28
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
@sngohodoo sngohodoo force-pushed the 19.0-tutorials-sngoh branch from e706529 to c2e311c Compare April 9, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants