Skip to content

chean - Technical Onboarding#1341

Open
anchevalier wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-onboarding-chean
Open

chean - Technical Onboarding#1341
anchevalier wants to merge 1 commit into
odoo:19.0from
odoo-dev:19.0-onboarding-chean

Conversation

@anchevalier

Copy link
Copy Markdown

No description provided.

@anchevalier anchevalier requested a review from ziriraha June 16, 2026 08:59
@anchevalier anchevalier self-assigned this Jun 16, 2026
@robodoo

robodoo commented Jun 16, 2026

Copy link
Copy Markdown

Pull request status dashboard

@anchevalier anchevalier force-pushed the 19.0-onboarding-chean branch from 924da73 to fcca45b Compare June 16, 2026 11:26
Comment thread estate/models/estate_property.py
Comment thread estate/models/estate_property.py Outdated
@anchevalier anchevalier requested a review from ziriraha June 18, 2026 15:04

@ziriraha ziriraha 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, can you please squash all the commits into a single one?

Comment thread estate/models/estate_property.py
Comment thread estate/models/estate_property.py Outdated
Comment thread estate/models/estate_property_offer.py
Comment thread estate/security/ir.model.access.csv
Comment thread estate/views/estate_menus.xml Outdated
Comment thread estate/views/res_users_views.xml Outdated
Comment thread estate_account/models/estate_property.py

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

forgot to add

Comment thread estate/models/estate_property_offer.py Outdated
Comment thread estate_account/__manifest__.py
Comment on lines +7 to +31
def action_sold(self):
for record in self:
self.env["account.move"].create(
{
"partner_id": record.buyer_id.id,
"move_type": "out_invoice",
"invoice_line_ids": [
Command.create(
{
"name": f"Commission for {record.name}",
"quantity": 1.0,
"price_unit": record.selling_price * 0.06,
}
),
Command.create(
{
"name": "Administrative Fees",
"quantity": 1.0,
"price_unit": 100.00,
}
),
],
}
)
return super().action_sold()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In action_sold you have some check that raise errors. In this case, you are creating the account.move and then you are performing the checks. you should place the super() call above the creation of the account move, as there might a case where you create a move and then the sell errors out for some reason.

We usually do:

def func():
    action = super().func()
    ....
    return action

Dont take this as a rule of thumb, there are cases where we do want to run our logic before the super() (for example to add an extra check to raise an error)

_inherit = "estate.property"

def action_sold(self):
for record in self:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

super().action_sold is ensure_one, then this one must be ensure_one too

[ADD] tutorials: complete chapters 1 to 5

[ADD] tutorials: complete chapter 6

[CLN] estate: ignore Python cache files

Python cache files are environment-specific generated artifacts.

Remove tracked pycache files and add the corresponding .gitignore
rules.

[ADD] estate: complete chapter 7

[ADD] estate: complete chapter 8

[ADD] estate: complete chapter 9

[ADD] estate: complete chapter 10

[ADD] estate: complete chapter 11

[IMP] estate: improve action methods readability

Add ensure_one() to actions intended to run on a single record and
use more explicit variable names to improve code readability.

[ADD] estate: complete chapter 12

[ADD] estate: complete chapter 13

[IMP] estate: improve property views

Add status ribbons for sold and cancelled properties and display tags
in the property list view for better visibility.

[ADD] estate: complete chapter 14

[REF] estate: refactor Python and XML guidelines

[REF] estate: apply review suggestions and cleanup
@anchevalier anchevalier force-pushed the 19.0-onboarding-chean branch from 5dd0b05 to 0cf8cf4 Compare June 22, 2026 14:42
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