Skip to content

ollet - Technical Training - #1414

Open
ollet-odoo wants to merge 13 commits into
odoo:19.0from
odoo-dev:19.0-server-tuto-ollet
Open

ollet-odoo wants to merge 13 commits into
odoo:19.0from
odoo-dev:19.0-server-tuto-ollet

Conversation

@ollet-odoo

Copy link
Copy Markdown

task-6573598

@robodoo

robodoo commented Sep 15, 2026

Copy link
Copy Markdown

Pull request status dashboard

@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch from 189c49d to b592011 Compare September 15, 2026 11:32
@ollet-odoo ollet-odoo changed the title [add] estate: Add real estate module scafolding ollet - Technical Training Sep 15, 2026
@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch from 072738c to acc1335 Compare September 15, 2026 13:26

@msho-odoo msho-odoo 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.

Good job 🔥

Just for some commit messages, we write it in a way that aligns with when this commit is merged it will ..... so for example estate: Basic security can be add access rules to estate_property or however you would like to describe your change :)
refer to Git Guidlines

I also left you some comments :)
feel free to ping me when you need another review, also always make sure your runbot is green ahead please :)

Comment thread estate/data/estate_menus.xml Outdated
<menuitem id="estate_property_menu_action" action="estate_property_action"/>
</menuitem>
</menuitem>
</odoo> No newline at end of 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.

Always add a new line at end of files :)

Comment thread estate/data/estate_menus.xml Outdated
<?xml version="1.0"?>
<odoo>
<menuitem id="estate_menu_root" name="Real Estate">
<menuitem id="estate_first_level_menu" name="Advertisements">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it's better to give ids a descriptive name rather than first_level_menu :)

Comment thread estate/data/estate_property_views.xml Outdated
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
</record>
<record id="estate_property_view_tree" model="ir.ui.view">

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
<record id="estate_property_view_tree" model="ir.ui.view">
<record id="estate_property_view_tree" model="ir.ui.view">

it's not gonna break the xml but it's better aligned to be debugged easier in the future

Comment thread estate/models/__init__.py Outdated
@@ -0,0 +1 @@
from .property import Property No newline at end of 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.

EOF new line in all files :)

Comment thread estate/models/property.py Outdated
_name = "estate.property"
_description = "Real estate property"

name = fields.Char(required=True, string='Title')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it's just a convention to have the string as the first attribute

Comment thread estate/models/property.py Outdated
living_area = fields.Integer(string="Living Area (sqm)")
faces = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good practice to have boolean fields on the form is_something or has_something so you might change this to has_garden and has_garage

Comment thread estate/models/property.py Outdated
Comment on lines +21 to +22
garden_orientation = fields.Selection(
selection=(('north', 'North'), ('east', 'East'), ('south', 'South'), ('west', 'West')))

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
garden_orientation = fields.Selection(
selection=(('north', 'North'), ('east', 'East'), ('south', 'South'), ('west', 'West')))
garden_orientation = fields.Selection(
selection=[
('north', 'North'),
('east', 'East'),
('south', 'South'),
('west', 'West'),
]
)

We usually use the [] for the selection attribute and style it like this with multiple values.

if you want to apply the nitpick mentioned in the previous commit which is used by some teams, you will have ('north', "North") instead of ('north', 'North')

Comment thread estate/models/property.py Outdated
Comment on lines +24 to +27
state = fields.Selection(default='new', required=True, copy=False,
selection=(('new', 'New'), ('offer_received', 'Offer Received'),
('offer_accepted', 'Offer Accepted'), ('sold', 'Sold'),
('cancelled', 'Cancelled')))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apply same styling here :)

Comment thread estate/security/ir.model.access.csv Outdated
@@ -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,1,1,0 No newline at end of 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.

no need to add estate. here in the id, the file is already defined in that module, but you may want to add _user at the end of the id so that it's access_estate_property_user, it's just gives you the chance to make other rules for the same module with different users like _manager for example

Comment thread estate/__manifest__.py Outdated
'data/estate_property_views.xml',
'data/estate_menus.xml'
],
'author': "Olivier Le Thanh Duong",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

author is usually Odoo S.A.

@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch from 37f6405 to 18d1370 Compare September 15, 2026 14:53
@ollet-odoo

Copy link
Copy Markdown
Author

@msho-odoo Thanks for the review, i have corrected according to your remarks. I don't know if I should mark the conversation as resolved when I fix them or if you will do it when you do the review again

@msho-odoo

Copy link
Copy Markdown

@msho-odoo Thanks for the review, i have corrected according to your remarks. I don't know if I should mark the conversation as resolved when I fix them or if you will do it when you do the review again

Usually resolving the comment would depend on the team or the reviewer and what they prefer :)
but here if you're sure you've done the change, feel free to resolve it 👍

@msho-odoo msho-odoo 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.

Good work 👍
Just try to use git commit --amend instead of just git commit when fixing few stuff like spaces, names, quotes, etc. because the same commit still applies, no need to add the fixes to a new commit.
Also, left you a few changes.
Keep it up 🔥

<?xml version="1.0"?>
<odoo>
<menuitem id="estate_menu_root" name="Real Estate">
<menuitem id="estate_Advertisements_menu" name="Advertisements">

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
<menuitem id="estate_Advertisements_menu" name="Advertisements">
<menuitem id="estate_advertisements_menu" name="Advertisements">

I would stick to the snake case here :), let's make it all small letters

</h1>
</div>
<group>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nitpick: when xml becomes bigger, it makes it easier to read if we get rid of these inside empty lines 😅
You can leave an empty line between records maybe but not preferably here :)

Comment thread estate/models/property.py
Comment on lines +30 to +38
state = fields.Selection(default='new', required=True, copy=False,
selection=[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled")
]
)

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
state = fields.Selection(default='new', required=True, copy=False,
selection=[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled")
]
)
state = fields.Selection(
default='new',
required=True,
copy=False,
selection=[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled")
]
)

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

EOF line :)

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

No need to add the estate. before the id, it's implicit since it's in the same module.
I believe you should give unlink access to the user, here you're setting the perm_unlink to 0

Comment thread estate/__manifest__.py
'depends': ['base'],
'data': [
'security/ir.model.access.csv',
'data/estate_property_views.xml',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The views file and the menus file should be in views folder not data folder

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