Skip to content

Conversation

@amahm-odoo
Copy link

No description provided.

@amahm-odoo amahm-odoo requested a review from artn-odoo January 19, 2026 15:18
@robodoo
Copy link

robodoo commented Jan 19, 2026

Pull request status dashboard

Copy link

@artn-odoo artn-odoo left a comment

Choose a reason for hiding this comment

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

Nice job so far !
Just some small styling nitpicks, otherwise it's all good.
We try to always put a new line at the end of a file, this can be done automatically when you save your file in vscode if the Insert Final Newline option is activated.

'name': 'Estate',
'version': '1.9',
'category': 'Real Estate',
'summary' : 'Manage your real estate properties',

Choose a reason for hiding this comment

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

Unwanted white space here

Suggested change
'summary' : 'Manage your real estate properties',
'summary': 'Manage your real estate properties',

Comment on lines 4 to 7
_name = 'estate.property'
_description = 'Estate Property'
name = fields.Char(string='Name', required=True)

Choose a reason for hiding this comment

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

Try to put the new line between the private attributes and the fields instead

Suggested change
_name = 'estate.property'
_description = 'Estate Property'
name = fields.Char(string='Name', required=True)
_name = 'estate.property'
_description = 'Estate Property'
name = fields.Char(string='Name', required=True)

@artn-odoo artn-odoo requested a review from csan-odoo January 21, 2026 08:57
Copy link

@csan-odoo csan-odoo left a comment

Choose a reason for hiding this comment

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

Great work! Just a few minor nitpicks

.gitignore Outdated

# Pyre type checker
.pyre/
ruff.toml

Choose a reason for hiding this comment

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

make sure to always leave an empty line at the end of every file

Comment on lines 1 to 6
from . import (
estate_property,
estate_property_offer,
estate_property_tag,
estate_property_type,
)

Choose a reason for hiding this comment

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

nitpick

Suggested change
from . import (
estate_property,
estate_property_offer,
estate_property_tag,
estate_property_type,
)
from . import estate_property
from . import estate_property_offer
from . import estate_property_tag
from . import estate_property_type

@api.depends("offer_ids.price")
def _compute_best_offer(self):
for record in self:
record.best_offer = max(record.offer_ids.mapped("price"), default=0)

Choose a reason for hiding this comment

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

Here, if there are no offers, it will break. It’s safer to handle that case explicitly. For example:

Suggested change
record.best_offer = max(record.offer_ids.mapped("price"), default=0)
record.best_offer = max(record.offer_ids.mapped("price")) if record.offer_ids else 0.0

def _onchange_garden(self):
if not self.garden:
self.garden_area = 0
self.garden_orientation = ""

Choose a reason for hiding this comment

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

Selection fields usually expects either one of the predefined selection keys or False. Assigning an empty string could lead to inconsistent behaviours or validation errors.

Suggested change
self.garden_orientation = ""
self.garden_orientation = False

copy=False,
)

@api.depends("validity")

Choose a reason for hiding this comment

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

Suggested change
@api.depends("validity")
@api.depends("create_date", "validity")

<field name="res_model">estate.property.tag</field>
<field name="view_mode">list,form</field>
</record>
</odoo> No newline at end of file

Choose a reason for hiding this comment

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

same as above

<field name="res_model">estate.property.type</field>
<field name="view_mode">list,form</field>
</record>
</odoo> No newline at end of file

Choose a reason for hiding this comment

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

same as above

Add SQL constraints to ensure prices are positive and names are unique. Implement a Python constraint to prevent selling prices below 90% of the expected price.
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.

4 participants