Skip to content

[ADD] estate: initialize estate module#1333

Draft
vrushibh wants to merge 6 commits into
odoo:19.0from
odoo-dev:19.0-tutorials-vrbha
Draft

[ADD] estate: initialize estate module#1333
vrushibh wants to merge 6 commits into
odoo:19.0from
odoo-dev:19.0-tutorials-vrbha

Conversation

@vrushibh

@vrushibh vrushibh commented Jun 5, 2026

Copy link
Copy Markdown

Add the basic module structure and manifest file for the estate application.

Add the basic module structure and manifest file for the estate
application.
@robodoo

robodoo commented Jun 5, 2026

Copy link
Copy Markdown

Pull request status dashboard

vrushibh added 3 commits June 8, 2026 15:29
 Define the 'estate.property' model.
- Add basic fields: name, description, postcode, date_availability,
  expected_price, selling_price, bedrooms, living_area, facades, garage, garden,
  garden_area, and garden_orientation.
- Set 'name' and 'expected_price' as required fields.
- Initialize the models package and set up imports.
- Create ir.model.access.csv in security folder
- Grant read, write, create, and unlink permissions to base.group_user
- Register security file in __manifest__.py
- Fix manifest warnings by adding author and license keys
- Add tree (list), form, and search views for 'estate.property'
  in views/estate_property_views.xml.
- Configure action 'action_estate_property' to load 'list,form,kanban' views
  and default filter 'available'.
- Define advertisements menu structure in views/estate_menus.xml.
- Clean up hardcoded field column widths from the list view in
  views/estate_property_views.xml to use standard auto-sizing layout.

@mash-odoo mash-odoo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello!
Good start on the task..
Here are a few comments...Have a look!
Also, mention the chapter number in the commits.

Comment thread estate/models/estate_property.py
Comment thread estate/security/estate_security.xml Outdated
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we write this tag here?

@vrushibh vrushibh Jun 19, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The <data> tag was not needed because we were not using attributes like noupdate="1". So, I removed the unnecessary tags from the security and view files and kept only the root tag.

Comment thread estate/security/estate_security.xml Outdated

<record id="module_category_real_estate" model="ir.module.category">
<field name="name">Real Estate</field>
<field name="sequence">10</field>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the purpose of this sequence field?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The sequence field decides the order of the categories. A smaller number shows the category first.

Comment thread estate/views/estate_property_views.xml Outdated
<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form,kanban</field>
<field name="context">{'search_default_available': 1}</field>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the difference between domain and context?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

-Domain is used to filter records at the database level (like a SQL WHERE clause). It decides "which" records to display.

-Context is used to pass information to the view, such as grouping records (like {'group_by': 'postcode'} ) or setting default values for new records.

Comment thread estate/views/estate_property_views.xml Outdated
<field name="living_area" />
<field name="facades" />
<separator />
<filter name="available" string="Available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you optimize this domain?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I have optimized it to:
domain= [('state', 'in', ('new', 'offer_received'))]

It is better because it is much easier to read and makes it simple to add more states in the future.

Comment thread estate/views/estate_property_views.xml Outdated
<field name="bedrooms" />
<field name="living_area" />
<field name="facades" />
<separator />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What's the working of a separator?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The tag shows a vertical line between filters in the UI.
Logically, it joins filters with an AND operator instead of OR,

I have practiced this in our search view (estate_property_view_search) by using to split the State filters and Feature filters (Garage/Garden).

Comment thread estate/views/estate_property_views.xml Outdated
</field>
</record>

<record id="view_estate_property_form" model="ir.ui.view">

@mash-odoo mash-odoo Jun 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Follow this for naming your views

Suggested change
<record id="view_estate_property_form" model="ir.ui.view">
<record id="estate_property_view_form" model="ir.ui.view">

<model_name>_view_<view_type>, where view_type is kanban, form, list, search,...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done. I have renamed all view IDs to follow the <model_name>view<view_type> format (e.g., estate_property_view_form).

Comment thread estate/__manifest__.py
"name": "Real Estate",
"author": "Odoo S.A.",
"license": "LGPL-3",
"depends": ["base"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What if we don't write base here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

If we don't write base, Odoo will still load it automatically. However, writing it explicitly is a best practice to make the module dependency clear.

@mash-odoo mash-odoo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello!
Good start on the task..
Here are a few comments...Have a look!

vrushibh added 2 commits June 22, 2026 17:58
Introduce the property tag (estate.property.tag) and property offer
(estate.property.offer) models, establishing relationship fields.
- Add estate.property.tag model with basic views.
- Add Many2many field tag_ids to estate.property.
- Add estate.property.offer model with form and list views.
- Add One2many field offer_ids to estate.property.
- Add security access rules (ACLs) for both new models

task-7
Address the code styling, domain filters, and manifest configurations
requested in the code review. Additionally, set up demo data for
the property, type, and tag models.
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