Skip to content

19.0 tutorials mrgor - #1362

Draft
mrgor-odoo wants to merge 12 commits into
odoo:19.0from
odoo-dev:19.0-tutorials-mrgor
Draft

19.0 tutorials mrgor#1362
mrgor-odoo wants to merge 12 commits into
odoo:19.0from
odoo-dev:19.0-tutorials-mrgor

Conversation

@mrgor-odoo

Copy link
Copy Markdown

No description provided.

Initialize the estate module by adding the required module
configuration files. This establishes the basic structure needed
for future development and allows Odoo to recognize the module.
@robodoo

robodoo commented Jul 3, 2026

Copy link
Copy Markdown

Pull request status dashboard

Initialize the estate module by adding the required module
configuration files. This establishes the basic structure needed
for future development and allows Odoo to recognize the module.
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch from 2c55e50 to ce43cf1 Compare July 3, 2026 13:12
Create the basic property model for the Real Estate module.

This model allows storing essential property information and
provides the base structure for adding more features.

task = chapter 3 completed
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch 2 times, most recently from 8a0d18c to 4f1eeb0 Compare July 7, 2026 11:46
Newly created models are inaccessible by default in Odoo.
Define access rights so Internal Users can interact with the
estate.property model and remove the missing access rules warning.

Task Completed chapter 4
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch from 4f1eeb0 to a9cc58d Compare July 7, 2026 11:47
- Allow users to access and manage property records from the UI.

- Improve data consistency by protecting important field values.

- Prevent unwanted data from being copied to duplicate records.

- Reduce manual work by providing default field values.

- Prepare the property model for future business workflows by introducing state fields.

Task Completed chapter 5
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch from 3113f4d to 707c862 Compare July 10, 2026 13:29
The default generated views are not suitable for a business application.
A custom UI is required to improve data organization and allow users
to efficiently manage and search property records as the application
grows.

Task Completed chapter 6
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch 2 times, most recently from 6e79df5 to 904ee8f Compare July 28, 2026 11:18
Introduce a dedicated property type model to improve how
properties are organized and managed within the application.

- Centralize the management of property types
- Allow properties to be assigned reusable categories
- Improve the user experience when organizing listings
- Simplify property organization and maintenance
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch 4 times, most recently from 9638607 to 56faa55 Compare July 30, 2026 13:29
Improve property management by introducing buyer and salesperson
relationships together with reusable property tags.

Associate properties with buyers and salespersons, automatically
assign the current user as the default salesperson, prevent buyer
information from being copied during duplication, and introduce the
Property Tag model with its views, menu, action, access rights, and
a many2many relationship for assigning multiple tags to properties.
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch 3 times, most recently from b36d639 to 32d3417 Compare July 31, 2026 11:35
Allow properties to track offers from potential buyers without
requiring a dedicated menu, keeping offer management within the
property workflow.
Introduce the Property Offer model with its views and access rights,
link offers to properties through a many2one relationship, and expose
them on the property form using a one2many field.

Task Completed chapter 7
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch from 32d3417 to dfdf6ed Compare July 31, 2026 11:39

@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 and suggestions.. 🐣
Also please change your PR title and description!!

Comment thread estate/models/estate_property.py Outdated
Comment on lines +6 to +7
_description = "Real Estate Property"
name = fields.Char(required=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
_description = "Real Estate Property"
name = fields.Char(required=True)
_description = "Real Estate Property"
name = fields.Char(required=True)

Comment thread estate/models/estate_property.py Outdated


class EstateProperty(models.Model):
_name = "estate.property"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
_name = "estate.property"
_name = 'estate.property'

wrap the technical strings in single quotes and the strings which appear on UI and visible to customer in double quotes

Comment thread estate/models/estate_property.py Outdated
Comment on lines +29 to +30
active = fields.Boolean(default=True)
state = fields.Selection(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arrange all the fields alphabetically so that it's easier to locate it later

Comment on lines +22 to +27
selection=[
("north", "North"),
("south", "South"),
("east", "East"),
("west", "West"),
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
selection=[
("north", "North"),
("south", "South"),
("east", "East"),
("west", "West"),
]
selection=[
('north', "North"),
('south', "South"),
('east', "East"),
('west', "West"),
]

Comment thread estate/models/estate_property.py Outdated
property_type_id = fields.Many2one("estate.property.type", string="Property Type")
buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False)
salesperson_id = fields.Many2one(
"res.users", string="Salesperson", default=lambda self: self.env.user

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 need to use here lambda function?
Do we have any other approach 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.

I used a lambda because the logic is only one line, so it keeps the code short and readable. Another approach would be to define a method like _default_salesperson() that returns self.env.user and use that method as the default. Both work, but I felt lambda was simpler here.

Comment thread estate/__manifest__.py Outdated
{
"name": "Real Estate",
"version": "1.0",
"author": "Mrunmayee",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When you are working for a company, you should keep the author name as Odoo S.A. or just skip writing it.

Comment thread estate/__manifest__.py
"name": "Real Estate",
"version": "1.0",
"author": "Mrunmayee",
"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's the purpose of depends?

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.

depends specifies which modules my module relies on. Odoo uses it to ensure those modules are installed and loaded before installing or upgrading my module. In this case, I added base because my module uses the core Odoo framework, such as models.Model, field types, and models like res.users and res.partner.

description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(
copy=False, default=lambda self: fields.Date.add(fields.Date.today(), months=3)

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 this be done in any other way?

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, another approach is to create a separate method, for example _default_date_availability(), which returns the default date, and then pass that method to default.

Comment thread estate/models/estate_property.py Outdated
"res.users", string="Salesperson", default=lambda self: self.env.user
)
tag_ids = fields.Many2many("estate.property.tag", string=" Property Tags")
offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Where can I find the records of offers connected to a property?

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 offers are stored in the estate.property.offer table. They are connected to a property using the property_id field. When I access offer_ids, Odoo automatically fetches all offer records whose property_id matches the current property.

Comment thread estate/views/estate_property_views.xml Outdated
<filter
string="Postcode"
name="group_postcode"
context="{'group_by':'postcode'}"/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WDYM by 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.

context passes extra information to Odoo. In this case, it tells Odoo to group the records by postcode.

- Follow Odoo coding conventions for string quoting
- Reorder model fields alphabetically
- Improve code consistency and readability
- Apply requested review changes
@mrgor-odoo
mrgor-odoo force-pushed the 19.0-tutorials-mrgor branch from 56cd7e0 to a96ee70 Compare August 5, 2026 11:48
The property total area should be derived automatically to ensure
data consistency and avoid manual calculation.

Added a computed field that calculates the total area from the
living area and garden area, and displayed it in the property
form view.
The property best offer should be computed automatically from the
related offers to ensure it always reflects the highest available
offer.

Added the computed `best_price` field using the related
`offer_ids.price` dependency and displayed it in the property form
view.
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