Skip to content

[WIP] Implementation of estate module - #1372

Draft
amgom-odoo wants to merge 9 commits into
odoo:19.0from
odoo-dev:19.0-real-estate-amgom
Draft

[WIP] Implementation of estate module#1372
amgom-odoo wants to merge 9 commits into
odoo:19.0from
odoo-dev:19.0-real-estate-amgom

Conversation

@amgom-odoo

@amgom-odoo amgom-odoo commented Jul 22, 2026

Copy link
Copy Markdown

To be filled when finishing...

Tasks

  • Chapter 1
  • Chapter 2
  • Chapter 3
  • Chapter 4
  • Chapter 5
  • Chapter 6
  • Chapter 7
  • Chapter 8
  • Chapter 9
  • Chapter 10
  • Chapter 11
  • Chapter 12
  • Chapter 13
  • Chapter 14
  • Chapter 15

@robodoo

robodoo commented Jul 22, 2026

Copy link
Copy Markdown

Pull request status dashboard

@YassinWalid YassinWalid 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.

Thanks for the incredible work. I have added an initial review, with some comments on the PR, and other general comments below.

For the naming convention of models, the record id in xml, or the id & name of records in the security access csv file, you can have a look at the coding guidelines.

Don't forget the empty line at the end of each file, to have better code traceability.

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.

you should put each file on its own line, since this is better for the history (git blame) of the 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.

check the coding guidelines for the name here

Comment thread estate/models/estate.py


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

check the coding guidelines for the names of models (as well as the name of classes, and the naming of files).
(this also applies for other models)

Comment thread estate/models/estate.py
raise UserError("Cancelled properties cannot be sold")
property.state = "sold"

return 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
return True

You don't need to explicitly return True in actions

Comment thread estate/models/estate.py
def action_sell_property(self):
for property in self:
if property.state == "cancelled":
raise UserError("Cancelled properties cannot be sold")

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
raise UserError("Cancelled properties cannot be sold")
raise UserError(self.env._("Cancelled properties cannot be sold"))

Don't forget to translate your errors

Comment thread estate/models/offer.py
Comment on lines +62 to +63
self.property_id.selling_price = 0
self.property_id.buyer_id = None

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

but what if another offer was already accepted? wouldn't this cause wrong data?

<odoo>
<menuitem id="menu_estate_root" name="Real Estate">
<menuitem id="menu_estate_property" name="Advertisements" action="estate_property_action"/>
<menuitem id="menu_estate_property_types" name="Settings">

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 think the id of this menuitem might not be as representative of what it holds? (also, check the guidelines for the ids of the records)

Comment on lines +109 to +112
<filter name="New/Offer Received" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"></filter>
<separator/>
<filter name="New/Offer Received2" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"></filter>
<filter name="New/Offer Received3" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"></filter>

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 three identical filters here?

Comment thread estate/__manifest__.py
"name": "Real Estate",
"version": "1.0.0",
"depends": ["base"],
"author": "Amr (amgom)",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this is ok since this is only training, but normally it should be Odoo S.A.

Comment thread ruff.toml

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This should not be included here, maybe make git ignore it?

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