Skip to content

19.0 technical training demat - #1425

Open
DenisMth wants to merge 3 commits into
odoo:19.0from
odoo-dev:19.0-Technical-Training-demat
Open

DenisMth wants to merge 3 commits into
odoo:19.0from
odoo-dev:19.0-Technical-Training-demat

Conversation

@DenisMth

Copy link
Copy Markdown

No description provided.

@robodoo

robodoo commented Sep 16, 2026

Copy link
Copy Markdown

Pull request status dashboard

@leclerc-leo leclerc-leo 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

Comment thread estate/models/__init__.py Outdated
@@ -0,0 +1 @@
from . import estate_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.

We try to always have an empty line at the end of every file.
You can use the Ruff extension with the config from https://runbot326.odoo.com/runbot/static/build/125365592-19-0/logs/ruff_config.txt to have warning about style inside your editor.
Disable auto formatting on save as we try to reduce the quantity of diff when editing file made by someone else
You can also check the ci/style from the runbot (https://runbot.odoo.com/runbot/bundle/190-technical-training-demat-512697) to check what it says.

Comment thread estate/models/estate_property.py Outdated
Comment on lines +3 to +4

class TestModel(models.Model):

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 (check ci/ctyle) but before classes, 2 empty lines are asked

Suggested change
class TestModel(models.Model):
class TestModel(models.Model):

Comment thread estate/models/estate_property.py Outdated
import datetime

class TestModel(models.Model):
_name = "estate_property_model"

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 name models name.of.module.name.of.model.

Suggested change
_name = "estate_property_model"
_name = "estate.property"

Comment thread estate/models/estate_property.py Outdated
garden_area = fields.Integer()
garden_orientation = fields.Selection([("north", "North"), ("south", "South"), ("west", "West"), ("east", "East")])
active = fields.Boolean(default=True)
state = fields.Selection([("new", "New"), ("offer_received", "Offer Received"), ("offer_accepted", "Offer Accepted"), ("sold", "Sold"), ("cancelled", "Cancelled")], default="new") 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.

We try to keep line bellow ~120 characters. If you have using vs code you can add a rulers in the setting to have a line and visualize it.

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

Comment thread estate/models/estate_property.py Outdated
name = fields.Char(default="Unknown", required=True)
description = fields.Text("Description of the Estate Propert Model")
postcode = fields.Char("Post code")
date_availability = fields.Date("Availability date", default=datetime.date.today() + datetime.timedelta(days=90), copy=False)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If not using lambda, datetime.date.today() will resolve when the server start, so if your server keept running for a few days, the date would be wrong.
Also for adding date it's best to use fields.Date.add instead of +

Suggested change
date_availability = fields.Date("Availability date", default=datetime.date.today() + datetime.timedelta(days=90), copy=False)
date_availability = fields.Date("Availability date", default=lambda self: datetime.date.today() + datetime.timedelta(days=90), copy=False)

Comment thread estate/views/menu_estate_property.xml Outdated
@@ -0,0 +1,30 @@
<odoo>
<menuitem id="test_menu_root" name="Real Estate">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To prevent any issue it's best to prefix any view id with the name of the module

Suggested change
<menuitem id="test_menu_root" name="Real Estate">
<menuitem id="estate_test_menu_root" name="Real Estate">

@DenisMth
DenisMth force-pushed the 19.0-Technical-Training-demat branch from 1345fd6 to a2b4948 Compare September 17, 2026 12:39
@aboo-odoo
aboo-odoo self-requested a review September 17, 2026 12:49
@aboo-odoo

Copy link
Copy Markdown

Hey 👋 I'll be managing your review now to spread the load among the 4 of us 😄

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.

4 participants