Skip to content

Conversation

@OmarKhalil2001
Copy link

@OmarKhalil2001 OmarKhalil2001 commented Dec 15, 2025

[ADD] Implementation for Estate Module of Python Framework

Description:

This Pull Request introduces the Estate Module, which houses the new Estate FelBeit application. This application is designed to provide real estate agents with a centralized system for managing property listings, tracking the sales lifecycle, and handling the relationship between sellers and buyers.

Key Features:

  1. Seller Tracking: Associates each property with a seller for streamlined management.
  2. Buyer Tracking: Records potential buyers and formally links the successful buyer to the property upon closing.
  3. Property Lifecycle Tracking: Provides a state-management system to monitor property stages from initial listing through offer negotiations to the final sale.
  4. Offer Management: Enables agents to record offers, track their status, and perform actions to either accept or refuse them.
  5. Spatial Calculations: Includes a precision tool to calculate indoor and outdoor areas separately, ensuring accurate property data.

@robodoo
Copy link

robodoo commented Dec 15, 2025

Pull request status dashboard

@barracudapps barracudapps self-requested a review December 15, 2025 16:23
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Some comments here and there. Can you also please review your PR title and description following our guidelines (https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html)?
A clear commit message is really important to describe what you did and why you did it.

@OmarKhalil2001 OmarKhalil2001 changed the title [ADD] adding real state module [ADD] Estate Module (Python Framework Training) Dec 16, 2025
@OmarKhalil2001 OmarKhalil2001 force-pushed the omkha/first_pr_tutorial branch 2 times, most recently from 1911748 to 162d90a Compare December 16, 2025 21:13
@OmarKhalil2001 OmarKhalil2001 force-pushed the omkha/first_pr_tutorial branch from 162d90a to bf9de48 Compare December 16, 2025 21:16
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Thanks for the feature. Here are some comments.

Avoid as much redundancy as possible, ease the searching and respect our naming conventions.
Let's take buildings_model.py as an example. The file is in the models folder of the estate module a better naming would have been building.py (or maybe estate_building.py as it allow a quick search on the module name and building.py might exist in many modules with different meanings).
Moreover, as it is a model the name should not be plural. Indeed, this is the template to create one building (multiple times but it's still 1 item).
Last thing here: please follow the instructions as if the task (tutorial) was written by a PO). You can of course challenge everything but I would've gone with a property instead of a building.

Also, can you please change the PR message and tell a bit more about what the added code is doing and why you added these lines?

…model. improved UX with compute and inverse methods
…l buttons to Buildings Model in Estate Module.
@OmarKhalil2001 OmarKhalil2001 force-pushed the omkha/first_pr_tutorial branch from 30aa8f1 to 2c0b30a Compare December 19, 2025 09:24
…s to the end of files. Improved the readability of manifest. renamed model classes to follow the pascal casing.
@OmarKhalil2001 OmarKhalil2001 force-pushed the omkha/first_pr_tutorial branch from 2c0b30a to 17ffc1d Compare December 19, 2025 09:39
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Very good for the PR message! 👍
Small comments and nits for the code but you're on tracks!



class Building(models.Model):
_name = "estate.buildings"

Choose a reason for hiding this comment

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

Good job on your refactoring but still some small consistency issues like here (and the file names)

Suggested change
_name = "estate.buildings"
_name = 'estate.building'

…ces must be positive. names, tags, and building types must be unique. Offer must be at least 90% of buildings value.
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Still some nits

Comment on lines +1 to +4
from odoo import models, fields, api
from odoo.exceptions import UserError
from datetime import timedelta
from odoo.tools.float_utils import float_compare

Choose a reason for hiding this comment

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

Nit here

Suggested change
from odoo import models, fields, api
from odoo.exceptions import UserError
from datetime import timedelta
from odoo.tools.float_utils import float_compare
from datetime import timedelta
from odoo import models, fields, api
from odoo.exceptions import UserError
from odoo.tools.float_utils import float_compare



class Offer(models.Model):
_name = "estate.offers"

Choose a reason for hiding this comment

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

Same as for buildings, make it consistent

Suggested change
_name = "estate.offers"
_name = "estate.offer"

Comment on lines +41 to +44
if record.status != "accepted" and record.building_id.state not in [
"sold",
"canceled",
]:

Choose a reason for hiding this comment

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

IMHO this is more readable

Suggested change
if record.status != "accepted" and record.building_id.state not in [
"sold",
"canceled",
]:
if record.status != 'accepted' and record.building_id.state not in ['sold', 'canceled']:

Comment on lines +57 to +59
raise UserError(
self.env._("Cannot accept offers for sold or canceled buildings.")
)

Choose a reason for hiding this comment

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

Suggested change
raise UserError(
self.env._("Cannot accept offers for sold or canceled buildings.")
)
raise UserError(self.env._("Cannot accept offers for sold or canceled buildings."))

Comment on lines +75 to +80
if (
float_compare(
0.9 * record.building_id.value, record.price, precision_digits=2
)
== 1
):

Choose a reason for hiding this comment

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

As we know float_compare returns either 1, 0 or -1 you can save some characters to keep the condition on a single line

Suggested change
if (
float_compare(
0.9 * record.building_id.value, record.price, precision_digits=2
)
== 1
):
if float_compare(0.9 * record.building_id.value, record.price, precision_digits=2) > 0:

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