Skip to content

Conversation

hasaa-odoo
Copy link

Created the estate module and made it an app

@robodoo
Copy link

robodoo commented Sep 15, 2025

Pull request status dashboard

@hasaa-odoo hasaa-odoo changed the title Hasaa - Chapter 2 Onboarding Hasaa Onboarding Sep 15, 2025
@hasaa-odoo hasaa-odoo changed the base branch from 18.0 to 19.0 September 15, 2025 15:17
@@ -0,0 +1 @@
from . import models

Choose a reason for hiding this comment

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

End of file line missing

'depends' : [
'base'
]
}

Choose a reason for hiding this comment

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

End of file line missing

Comment on lines 24 to 27




Choose a reason for hiding this comment

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

Too many end of file lines haha

Comment on lines 5 to 6
'base'
]

Choose a reason for hiding this comment

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

Suggested change
'base'
]
'base',
],

@@ -0,0 +1,3 @@
"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,1,1,1

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,1,1,1
"access_estate_property","access.estate.property","model_estate_property","base.group_user",1,1,1,1

garden_area = fields.Integer()
garden_orientation = fields.Selection(
string = 'Orientation',
selection = [('north','North'),('south','South'),('east','East'),('west','West')]
Copy link

@alialfie alialfie Sep 16, 2025

Choose a reason for hiding this comment

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

Suggested change
selection = [('north','North'),('south','South'),('east','East'),('west','West')]
selection = [
('north','North'),
('south','South'),
('east','East'),
('west','West'),
],

@@ -0,0 +1,24 @@
from odoo import fields, models

class Property(models.Model):

Choose a reason for hiding this comment

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

Suggested change
class Property(models.Model):
class EstateProperty(models.Model):

('offer_accepted','Offer Accepted'),
('sold','Sold'),
('cancelled','Cancelled'),
]

Choose a reason for hiding this comment

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

comma

('south','South'),
('east','East'),
('west','West'),
]

Choose a reason for hiding this comment

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

comma

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="estate_property_menu_root" name="Real Estate">
<menuitem id="estate_property_first_level_menu" name="Advertisements">

Choose a reason for hiding this comment

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

estate_property_advertisements_menu looks more clear

<odoo>
<menuitem id="estate_property_menu_root" name="Real Estate">
<menuitem id="estate_property_first_level_menu" name="Advertisements">
<menuitem id="test_model_menu_action" action="estate_property_action"/>

Choose a reason for hiding this comment

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

check the menu id

_description = "Property annoucements"



Choose a reason for hiding this comment

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

Suggested change

Only two lines are expected

@@ -0,0 +1,87 @@
from odoo import api, fields, models, SUPERUSER_ID

Choose a reason for hiding this comment

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

Why are you importing SUPERUSER_ID? 🤔

<odoo>

<record id="estate_property_offer_view_form" model="ir.ui.view">
<field name="name">estate.property.offer.form</field>

Choose a reason for hiding this comment

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

Suggested change
<field name="name">estate.property.offer.form</field>
<field name="name">estate.property.offer.view.form</field>

The name and the id should match. Do this for the rest of the occurrences too please 🙏

<separator/>
<filter string="Available" name="state" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/>
<separator/>
<filter string="Postcode" name="postcode" context="{'group_by':'postcode'}"/>

Choose a reason for hiding this comment

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

group_by_postcode is better for the name and more clear

@@ -0,0 +1,44 @@
from odoo import api, fields, models, SUPERUSER_ID

Choose a reason for hiding this comment

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

Same question about the import


partner_id = fields.Many2one("res.partner", string="Partner", required=True)
property_id = fields.Many2one("estate.property", string="Property", required=True)
validity = fields.Integer(default=7, string="Validity(days)", )

Choose a reason for hiding this comment

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

Suggested change
validity = fields.Integer(default=7, string="Validity(days)", )
validity = fields.Integer(default=7, string="Validity(days)")

No need for the comma here since it's on the same line


@api.depends("validity")
def _compute_deadline(self):
for record in self:

Choose a reason for hiding this comment

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

Suggested change
for record in self:
for offer in self:

More clear


def _inverse_deadline(self):
for record in self:
default_creation_date = record.create_date if record.create_date else fields.Date.today()

Choose a reason for hiding this comment

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

Suggested change
default_creation_date = record.create_date if record.create_date else fields.Date.today()
default_creation_date = record.create_date or fields.Date.today()

Another way to do it

Comment on lines +11 to +12


Choose a reason for hiding this comment

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

Sync the spaces before the starting and closing odoo tag and the first menuitem

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