Skip to content

Conversation

nsirjacobs
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Sep 15, 2025

Pull request status dashboard

Copy link

@cgun-odoo cgun-odoo left a comment

Choose a reason for hiding this comment

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

Nice job, I had some comments mostly about formatting. You can think about formatting your code automatically using Ruff.

@cgun-odoo
Copy link

Please update the commit messages according to https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html#commit-message-structure

…ffers, to avoid wrong inputs

[FIX] Estate: Fixed business logic error that assumed we always had multiple offers
…the states of the property.

Also added properties in the view of users
Comment on lines 1 to 6
from . import (
estate_property,
estate_property_type,
estate_property_tag,
estate_property_offer,
)

Choose a reason for hiding this comment

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

Suggested change
from . import (
estate_property,
estate_property_type,
estate_property_tag,
estate_property_offer,
)
from . import estate_property,
from . import estate_property_type,
from . import estate_property_tag,
from . import estate_property_offer,

I think this is the way to do it because these files might depend on each other in the future

@@ -1,22 +1,74 @@
from odoo import fields, models
from datetime import date, timedelta
from odoo import fields, models, api

Choose a reason for hiding this comment

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

Suggested change
from odoo import fields, models, api
from odoo import api, fields, models

runbot usually complains that these imports should be in alphabetical order

estate_property_type,
estate_property_tag,
estate_property_offer,
inherited_users,

Choose a reason for hiding this comment

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

The inherited models should have the same file name. - res_users.py

"views/estate_property_tag_views.xml",
"views/estate_property_offer_views.xml",
"views/menus.xml",
"views/base_inherited_users_views.xml",

Choose a reason for hiding this comment

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

Should have the same name everywhere res_users_views.xml
You should add inherit while naming the records

default=lambda self: fields.Date.today() + timedelta(days=90),
)
expected_price = fields.Float(required=True)
expected_price = fields.Float(required=True, string="Expected Price")

Choose a reason for hiding this comment

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

Already the default string

Suggested change
expected_price = fields.Float(required=True, string="Expected Price")
expected_price = fields.Float(required=True)

Comment on lines +3 to +20
<data>

<record id="res_users_view_form" model="ir.ui.view">
<field name="name">res.users.view.form.inherit.gamification</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page string="Real Estate Properties">
<group>
<field name="property_ids"/>
</group>
</page>
</xpath>
</field>
</record>

</data>

Choose a reason for hiding this comment

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

should be indented

<field name="selling_price"/>
</div>
<div>
<field name="tags_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>

Choose a reason for hiding this comment

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

I missed this above I guess but the field name shouldn't be plural_plural here _ids is enough for us to understand it contains multiple records so, tag_ids is a better name

Comment on lines +14 to +22
# "data": [
# "security/ir.model.access.csv",
# "views/estate_property_views.xml",
# "views/estate_property_type_views.xml",
# "views/estate_property_tag_views.xml",
# "views/estate_property_offer_views.xml",
# "views/menus.xml",
# "views/base_inherited_users_views.xml",
# ],

Choose a reason for hiding this comment

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

Delete if not used

Comment on lines +8 to +27
for record in self:
values = {}
values["partner_id"] = record.buyer_partner_id.id
values["move_type"] = "out_invoice"
values["invoice_line_ids"] = [
Command.create(
{
"name": record.name,
"quantity": 1,
"price_unit": record.selling_price * (6 / 100),
}
),
Command.create(
{
"name": "Administrative fees",
"quantity": 1,
"price_unit": 100,
}
),
]

Choose a reason for hiding this comment

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

Suggested change
for record in self:
values = {}
values["partner_id"] = record.buyer_partner_id.id
values["move_type"] = "out_invoice"
values["invoice_line_ids"] = [
Command.create(
{
"name": record.name,
"quantity": 1,
"price_unit": record.selling_price * (6 / 100),
}
),
Command.create(
{
"name": "Administrative fees",
"quantity": 1,
"price_unit": 100,
}
),
]
values = {
"partner_id": record.something
"move_type": ...,
"invoice_line_ids": ...,
for record in self}

),
]

self.env["account.move"].create(values)

Choose a reason for hiding this comment

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

don't create it in the loop, collect all values and create them after the loop

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