Skip to content

ollet - Technical Training - #1414

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

ollet-odoo wants to merge 31 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
Comment thread estate/data/estate_menus.xml Outdated
Comment thread estate/data/estate_property_views.xml Outdated
Comment thread estate/models/__init__.py Outdated
Comment thread estate/models/property.py Outdated
Comment thread estate/models/property.py Outdated
Comment thread estate/models/property.py Outdated
Comment thread estate/models/property.py Outdated
Comment thread estate/security/ir.model.access.csv Outdated
Comment thread estate/__manifest__.py Outdated
@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 🔥

Comment thread estate/data/estate_menus.xml Outdated
Comment thread estate/data/estate_property_views.xml Outdated
Comment thread estate/models/property.py Outdated
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")
]
)

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_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 :)

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_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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I was using the line suggested in the log as a base.
Is it a consistency rule to note have it in it's own module or just a hint you are giving me?

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 am just giving you the reasoning why you don't need the <module_name>. before the id in this case but it's not a big thing

Comment thread estate/__manifest__.py Outdated
'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

@ollet-odoo

Copy link
Copy Markdown
Author

robodoo rebase-merge

@robodoo

robodoo commented Sep 16, 2026

Copy link
Copy Markdown

Merge method set to rebase and merge, using the PR as merge commit message.

@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch 2 times, most recently from 8de9400 to c0879b8 Compare September 16, 2026 09:02
@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch from 5d2b876 to cf79289 Compare September 16, 2026 19:36

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

Thank you for the good work 🔥

Left you a couple of comments (some of them are nitpicks so, you can attend to the important one first :))

Also please ping me when you finish a chapter for a review so that changes are not too much to review and I know whether you missed something in the code or you didn't get to that chapter yet:)
but thanks, keep it up 👍

Comment thread estate/models/property.py Outdated
Comment thread estate/models/property.py
Comment thread estate/models/property.py Outdated
Comment thread estate/models/property.py Outdated
Comment thread estate/models/property.py Outdated
Comment thread estate/views/estate_property_offer_views.xml Outdated
Comment thread estate/views/estate_property_offer_views.xml Outdated
Comment thread estate/views/estate_property_tag_views.xml Outdated
Comment thread estate/views/estate_property_views.xml Outdated
Comment thread estate/models/__init__.py Outdated
@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch from e5e4802 to a4907f5 Compare September 17, 2026 11:13
@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch 3 times, most recently from 1d537d9 to f7be358 Compare September 17, 2026 11:47
@ollet-odoo

Copy link
Copy Markdown
Author

I have finished chapter 11 and the tests are passing if you could please review again.

@ollet-odoo
ollet-odoo force-pushed the 19.0-server-tuto-ollet branch from f7be358 to 9f5e770 Compare September 17, 2026 13:44

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

Thank you, Good work!
Left you small suggestions and nitpicks for chapter 11, no big thing

Comment on lines +54 to +56
for record in property_id.offer_ids:
if record.price > vals['price']:
raise UserError("Cannot create an offer with a lower value than an existing one")

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 correct of course, you can also use max() and mapped(), you will do the same thing in one line and without for loops, if you like

class PropertyType(models.Model):
_name = "estate.property.type"
_description = "Property Type"
_order = "sequence asc"

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 type also wants order by name

Comment on lines +7 to +10
<list editable="bottom"
decoration-success="status == 'accepted'"
decoration-danger="status == 'refused'"
>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We don't like a very long line but this one is fine, it makes it easier to read the file :)

Suggested change
<list editable="bottom"
decoration-success="status == 'accepted'"
decoration-danger="status == 'refused'"
>
<list editable="bottom" decoration-success="status == 'accepted'" decoration-danger="status == 'refused'">

<field name="validity"/>
<field name="date_deadline"/>
<button name="action_accept" title="Accept" type="object" icon="fa-check"
invisible="property_id_state in ('offer_accepted', 'sold', '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.

surely it's correct, but usually teams avoid adding new fields to the database unless absolutely necessary. It's no big issue here, it's a related field already but thought to mention it
For example here, if you already don't show an offer for cancelled or sold properties, you can just make the invisible condition here be something like state != False

<button name="action_do_sold" type="object" class="oe_highlight" string="Sold"
invisible="state in ('sold', 'cancelled', 'new')"/>
<button name="action_do_cancel" type="object" string="Cancel"
invisible="state in ('sold', '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.

nitpick

Suggested change
invisible="state in ('sold', 'cancelled',)"/>
invisible="state in ('sold', 'cancelled')"/>

Comment on lines +55 to +57
<field name="property_type_id" widget="many2one" can_create="false"
can_write="false"
options="{'no_create': 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.

I believe yours is correct, here is also a more used way if you like

Suggested change
<field name="property_type_id" widget="many2one" can_create="false"
can_write="false"
options="{'no_create': true}"
<field name="property_type_id" widget="many2one" options="{'no_create': True, 'no_edit': True}"/>

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