Skip to content

Conversation

@radet-odoo
Copy link

Completed chapters 1-5 of the Odoo tutorial, including basic app creation, models, security, and UI setup.

Add estate module
Configure custom module structure in Odoo 19
Introduce addons structure and ORM models
Define database tables using Odoo ORM
CHAPTER 1,2,3
Define model access rules for the estate module using ir.model.access.csv
to control user permissions.

CHAPTER 4
Make estate.property accessible from the UI with proper defaults and field
constraints.
@robodoo
Copy link

robodoo commented Jan 1, 2026

Pull request status dashboard

Copy link

@bit-odoo bit-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!

i have added some comments.

no need to do separate commit for this - 3981aa4

Can you please adapt the PR meesage and title accroding to guidelines.

Thanks

@@ -0,0 +1,15 @@
{
'name': "Real Estate",
Copy link

Choose a reason for hiding this comment

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

Please follow the same quote throughout the file.

Comment on lines 1 to 2
from odoo import fields, models
from dateutil.relativedelta import relativedelta
Copy link

Choose a reason for hiding this comment

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

garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()

Copy link

Choose a reason for hiding this comment

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

unneccary diff.

garden_orientation = fields.Selection(
[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')]
)

Copy link

Choose a reason for hiding this comment

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

unneccary diff.

@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Should be one empty line at the EOF.

</menuitem>

</data>
</odoo> No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Should be one empty line at the EOF.

<?xml version="1.0"?>
<odoo>
<data>

Copy link

Choose a reason for hiding this comment

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

unneccary diff.

<menuitem id="estate_properties_menu_action" action="estate_property_action"/>
</menuitem>
</menuitem>

Copy link

Choose a reason for hiding this comment

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

unneccary diff.

<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
</record>
</odoo> No newline at end of file
Copy link

Choose a reason for hiding this comment

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

Should be one empty line at the EOF.

Improve estate.property usability by organizing fields and adding filters.
CHAPTER 6
Improve data link between related models.
CHAPTER 7
@radet-odoo
Copy link
Author

Changes have been made as per the review suggestions. Thank you.

@radet-odoo radet-odoo changed the title 19.0 tutorials radet [IMP] estate: Enhance property management with relational fields, views, and user access Jan 7, 2026
@radet-odoo radet-odoo changed the title [IMP] estate: Enhance property management with relational fields, views, and user access [IMP] Estate: Enhance property management with relations, views, and access Jan 7, 2026
Copy link

@bit-odoo bit-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!

Can you please improve all your commit message accroding to guidelines.

Thanks

Comment on lines 1 to 2
from dateutil.relativedelta import relativedelta
from odoo import fields, models
Copy link

Choose a reason for hiding this comment

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

Please do not make the same mistake repeatedly. #1108 (comment)

Comment on lines 13 to 17
<field name="bedrooms" />
<field name="living_area" />
<field name="garden" />
<field name="garage" />
<field name="date_availability" />
Copy link

Choose a reason for hiding this comment

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

We can make some fields optional for better visibility.

<separator />
<filter string="Available" name="active" domain="[('state', 'in', ['new','offer_received'])]" />
<filter string="postcode" name="postcode" context="{'group_by':'postcode'}" />

Copy link

Choose a reason for hiding this comment

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

unneccary space.

- Add computed fields for total area and best offer to ensure data consistency
- Implement computed validity date with inverse logic on property offers
- Add onchange to assist garden-related form inputs without business logic

CHAPTER - 8
- Add Cancel and Sold actions on properties with state validation
- Add Accept and Refuse actions on offers with business constraints
- Ensure accepted offer sets buyer and selling price, enforcing uniqueness

CHAPTER - 9
- Add SQL constraints for positive prices and unique names
- Add Python constraint to block selling below 90% expected price
- Ensure constraints trigger on expected and selling price changes

CHAPTER 10
- Add inline list view on property type to show linked properties
- Display property state using statusbar widget for better clarity
- Improve UX by simplifying views without changing business logic

CHAPTER 11
- Improve usability by adding inline list views and statusbar widgets
- Prevent invalid actions using conditional visibility and readonly rules
- Enhance readability with list decorations, tag colors, and editable lists
- Apply deterministic and manual ordering, plus better default search behavior

CHAPTER 11
Copy link

@bit-odoo bit-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,
Can you please improve your PR message and title.
Thanks.

Comment on lines +78 to +83
def action_sold(self):
for record in self:
if record.state == 'cancelled':
raise exceptions.UserError("Cancelled properties cannot be sold.")
record.state = 'sold'
return True

Choose a reason for hiding this comment

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

It's good to make the error message translatable.
raise exceptions.UserError(_("Cancelled properties cannot be sold."))

We can use filtered() here.

if self.filtered(lamda x: x.state=="cancelled")

Comment on lines +86 to +89
for record in self:
if record.state == 'sold':
raise exceptions.UserError("Sold properties cannot be cancelled.")
record.state = 'cancelled'

Choose a reason for hiding this comment

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

It's good to make the error message translatable.
raise exceptions.UserError(_("Sold properties cannot be cancelled."))

We can use filtered() here.

if self.filtered(lamda x: x.state=="sold")

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