[LOSBO] Real Estate Property Management - Tutorials - #1407
losbo-odoo wants to merge 9 commits into
Conversation
| # -*- coding: utf-8 -*- | ||
| { | ||
| 'name': "Awesome Dashboard", | ||
| 'name': "Awesome Dashboard1", |
There was a problem hiding this comment.
Can you please import it as per Odoo standard?
There was a problem hiding this comment.
yes, I have imported as per odoo standard
| "res.users", string="salesperson", default=lambda self: self.env.user | ||
| ) | ||
| offer_ids = fields.One2many("estate.property.offers", "property_id") | ||
|
|
There was a problem hiding this comment.
yes, I have removed the unnecessary space
| offer_ids = fields.One2many("estate.property.offers", "property_id") | ||
|
|
||
| total_offers = fields.Integer(compute="_compute_offers") | ||
|
|
| from odoo.exceptions import ValidationError | ||
|
|
||
|
|
||
| class TestModel(models.Model): |
There was a problem hiding this comment.
yes,
I have changed the name to EstateProperty
| today = datetime.now() | ||
|
|
||
| month = today.month + 3 | ||
| year = today.year | ||
| day = today.day | ||
|
|
||
| if month > 12: | ||
| year = year + 1 | ||
| month = month % 12 | ||
|
|
||
| three_month_date = today.replace(year=year, month=month, day=day) |
There was a problem hiding this comment.
Can you explain me the purpose of this?
There was a problem hiding this comment.
yes, I was calculating the next 3 month date but I have changed the logic to optimize the code
| count = 0 | ||
| if record.offer_ids: | ||
| for offers in record.offer_ids: | ||
| if offers.status == "accepted": |
There was a problem hiding this comment.
Yes, I wanted to show only the accepted offers through the computed field, but this can be achieved using the filter attribute in the view XML. So, I have removed it in the new commit.
| <field name="property_tag_ids" widget="many2many_tags"/> | ||
| </div> | ||
| <group> | ||
| <group string="Pricing & Availability"> |
There was a problem hiding this comment.
Yes, i have improved the UI by replacing '&' with 'and'
| <field name="total_offers"/> | ||
| <field name="state"/> | ||
| </group> | ||
| <group string="Property Specs"> |
| ] | ||
| ) | ||
| active = fields.Boolean("Active", default=True) | ||
| property_type_id = fields.Many2one("estate.property.type", string="Property_type") |
There was a problem hiding this comment.
| property_type_id = fields.Many2one("estate.property.type", string="Property_type") | |
| property_type_id = fields.Many2one("estate.property.type", string="Property type") |
There was a problem hiding this comment.
Yes, I have updated the string name.
- Added estate property model - Defined basic property fields
- Added security file to grant permission for group user
- Added estate property view file and rendered the model fields
- Added 'estate_property_menu.xml' to render the menu items - Update the 'estate_property_views.xml' to render more fields - Update the manifest file to add 'estate_property_menu.xml'
…table (estate_property and estate_property_type) using Many2one - Added different relation fields like Many2One, Many2Many and One2Many to connect two tables - Removed unnecessary lines of code - Update the 'estate_property_views.xml' to improve the UI
- Added the 'estate_property_type.py' model and used this in the 'estate_property_views.xml'
Differentiating the properties using tags, types along with tracking the offers received for each property, will streamline property manangement - introduced new models - 'estate.property.tags' : Labeling the properties - 'estate.proerty.types' : Categorizes properties - 'estate.property.offers' : track the buyer offers, prices and offer statuses - linked new models to 'estate.proerty.py' - Many2many relation to 'estate.property.tags' - Many2one relation to 'estate.property.types' - One2many realtion to 'estate.property.offers' - Updated UI views - Added estate_property_type_view.xml to manage property types. - Updated estate_property.xml to render type, tags and inline offer list tab
… and functions
I have added the available filter to allow users to isolate open properties, and i have added computed fields to dynamically calculate the fields
as i have added the relation between models it is necessary to add the ondelete attribute to handle the removed or unnecessary properties
1. Property Availabilty & filtering:
- Added 'state' field to 'estate.property' to track the lifecycle of a listing
- updated 'estate_property_views' to include the available filter, allowing users to isolate properties open for offer
2. Computed fields:
- Implemented computed fields ('total_offers', 'total_area', 'best_price') along with their respective computed functions
3. Database Integrity:
- Added `ondelete='cascade'` to the 'property_tag_ids' (Many2many relation) in 'estate_property.py' model and to the 'property_id' (Many2many relation) in 'estate_property_offers'
1> awesome_dashboard/__manifest__.py
- fixed the 'name' in the __manifest__.py file of awesome_dashboard
2> estate/models/__init__.py
- imported as per the odoo standard
3> estate/models/estate_property.py
- changed the model name
- implement better logic to calculate next 3 months date
- fixed the name of property type in model
- removed extra spaces
- removed the accpeted check in the _compute_offers function
4> estate/views/estate_property_views.xml
- fixed the string name to improve the UI
3782710 to
03f32ad
Compare

Implementation of the estate tutorial module covering initial module setup, security access, and property models: