Skip to content

Conversation

jedel-odoo
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Oct 20, 2025

Pull request status dashboard

@Mathilde411 Mathilde411 changed the title [ADD] Estate:createthe app JEDEL Onboarding Oct 20, 2025
@Mathilde411 Mathilde411 self-requested a review October 20, 2025 11:55
@Mathilde411 Mathilde411 self-assigned this Oct 20, 2025
Copy link

@Mathilde411 Mathilde411 left a comment

Choose a reason for hiding this comment

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

Small comments :)

@@ -0,0 +1 @@
from . import estate_property 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.

End of file line is missing here

@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,0,0,0 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.

End of file line is missing here

@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,0,0,0 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.

Suggested change
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,0,0,0
estate.access_estate_property,access_estate_property,model_estate_property,base.group_user,1,0,0,0

It's an xmlid from your own module so you can remove the module part :)

@@ -0,0 +1 @@
from . import models 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.

End of file line is missing here

'data' : [
'security/ir.model.access.csv'
],
} 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.

End of file line is missing here

@Mathilde411 Mathilde411 self-requested a review October 21, 2025 11:18
@Mathilde411 Mathilde411 removed their assignment Oct 21, 2025
Copy link

@Mathilde411 Mathilde411 left a comment

Choose a reason for hiding this comment

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

Good work here !
I see that your runbot is red because of style, so you may fix that.
Also be mindful about the naming of files/xmlids: https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#xml-ids-and-naming

description = fields.Text()
postcode = fields.Char()
notes = fields.Html()
date_availability = fields.Date(copy=False, default=datetime.date.today() + relativedelta(months=+3))

Choose a reason for hiding this comment

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

Suggested change
date_availability = fields.Date(copy=False, default=datetime.date.today() + relativedelta(months=+3))
date_availability = fields.Date(copy=False, default=lambda self: datetime.date.today() + relativedelta(months=+3))

Use a lambda here, or the version that has been evaluated the first time will always be used.

Choose a reason for hiding this comment

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

And why months=+3 ?

garden_area = fields.Integer()
garden_orientation = fields.Selection(selection=[("north", "North"), ("south", "South"), ("east", "East"), ("west", "West")])
active = fields.Boolean(default=True)
state = fields.Selection(selection=[("new", "New"), ("offer_received", "Offer Received"), ("offer_accepted", "Offer Accepted"), ("sold", "Sold"), ("cancelled", "Cancelled")], copy=False, required=True, default="new")

Choose a reason for hiding this comment

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

Suggested change
state = fields.Selection(selection=[("new", "New"), ("offer_received", "Offer Received"), ("offer_accepted", "Offer Accepted"), ("sold", "Sold"), ("cancelled", "Cancelled")], copy=False, required=True, default="new")
state = fields.Selection(selection=[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
], copy=False, required=True, default="new")

Line is way too long

Comment on lines 82 to 87
@api.constrains('expected_price', 'selling_price')
def _check_selling_price(self):
for record in self:
if not float_is_zero(record.selling_price, precision_digits=3):
if float_compare(record.selling_price, record.expected_price*0.9, precision_digits=3) < 0:
raise UserError(r"The selling price must be at least 90% of the expected price !")

Choose a reason for hiding this comment

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

Comment on lines 23 to 31
@api.depends("create_date", "validity")
def _compute_deadline(self):
for offer in self:
offer.date_deadline = fields.Date.add(offer.create_date, days=offer.validity)

def _inverse_deadline(self):
for offer in self:
delta = offer.date_deadline - offer.create_date
offer.validity = delta.days

Choose a reason for hiding this comment

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

create_date is not required here, what happens if you remove it ?

estate.access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1
estate.access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1
estate.access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1
estate.access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1 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.

Missing newline

<field name="bedrooms"/>
<field name="living_area" string="Living Area (sqm)"/>
<field name="facades"/>
<filter string="Available" name="available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/>

Choose a reason for hiding this comment

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

Suggested change
<filter string="Available" name="available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/>
<filter string="Available" name="available" domain="[('state', 'in', ('new', 'offer_received'))]"/>

Simpler way when comparing the same variable :)

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