Skip to content

Conversation

@qucol-odoo
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Oct 20, 2025

Pull request status dashboard

@Mathilde411 Mathilde411 changed the title Chapter 2 QUCOL Onboarding Oct 20, 2025
@Mathilde411 Mathilde411 requested a review from alan-odoo October 20, 2025 11:44
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from 46fe336 to 5cda5fe Compare October 20, 2025 14:02
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch 2 times, most recently from ad8ec7f to 3a01b0f Compare October 20, 2025 14:12
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from 3a01b0f to a14ca42 Compare October 20, 2025 14:28
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from a29a9bb to 5563be0 Compare October 21, 2025 14:43
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from 9951f58 to 42d5841 Compare October 21, 2025 14:53
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from d0a617c to 0cf2ff3 Compare October 22, 2025 14:59
@qucol-odoo qucol-odoo closed this Oct 22, 2025
@qucol-odoo qucol-odoo reopened this Oct 22, 2025
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch 5 times, most recently from eff89b1 to 2faaaee Compare October 24, 2025 11:06
Copy link

@alan-odoo alan-odoo left a comment

Choose a reason for hiding this comment

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

Hi @qucol-odoo 👋,

Here is a review of your code. You went through the tutorials without much difficulty so I've been a little bit more touchy on your PR 😃.

Your branch is very clean! And we're not going to dirty it. Then can you do the corrections in the right commits ? In the end, your branch shouldn't contain new commit. If you meet some issue doing it, ping me 😃.

Thanks for your job and for helping your teammates!

Comment on lines 1 to 4
from . import estate_properties
from . import estate_property_types
from . import estate_property_tags
from . import estate_property_offers

Choose a reason for hiding this comment

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

They should be listed alphabetically.

Comment on lines 5 to 7
DEFAULT_GARDEN_AREA = 10
DEFAULT_GARDEN_ORIENTATION = "north"

Choose a reason for hiding this comment

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

That's the right way to write constants but I am not sure to understand why it is required. They are used only in _update_garden_area_and_orientation, can they be defined directly in that method?

selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')]
)
total_living_area = fields.Integer(compute="_compute_total_area")

Choose a reason for hiding this comment

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

No need of that blank line 😃.

record.total_living_area = record.living_area + record.garden_area

@api.depends("offer_ids")
def _get_highest_price(self):

Choose a reason for hiding this comment

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

As this method is used to compute the best_price, it should be named _compute_best_offer 😃, that way we know easily 1. it computes field and 2 which field.

FYI, _get or get methods should return an object and should not modify the database. For example, _get_res_user should only return a res_user and do nothing else.

record.best_offer = max(record.offer_ids.mapped("price")) if record.offer_ids else 0

@api.onchange("garden")
def _update_garden_area_and_orientation(self):

Choose a reason for hiding this comment

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

Same here.

<field name="arch" type="xml">
<form string="Property type">
<sheet>
<button name="%(estate.estate_property_offer_action)d" string="Offers" type="action" title="Offers list" invisible="not offer_count > 0"/>

Choose a reason for hiding this comment

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

Suggested change
<button name="%(estate.estate_property_offer_action)d" string="Offers" type="action" title="Offers list" invisible="not offer_count > 0"/>
<button name="%(estate.estate_property_offer_action)d" string="Offers" type="action" title="Offers list" invisible="offer_count == 0"/>

<field name="name"/>
</h1>
<group>
<field name="offer_count"/>

Choose a reason for hiding this comment

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

Maybe you can test to add it inside your oe_stat_button ? (not a priority). You can find a solution here (line 847)

@@ -0,0 +1,21 @@
<odoo>
<record id="estate_res_user_view_form" model="ir.ui.view">

Choose a reason for hiding this comment

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

You can call it as its parent. Other modules will refer to this one as estate.res_user_view_form. So here we know that the main form of the user has been modified and this is not a new one.

Suggested change
<record id="estate_res_user_view_form" model="ir.ui.view">
<record id="res_user_view_form" model="ir.ui.view">

],
'data': [
'security/ir.model.access.csv',

Choose a reason for hiding this comment

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

No need of this blank line. Do not forget that a lot of developers are working on the project and we must avoid unnecessary changes.

Comment on lines +36 to +43
taken_ids = set()
for invoice in self.env["account.move"].search([]):
if (match := re.match(r"Invoice\s+(\d+)", invoice.name)):
taken_ids.add(int(match.group(1)))
i = 1
while i in taken_ids:
i += 1
return f"Invoice {i}"

Choose a reason for hiding this comment

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

Do you want to select the first number missing in the sequence or the one above the maximum ?
If it is the last case, I would do something like that to avoid too many loops.

Suggested change
taken_ids = set()
for invoice in self.env["account.move"].search([]):
if (match := re.match(r"Invoice\s+(\d+)", invoice.name)):
taken_ids.add(int(match.group(1)))
i = 1
while i in taken_ids:
i += 1
return f"Invoice {i}"
invoice = self.env["account.move"].search([("name", "like", "Invoice %")], order='id desc', limit=1)
if invoice and (match := re.match(r"Invoice (\d+)", invoice.name)):
return f"Invoice {match.group(1)}"
return "Invoice 1"

@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from 807bbc0 to 1255d29 Compare October 27, 2025 08:11
@qucol-odoo qucol-odoo force-pushed the 19.0-onboarding-qucol branch from 1229223 to 327b3f5 Compare October 27, 2025 09:21
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