-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] estate: Added UI elements to enhance user experience
Chapter 11: Add UI Enhancements and Inline Views - Improved the user interface of the real estate module with color decorations and conditional display of fields and buttons. - Added inline list view for estate.property.type to display related properties with specific fields (name, expected price, and state). - Implemented statusbar widget to display the state of estate.property with specific statuses (New, Offer Received, Offer Accepted, Sold). - Added ordering to models for deterministic list views and manual ordering for estate.property.type. - Added widget options to prevent creation/editing from the form view and added color picker for tags. - Configured conditional display of buttons based on property state and made some fields invisible based on conditions. - Enhanced list views with color decorations and made lists editable and fields optional. - Added default filters to search views and adjusted filter domains for living area searches. - Implemented a stat button on estate.property.type form view to show related offers with appropriate filtering. Task: Added chatter in the estate property.for that made changes to estate_property_views.xml, __manifest__.py file and estate_property.py file.
- Loading branch information
Showing
9 changed files
with
203 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
{ | ||
'name': 'Real Estate', | ||
'version': '1.0', | ||
'license': 'LGPL-3', | ||
'category': 'Real Estate', | ||
'sequence': 15, | ||
'summary': 'Track properties', | ||
'description': "", | ||
'installable': True, | ||
'application': True, | ||
'depends': ['base_setup'], | ||
'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/estate_menus.xml' | ||
] | ||
"name": "Real Estate", | ||
"version": "1.1", | ||
"license": "LGPL-3", | ||
"category": "Tutorials", | ||
"sequence": 15, | ||
"summary": "Track properties", | ||
"description": "", | ||
"installable": True, | ||
"application": True, | ||
"depends": ["base_setup", "mail"], | ||
"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/estate_menus.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
from odoo import fields, models | ||
from odoo import fields, models, api | ||
|
||
|
||
class EstatePropertyType(models.Model): | ||
_name = "estate.property.type" | ||
_description = "Which type of property it is i.e apartment, house " | ||
_order = "sequence, name" | ||
|
||
name = fields.Char(required=True) | ||
property_ids = fields.One2many("estate.property", "property_type_id") | ||
sequence = fields.Integer("Sequence") | ||
_sql_constraints = [("type_uniq", "unique(name)", "Property Type should be unique")] | ||
offer_ids = fields.One2many( | ||
"estate.property.offer", | ||
"property_type_id", | ||
) | ||
offer_count = fields.Integer(compute="_compute_offer_count") | ||
|
||
_sql_constraints = [ | ||
('type_uniq', 'unique(name)', 'Property Type should be unique') | ||
] | ||
@api.depends("offer_ids") | ||
def _compute_offer_count(self): | ||
for record in self: | ||
record.offer_count = len(record.offer_ids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.