Skip to content

sever - Technical Training#1235

Open
SebVrc wants to merge 2 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-sever
Open

sever - Technical Training#1235
SebVrc wants to merge 2 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-sever

Conversation

@SebVrc
Copy link
Copy Markdown

@SebVrc SebVrc commented Apr 21, 2026

Pull request for the tutorials

@robodoo
Copy link
Copy Markdown

robodoo commented Apr 21, 2026

Pull request status dashboard

@SebVrc SebVrc changed the title Init PR sever - Technical Training Apr 21, 2026
@Mathilde411 Mathilde411 requested a review from delcourtfl April 21, 2026 13:31
Copy link
Copy Markdown

@delcourtfl delcourtfl left a comment

Choose a reason for hiding this comment

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

Hello there ! Just added a few general comments.

Comment thread estate/__manifest__.py Outdated
Comment thread estate/__manifest__.py Outdated
@SebVrc SebVrc force-pushed the 19.0-tutorials-sever branch from abe8e35 to 94bb329 Compare April 22, 2026 09:46
@SebVrc SebVrc self-assigned this Apr 23, 2026
@SebVrc SebVrc requested a review from delcourtfl April 23, 2026 14:49
Copy link
Copy Markdown

@delcourtfl delcourtfl left a comment

Choose a reason for hiding this comment

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

Hello ! Everything is quite good already, just added a few minor remarks.

Comment thread estate/models/estate_property.py Outdated
Comment thread estate/views/estate_menus.xml Outdated
Comment thread .gitignore
Comment thread README.md Outdated
@SebVrc SebVrc force-pushed the 19.0-tutorials-sever branch 2 times, most recently from 2ddcfb0 to b250530 Compare April 27, 2026 07:52
Copy link
Copy Markdown

@delcourtfl delcourtfl left a comment

Choose a reason for hiding this comment

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

Hello there ! Good work already, just one nitpick.

Comment thread estate/models/estate_property.py Outdated
@SebVrc SebVrc force-pushed the 19.0-tutorials-sever branch from 34211d5 to d1a42b4 Compare April 29, 2026 13:27
@SebVrc SebVrc force-pushed the 19.0-tutorials-sever branch from d1a42b4 to 08a9021 Compare April 29, 2026 13:33
@SebVrc SebVrc force-pushed the 19.0-tutorials-sever branch from 08a9021 to debdef0 Compare April 29, 2026 13:51
Copy link
Copy Markdown

@delcourtfl delcourtfl left a comment

Choose a reason for hiding this comment

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

Hello there ! Good work, not much to say except a few nitpicks.

@api.model_create_multi
def create(self, vals):
for offer in vals:
linked_property = self.env["estate.property"].browse(offer["property_id"])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Avoid making search and browse calls on each iteration of the loop (this is quite important as it could cause performance issues). Batching the search and filtering inside the loop for the relevant results could be a better approach for that.

</xpath>
</field>
</record>
</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.

😢

invoice_vals_list.append(invoice_vals)

# Creating invoice
self.env["account.move"].sudo().with_context(default_move_type="out_invoice").create(invoice_vals_list)
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 on batching the values in a single create call ! (better for the performances)
But always try to avoid sudo if possible, it bypasses the user rights and I don't think it's needed in this case.

if property.state != "new" and property.state != "cancelled":
msg = "Only new or cancelled properties can be deleted"
raise UserError(msg)
return super().unlink()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You don't need the super().unlink() with the ondelete decorator

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