Skip to content

[ADD] estate: add real estate advertisement module#1230

Draft
vikvi-odoo wants to merge 8 commits intoodoo:19.0from
odoo-dev:19.0-tutorial-vikvi
Draft

[ADD] estate: add real estate advertisement module#1230
vikvi-odoo wants to merge 8 commits intoodoo:19.0from
odoo-dev:19.0-tutorial-vikvi

Conversation

@vikvi-odoo
Copy link
Copy Markdown

@vikvi-odoo vikvi-odoo commented Apr 6, 2026

Add a new real estate advertisement module that allows
users to manage property listings. The module includes
the data model, security access rights, and the basic
UI to navigate and interact with property records.

Chapter-2 to Chapter-5

@robodoo
Copy link
Copy Markdown

robodoo commented Apr 6, 2026

Pull request status dashboard

@vikvi-odoo vikvi-odoo requested review from mash-odoo and removed request for mash-odoo April 6, 2026 04:30
@vikvi-odoo
Copy link
Copy Markdown
Author

solved issue of models

@vikvi-odoo vikvi-odoo requested a review from mash-odoo April 6, 2026 08:17
- Created estate.property model
- Added module structure and manifest configuration
- Implemented fields and basic validations
- Fixed import and dependency issues
- Resolved runtime errors during module loading

[fix] estate: fix issue of external id and access rights

[fix] estate: fix issue of access rights for estate.property model

[fix] estate: fix issue of installation of estate module due to missing access rights
- Added ir.model.access.csv for estate.property
- Configured basic CRUD permissions for internal users

Chapter 4 - Security Intro
@vikvi-odoo vikvi-odoo force-pushed the 19.0-tutorial-vikvi branch from c610728 to cdb5287 Compare April 6, 2026 12:46
-   Introduce the estate module into the user interface.
-   Add estate_menus.xml to define the module's menu structure and make it visible.
-   Include estate_property_views.xml to define the initial property views.
-   Implement the necessary extra fields and conditions as required by chapter 5.
@vikvi-odoo vikvi-odoo changed the title Add chapter 4 [ADD] estate: add real estate advertisement module Apr 8, 2026
@mash-odoo mash-odoo removed their request for review April 8, 2026 06:23
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 @vikvi-odoo

You have written too many comments in the code.
Writing a comment is good, but no need to write a comments onevery single line. It's only required, like when there is a complex computation, etc.

Please use ruff for proper formatting.

Thanks

from odoo import fields, models
from odoo.tools import date_utils

class EstateProperty(models.Model):
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 two empty lines before class starts.

_name = "estate.property"
_description = "Estate Property for purchasing and selling properties"

# _log_access = False # this will disable the automatic creation of create_uid,create_date,write_uid,write_date fields in our table. these fields are used to track who created and modified the record and when it was done.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think it is required. As you didn't use _log_access here.

Comment on lines +41 to +56
# module: a module is a package of features/functionality in odoo.Ex : CRM,Sales,EstateProperty.it's a complete feature bundle
# model : model is a python class that define data structure and logic.it represent a real world entity
# table: a table is the actual data stored in database.our _name = "estate.property" will converted to estate_property table name
# relationship : module -> model -> table

# Odoo's ORM calls `_auto_init()` on your model, which introspects all fields and runs `CREATE TABLE` / `ALTER TABLE`. Here's roughly what happens:
# ```
# _name = "estate.property" => estate is a module name and property is a model name this tells that "property" belongs to estate module. giving name like using dot (estate.property) is a odoo convention
# table name = "estate_property"
# The _ prefix tells Odoo "this is configuration about the model itself", not "this is a field to store in the database".


#what is happening in backend? how odoo is connecting to psql even if we are not adding code to connect it?
#=>when odoo load's our model it convert out table name estate.property to estate_property
#=> Odoo's base Model class (which your class inherits from) has a method called _auto_init(). This runs automatically during module install/upgrade.
#=> inside auto_init method there is self._cr, it's a database cursor this is the actual live connection to postgresql.it send the connection request to psycopg2 py library and this library establish the connection to psql
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need to describe this in code.

Comment on lines +1 to +11
ir.model.access.csv file control the access of our model through odoo.

User clicks "Create Property" in Odoo UI
Odoo checks ir.model.access.csv
is this user's group allowed to create?
YES → ORM fires SQL to PostgreSQL
NO → "Access Denied" error shown to user
PostgreSQL never even gets the request
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same for this.

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo> <!--<odoo> tells odoo this is a data file.everything inside is odoo records.without this odoo will not load the data and give the error-->
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Writing a comment is good, but no need to write a comment here. It's only required when there is complex computation, etc.

<?xml version="1.0" encoding="UTF-8" ?>
<odoo> <!--<odoo> tells odoo this is a data file.everything inside is odoo records.without this odoo will not load the data and give the error-->
<menuitem id="estate_root_menu" name="Real Estate" > <!--this is root menu-->
<menuitem id="estate_first_level_menu" name="Advertisements"> <!--this is first level menu.this create another record in ir_model_data table and it's nestead so odoo automatically set parent as estate_root_menu's db id-->
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Writing a comment is good, but no need to write a comment here. It's only required when there is complex computation, etc.

Comment on lines +3 to +6
<record id="estate_property_action" model="ir.actions.act_window">
<field name="name">Estate Property</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</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.

indentation issue.

- Removed superfluous comments that added noise without providing value.
- Addressed inconsistent indentation to ensure adherence to code style guidelines.
- Addressed inconsistent indentation to ensure adherence to code style guidelines.
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