Skip to content

Conversation

@dhvag-odoo
Copy link

No description provided.

- Set up the estate module based on the Odoo 19 Server Framework 101 tutorial
- Added estate.property model with proper naming conventions
- Implemented basic fields as introduced in chapters 1–3
- Kept the code aligned with Odoo ORM standards
- Continued the estate module implementation by completing Chapters 4–6
- Added and configured views, actions, and menus to make the estate.property model fully accessible from the UI
- Implemented list and form, views, filter, group-by
- Added required defaults and the active field
- Verified that all earlier checkpoints (Chapters 1–3) are still satisfied and working as expected
- Overall implementation remains consistent with Odoo ORM guidelines and framework best practices
@robodoo
Copy link

robodoo commented Jan 1, 2026

Pull request status dashboard

…er 7)

- Added relational fields (Many2one, One2many, Many2many) to the estate module
- Linked properties with types, offers, tags, buyer, and salesperson
- Created required views for managing offers within the property form
- Updated access rights for new models
- Fixed the import issue in estate_property_offer file.
Copy link

@mash-odoo mash-odoo left a comment

Choose a reason for hiding this comment

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

Hello @dhvag-odoo,
Good work on the new module..
Please check my comments and apply the needed changes

- Applied the changes suggested during code review
- Updated XML view structure and corrected attribute order
- Cleaned up naming issues in views and filters
- Adjusted default values and selection field keys
- Removed unnecessary field strings in the model
- Added new line in the file ir.model.access.csv
- This chapter introduces computed fields to derive values automatically.
- Field dependencies are managed using the @api.depends decorator.
- Onchange methods react to user input in real time on forms.
- Added accept and refuse actions for property offers
- Handled the case where only one offer should be accepted
- Updated property details like selling price and buyer when an offer is accepted
- Learn to add python and SQL constraint
Copy link

@mash-odoo mash-odoo left a comment

Choose a reason for hiding this comment

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

Hello,
Good job on the PR!
Here are some few suggestions..

- Improve the look and behavior of form and list views.
- Add status bar, decorations, and widgets for better clarity.
- Control button visibility based on record state.
- Set default sorting and make views more user-friendly.
- Enhance search and display to make records easier to understand.
- Each  request includes a title, cost, and status.
- Validation added to ensure approved maintenance requests have a valid cost.
- Total maintenance cost calculated.
- Only done maintenance requests are to be sold.
Copy link

@mash-odoo mash-odoo left a comment

Choose a reason for hiding this comment

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

Hello!
Good work on the task..
Here are some suggestions..

Comment on lines +46 to +54
def action_accept(self):
for record in self:
if record.property_id.state != 'offer_accepted':
record.status = 'accepted'
record.property_id.selling_price = record.price
record.property_id.buyer_ids = self.partner_id
record.property_id.state = 'offer_accepted'
else:
raise UserError('One offer has already been accepted')

Choose a reason for hiding this comment

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

Can you optimize this?

access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1
access_estate_property_maintenance_requests,access_estate_property_maintenance_requests,model_estate_property_maintenance_requests,base.group_user,1,1,1,1 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.

Add a line at the end of file

<field name="name">estate.view.list</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<list decoration-success="state == 'offer_received' or state == 'offer_accepted'" decoration-bf="state == 'offer_accepted'" decoration-muted="state == 'sold'">

Choose a reason for hiding this comment

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

Can we add decoration in form view?

<field name="living_area" string="living_area" filter_domain="[('living_area', '&gt;=', self)]"/>
<field name="facades"/>
<separator/>
<filter string="New / Offer Received" name="state" domain="['|',('state', '=', 'new'), ('state', '=', 'offer received')]"/>

Choose a reason for hiding this comment

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

What are required params in the filter? How to add a default filter?

<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
<field name="context">{'search_default_best_price': 0, 'search_default_state': 0}</field>

Choose a reason for hiding this comment

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

What does this 0 value indicate here?

<field name="arch" type="xml">
<list>
<field name="name"/>
<field name="sequence" widget="handle"/>

Choose a reason for hiding this comment

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

What does this widget do?

from odoo import api, fields, models


class EstatePropertyType(models.Model):

Choose a reason for hiding this comment

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

Follow this conventions while declaring fields, constraints, methods or CRUD operations.

property_type_id = fields.Many2one(
'estate.property.type', string="Property Type")
seller_ids = fields.Many2one(
'res.users', string="Salesman", default=lambda self: self.env.user

Choose a reason for hiding this comment

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

What does this lambda function do?

)
property_type_id = fields.Many2one(
'estate.property.type', string="Property Type")
seller_ids = fields.Many2one(

Choose a reason for hiding this comment

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

Suggested change
seller_ids = fields.Many2one(
seller_id = fields.Many2one(

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

Choose a reason for hiding this comment

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

I don't think this is required here anymore as you are already adding this field in header as a statusbar

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