Skip to content

[LOSBO] Real Estate Property Management - Tutorials - #1407

Draft
losbo-odoo wants to merge 9 commits into
odoo:19.0from
odoo-dev:19.0-tutorial-losbo
Draft

losbo-odoo wants to merge 9 commits into
odoo:19.0from
odoo-dev:19.0-tutorial-losbo

Conversation

@losbo-odoo

Copy link
Copy Markdown

Implementation of the estate tutorial module covering initial module setup, security access, and property models:

  • Initialized estate module along with manifest metadata (author and license).
  • Configured security access rights for the estate.property model.
  • Added initial views and menu structures to create property records.
  • Added custom list views and application icons.
  • Created the estate.property.type model along with initial view configurations.

@robodoo

robodoo commented Sep 9, 2026

Copy link
Copy Markdown

Pull request status dashboard

@losbo-odoo
losbo-odoo requested a review from bit-odoo September 9, 2026 07:18

@bit-odoo bit-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 @losbo-odoo
Good Start

can you please improve your commit message? fcf8c80, e638942,
e640341,
8070edb

Thanks

Comment thread awesome_dashboard/__manifest__.py Outdated
# -*- coding: utf-8 -*-
{
'name': "Awesome Dashboard",
'name': "Awesome Dashboard1",

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 changes.

Comment thread estate/models/__init__.py

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 please import it as per Odoo standard?

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 imported as per odoo standard

Comment thread estate/models/estate_property.py Outdated
"res.users", string="salesperson", default=lambda self: self.env.user
)
offer_ids = fields.One2many("estate.property.offers", "property_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.

unneccary space.

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 removed the unnecessary space

Comment thread estate/models/estate_property.py Outdated
offer_ids = fields.One2many("estate.property.offers", "property_id")

total_offers = fields.Integer(compute="_compute_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.

unneccary space.

Comment thread estate/models/estate_property.py Outdated
from odoo.exceptions import ValidationError


class TestModel(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.

Can you improve the class name?

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 changed the name to EstateProperty

Comment thread estate/models/estate_property.py Outdated
Comment on lines +8 to +18
today = datetime.now()

month = today.month + 3
year = today.year
day = today.day

if month > 12:
year = year + 1
month = month % 12

three_month_date = today.replace(year=year, month=month, day=day)

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 explain me the purpose of this?

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 was calculating the next 3 month date but I have changed the logic to optimize the code

Comment thread estate/models/estate_property.py Outdated
count = 0
if record.offer_ids:
for offers in record.offer_ids:
if offers.status == "accepted":

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 you need this check?

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 wanted to show only the accepted offers through the computed field, but this can be achieved using the filter attribute in the view XML. So, I have removed it in the new commit.

Comment thread estate/views/estate_property_views.xml Outdated
<field name="property_tag_ids" widget="many2many_tags"/>
</div>
<group>
<group string="Pricing &amp; Availability">

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 doesn't look good on the UI.

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 improved the UI by replacing '&' with 'and'

Comment thread estate/views/estate_property_views.xml Outdated
<field name="total_offers"/>
<field name="state"/>
</group>
<group string="Property Specs">

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 here.

Comment thread estate/models/estate_property.py Outdated
]
)
active = fields.Boolean("Active", default=True)
property_type_id = fields.Many2one("estate.property.type", string="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.

Suggested change
property_type_id = fields.Many2one("estate.property.type", string="Property_type")
property_type_id = fields.Many2one("estate.property.type", string="Property type")

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 updated the string name.

- Added estate property model
- Defined basic property fields
- Added security file to grant permission for group user
- Added estate property view file and rendered the model fields
- Added 'estate_property_menu.xml' to render the menu items
- Update the 'estate_property_views.xml' to render more fields
- Update the manifest file to add 'estate_property_menu.xml'
…table (estate_property and estate_property_type) using Many2one

- Added different relation fields like Many2One, Many2Many and One2Many to connect two tables
- Removed unnecessary lines of code
- Update the 'estate_property_views.xml' to improve the UI
- Added the 'estate_property_type.py' model and used this in the 'estate_property_views.xml'
Differentiating the properties using tags, types along with tracking the offers
received for each property, will streamline property manangement

- introduced new models
  - 'estate.property.tags' : Labeling the properties
  - 'estate.proerty.types' : Categorizes properties
  - 'estate.property.offers' : track the buyer offers, prices and offer statuses

- linked new models to 'estate.proerty.py'
  - Many2many relation to 'estate.property.tags'
  - Many2one relation to 'estate.property.types'
  - One2many realtion to 'estate.property.offers'

- Updated UI views
  - Added estate_property_type_view.xml to manage property types.
  - Updated estate_property.xml to render type, tags and inline offer list tab
… and functions

I have added the available filter to allow users to isolate open properties, and i have added computed fields to dynamically calculate the fields
as i have added the relation between models it is necessary to add the ondelete attribute to handle the removed or unnecessary properties

1. Property Availabilty & filtering:
   - Added 'state' field to 'estate.property' to track the lifecycle of a listing
   - updated 'estate_property_views' to include the available filter, allowing users to isolate properties open for offer

2. Computed fields:
   - Implemented computed fields ('total_offers', 'total_area', 'best_price') along with their respective computed functions

3. Database Integrity:
   - Added `ondelete='cascade'` to the 'property_tag_ids' (Many2many relation)  in 'estate_property.py' model and to the 'property_id' (Many2many relation) in 'estate_property_offers'
1> awesome_dashboard/__manifest__.py
    - fixed the 'name' in the __manifest__.py file of awesome_dashboard

2> estate/models/__init__.py
    - imported as per the odoo standard

3> estate/models/estate_property.py
    - changed the model name
    - implement better logic to calculate next 3 months date
    - fixed the name of property type in model
    - removed extra spaces
    - removed the accpeted check in the _compute_offers function

4> estate/views/estate_property_views.xml
    - fixed the string name to improve the UI
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