Skip to content

[IMP] estate: added auto fields and smart defaults#1224

Draft
patsh-odoo wants to merge 5 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-patsh
Draft

[IMP] estate: added auto fields and smart defaults#1224
patsh-odoo wants to merge 5 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-patsh

Conversation

@patsh-odoo
Copy link
Copy Markdown

@patsh-odoo patsh-odoo commented Apr 3, 2026

[ADD] estate: added computed fields and onchange method

Added computed fields to display total area, offer validity and offer deadline
date

it was necessary to display total area calculated from garden area and living
area so added compute method to calculate total area and added it to estate
property views, added offer validity and offer dead line fields to
estate_property_offer model they depend on each other so added compute and
inverse methods so user don't need to add another if one is added, added
onchange method so if user selects garden, default orientation and garden area
are populated

chapter: 8(Computed Fields And Onchanges)
task: add computed fields and onchange methods

@robodoo
Copy link
Copy Markdown

robodoo commented Apr 3, 2026

Pull request status dashboard

Copy link
Copy Markdown

@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 @patsh-odoo

Can you please follow the git guidelines?
https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html

And can you please use ruff for proper formatting?

You can check this style error - https://runbot.odoo.com/runbot/batch/2459862/build/106615533

Thanks

from odoo import models, fields


class estate(models.Model):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The class name is in Pascal case. Please read the Python coding guidelines.
https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#python

estate_property_ac1,basic_access,model_estate_property,base.group_user,1,1,1,1
estate_property_type_ac1,basic_access_type,model_estate_property_type,base.group_user,1,1,1,1
estate_property_tag_ac1,basic_access_tag,model_estate_property_tag,base.group_user,1,1,1,1
estate_property_offer_ac1,basic_access_offer,model_estate_property_offer,base.group_user,1,1,1,1 No newline at end of file
Copy link
Copy Markdown

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 end of the file.

<menuitem id="estate_property_menu_action_property_tag" action="estate_property_tag_action1"/>
</menuitem>
</menuitem>
</odoo> No newline at end of file
Copy link
Copy Markdown

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 end of the file.

</record>


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

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 end of the file.

</form>
</field>
</record>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unneccary space.

</field>
</record>

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

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 end of the file.

<field name="arch" type="xml">
<form>
<div class="oe_title">
<h1><field name="name"/></h1>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

indentation issue.

</field>
</record>

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

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 end of the file.

'name': "estate",
'depends': ['base'],
'application': True,
'data': ['security/ir.model.access.csv', 'views/estate_property_type_views.xml', 'views/estate_property_tag_views.xml', 'views/estate_property_offer_views.xml', 'views/estate_property_views.xml', 'views/estate_menus.xml']
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
'data': ['security/ir.model.access.csv', 'views/estate_property_type_views.xml', 'views/estate_property_tag_views.xml', 'views/estate_property_offer_views.xml', 'views/estate_property_views.xml', 'views/estate_menus.xml']
'data': [
'security/ir.model.access.csv',
'views/estate_property_type_views.xml',
'views/estate_property_tag_views.xml',
'views/estate_property_offer_views.xml',
'views/estate_property_views.xml',
'views/estate_menus.xml'
],

@patsh-odoo patsh-odoo changed the title [ADD] estate - Added menus and security rules [ADD] estate: added computed fields and onchange method Apr 8, 2026
@patsh-odoo patsh-odoo force-pushed the 19.0-tutorials-patsh branch 4 times, most recently from db4a40c to fba0a1d Compare April 9, 2026 18:37
This commit introduces the new estate module, which includes features to define
and organize property listings. Users can now record essential details such as
names, postcodes, and descriptions, alongside specific features like the number
of bedrooms, living area size, and garden details. It also includes tracking for
pricing, availability dates, and the current status of the property (such as
"New", "Offer Received", or "Sold"). These properties can be viewed and managed
through simple, easy-to-use lists and detailed forms.

The need for this module stems from the requirement to make property management
easy and centralized. By moving away from manual tracking, this update enables
the team to see all property details at a glance in a list view and manage
specific information within a single form. This ensures that every listing is
accounted for and the sales process is organized and easy to follow for all
users.

chapter: 1,2,3,4,5
Added custom search, form, and list views for properties in the estate module.

These changes were made because the default views did not organize property
information clearly. The custom views group related fields like title, postcode,
expected price, bedrooms, living area, and facades together, making it easier to
read and manage property details. The search view includes filters to show only
available properties and allows users to group properties by attributes like
postcode. This helps users quickly find, sort, and compare properties in a
structured and organized way.

chapter: 6(Basic Views)
@patsh-odoo patsh-odoo force-pushed the 19.0-tutorials-patsh branch from fba0a1d to 3e66a6e Compare April 9, 2026 19:03
@patsh-odoo patsh-odoo changed the title [ADD] estate: added computed fields and onchange method [IMP] estate: added auto fields and smart defaults Apr 9, 2026
@patsh-odoo patsh-odoo force-pushed the 19.0-tutorials-patsh branch from 8becf43 to 654f91d Compare April 10, 2026 13:06
Added fields for buyer, salesperson, and related property offers,
as well as property tags (like “cozy”). Custom views for these fields
were also created.

These changes make it easier to see and manage all key details of a
property in one place. Users can quickly identify the buyer and salesperson,
check associated offers, and view property features at a glance. Tags and
custom views help organize the information and make it more accessible.
Added total area and best offer calculation, linked offer validity and
deadline dates setting any one will automatically set another, and
default values for garden details will be automatically filled when
garden is selected.

These changes make data entry easier and reduce manual work.
The total area and best offer are calculated automatically, so users
don’t need to compute them. Offer validity and deadline are connected,
meaning entering one will automatically fill the other, avoiding confusion.
When a garden is selected, related fields like area and orientation are
pre-filled with default values, helping users enter information faster and
more consistently.

chapter:  8(Computed Fields And Onchanges)
User can now click a Sold or Cancel button to change a property’s status
instantly. The system also protects your data by making sure a house that is
already sold cannot be canceled, and a canceled house cannot be sold.
Additionally, individual offers now have Accept and Refuse buttons. When
you accept an offer, the system automatically fills in the buyer's name and the
final price on the main page, ensuring that only one offer can be finalized for
a property.

These buttons make user's work faster because the system does the typing for
user, user don't have to copy and paste the buyer's name or the price. The
rules keep records correct by making sure user don't click the wrong button
by accident.

chapter:  9(Ready For Some Action?)
@patsh-odoo patsh-odoo force-pushed the 19.0-tutorials-patsh branch from 654f91d to ffe3c75 Compare April 10, 2026 13:25
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