Skip to content

risri - Technical Training#1326

Open
risri-odoo wants to merge 18 commits into
odoo:19.0from
odoo-dev:19.0-training-risri
Open

risri - Technical Training#1326
risri-odoo wants to merge 18 commits into
odoo:19.0from
odoo-dev:19.0-training-risri

Conversation

@risri-odoo

Copy link
Copy Markdown

This module is created as part of the Odoo Server Framework 101 training. The estate module provides a foundation for building a real estate advertisement application, which is not covered by any existing standard Odoo module.

This module is created as part of the Odoo Server Framework 101
training. The estate module provides a foundation for building
a real estate advertisement application, which is not covered
by any existing standard Odoo module.
@robodoo

robodoo commented Jun 4, 2026

Copy link
Copy Markdown

Pull request status dashboard

@risri-odoo risri-odoo marked this pull request as draft June 5, 2026 09:47
@risri-odoo risri-odoo marked this pull request as ready for review June 5, 2026 09:53
risri-odoo added 17 commits June 8, 2026 14:02
Add the EstateProperty model in estate/models/estate_property.py with all required field definitions for the real estate advertisement module.
Fields include name, description, postcode, date_availability,expected_price, selling_price, bedrooms, living_area, facades,garage, garden, garden_area and garden_orientation (Selection).Both name and expected_price are required fields.
Introduce estate.property.type and estate.property.tag as new models to categorize properties, following the same pattern as estate.property.

Add property_type_id, buyer_id and salesperson_id as many2one fields on estate.property and added many2many fields as property tags.

@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!!
I have added a few comments.
Have a look at it..

_name = "estate.property"
_description = "Real Estate Property"

name = fields.Char(string="Name", 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.

If the string is similar to the field name, then you can skip adding the string as it will automatically take the name from the field directly. You can apply it everywhere

Comment on lines +23 to +28
selection=[
('new', 'New'),
('offer_received', 'Offer Received'),
('offer_accepted', 'Offer Accepted'),
('sold', 'Sold'),
('cancelled', 'Cancelled'),

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=[
('new', 'New'),
('offer_received', 'Offer Received'),
('offer_accepted', 'Offer Accepted'),
('sold', 'Sold'),
('cancelled', 'Cancelled'),
selection=[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled"),

The value should be wrapped in double quotes as it will be viewed by the users

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--Property Types-->
<record id="property_type_house" model="estate.property.type">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can make different files for different models which will help you to track easily.
Also there is a room to improve the file name.

from dateutil.relativedelta import relativedelta


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.

Why have you used here models.Model?

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
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,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.

Please leave an extra line at the end of the file

Comment on lines +3 to +6
<menuitem
id="estate_menu_root" name="Real Estate"
web_icon="estate,static/description/icon.png">
</menuitem>

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
<menuitem
id="estate_menu_root" name="Real Estate"
web_icon="estate,static/description/icon.png">
</menuitem>
<menuitem
id="estate_menu_root"
name="Real Estate"
web_icon="estate,static/description/icon.png">
</menuitem>

<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?

<filter
name="groupby_postcode"
string="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.

What's the diff between domain and context?

Comment thread estate/__manifest__.py
@@ -0,0 +1,15 @@
{
'name': 'Real Estate',
'author': 'ritvik',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try keeping author name as Odoo S.A. as we are working as a whole or you can skip this as well, it's not a mandatory one

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

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