Skip to content

Conversation

@Faruk372742
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Dec 15, 2025

Pull request status dashboard

Faruk372742 and others added 8 commits December 18, 2025 16:01
New ir.model.access file to adding all kind of accesses to the base.group_user and connecting csv file to manifest

[LINT] estate: fixing linter issues

[LINT] estate: adding new lines to the end of the few file
[LINT] estate: linting all python files with ruff
…hapter 6

add: state field to the estate_property model
security: readonly and all-rights security groups are created
views: list, form, search views are created, in search view state filter and postcode groupby features are added
manifest is updated with the security file
new models: estate_property_offer, estate_property_tag
estate_property: adding new fields (type, salesperson, buyer, tags, offers)
estate_property_view: adding offers to form view, tags to both list and form views
estate_property_offer_view: adding list and form views
menu: settings menu for types and tags
computed fields: deadline of the offer, best price from many offers
onchange: garden affects garden_area and garden_orientation
…ffers - Chapter 9

estate_property: adding cancel and sold buttons and actions for those buttons
estate_property_offer: adding accept and refuse buttons and actions for those buttons
learned: actions, exception example, icons in buttons
@Faruk372742 Faruk372742 force-pushed the master-technical_onboarding-faavc branch from 0b0c858 to 79ff504 Compare December 18, 2025 15:04
SQL constraints: expected_price, selling_price, offer price, property tag and type
Python constraints: selling price >= 0.9 of the expected price
Copy link

@amah-odoo amah-odoo left a comment

Choose a reason for hiding this comment

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

Huge work so far 🎉

just small comment for now

garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(string="Orientation", selection=[("North", "North"), ("South", "South"), ("East", "East"), ("West", "West")])

No newline at end of file

Choose a reason for hiding this comment

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

do not forget the new line at the end of file

garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(string="Orientation", selection=[("North", "North"), ("South", "South"), ("East", "East"), ("West", "West")])

Choose a reason for hiding this comment

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

I would prefer to right the selection options that way to make it more clearer Also the tuple first value represent the technical name so it should be in snake_case 🐍

Suggested change
garden_orientation = fields.Selection(string="Orientation", selection=[("North", "North"), ("South", "South"), ("East", "East"), ("West", "West")])
garden_orientation = fields.Selection([
("north", "North"),
("south", "South"),
("east", "East"),
("west", "West")
], string="Orientation")

description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(
copy=False, default=datetime.now() + relativedelta(months=3)

Choose a reason for hiding this comment

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

for the default values it is get evaluated on server boot-up So without the lambda once you run the server it will take the date and after 1 week if you created new property it will take the 3 month from the server boot-up not 3 month from real today.

Suggested change
copy=False, default=datetime.now() + relativedelta(months=3)
copy=False, default=lambda self: datetime.now() + relativedelta(months=3)

buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False)
tag_ids = fields.Many2many("estate_property_tag")
offer_ids = fields.One2many("estate_property_offer", "property_id", string="Offers")
total_area = fields.Integer("Total Area (sqm)", compute="_compute_area")

Choose a reason for hiding this comment

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

for compute method we tend to use the full field name if it is the only field computed in the method

Suggested change
total_area = fields.Integer("Total Area (sqm)", compute="_compute_area")
total_area = fields.Integer("Total Area (sqm)", compute="_compute_total_area")

Comment on lines 66 to 70
record.best_price = (
0
if len(record.offer_ids) == 0
else max(offer.price for offer in record.offer_ids)
)

Choose a reason for hiding this comment

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

the .mapped('field') return a list with the all the field values for the recordset and the or [0] will replace the list of prices with list contain 0 if the list is empty list

Suggested change
record.best_price = (
0
if len(record.offer_ids) == 0
else max(offer.price for offer in record.offer_ids)
)
record.best_price = max(record.offer_ids.mapped('price') or [0])

ref: maximizing method and name of the computation method
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