Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] estate: adding a new real estate module #314

Draft
wants to merge 9 commits into
base: 18.0
Choose a base branch
from

Conversation

siha-odoo
Copy link

Added new module of Real Estate for tutorial purpose.

Added Real Estate module with two files init & manifest
also configured manifest file  to make module visible as App.
configured the flow of import files
created one estate_property table using ORM API's models and fields
configured security by adding access rights using csv file
-linked actions between menus and views.
-added three layered action menu(display,task bar,action menu)
-added new attributes to fields such as read-only, default,reserved fields.
-implemented 3 months visibility functionality using today() and relativedelta
-added list view of dashboard  and configured form view of property.
-also made search view with implementation of filter and group by functionality
-added property type model (Many2one), configured it's menu,actions and views
-added property tags model(Many2many), configured it's menu,actions and views
-added Offers model (One2many) , creates list view of it
@robodoo
Copy link

robodoo commented Feb 5, 2025

Pull request status dashboard

Copy link

@rare-odoo rare-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 @siha-odoo 👋,

Great work so far!

This is the first phase review.
Please make sure to add a new line at the end of every file
and avoid unnecessary spaces.

partner_id=fields.Many2one("res.partner", string="Buyer",copy=False)
tag_ids=fields.Many2many("estate.property.tags",string="Tags")
offer_ids=fields.One2many("estate.property.offer","property_id",string="Offers") #One2Many field

Choose a reason for hiding this comment

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

Extra line

Comment on lines +98 to +100
<group expand="1" string="Group By">
<filter string="Postcode" name="postcode" context="{'group_by':'postcode', 'residual_visible':True}"/>
</group>
Copy link

@rare-odoo rare-odoo Feb 5, 2025

Choose a reason for hiding this comment

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

Why is this filter placed inside the group tag?

Copy link
Author

Choose a reason for hiding this comment

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

group tag is used to organize filters in search view and the reason that field is placed inside group tag because it defines grouping filter though it can implemented without using group tag.

Comment on lines +2 to +5
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1
estate.access_estate_property_type,access_estate_property_type,estate.model_estate_property_type,base.group_user,1,1,1,1
estate.access_estate_property_tags,access_estate_property_tags,estate.model_estate_property_tags,base.group_user,1,1,1,1
estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,1,1,1

Choose a reason for hiding this comment

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

Could you please explain why there's a 1,1,1,1 at the end?

Copy link
Author

Choose a reason for hiding this comment

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

yes, those are access rights to particular group user and which are accesses of read, write , create , unlink. as given 1 to all stats that base.group_user has rights to read,write,create and unlink

name=fields.Char(string='Name',required = True)
description=fields.Text(string='Description')
postcode=fields.Char(string='Postcode')
date_availability=fields.Date(string='Available From',copy = False,default = fields.Date.add(fields.Date.today()+ relativedelta(months=3)))

Choose a reason for hiding this comment

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

Suggested change
date_availability=fields.Date(string='Available From',copy = False,default = fields.Date.add(fields.Date.today()+ relativedelta(months=3)))
date_availability= fields.Date(string='Available From', copy=False, default=fields.Date.add(fields.Date.today() + relativedelta(months=3)))

Please add spaces in the correct places and follow the same formatting for the rest of the code.

Also, could you clarify the purpose of adding the default here?

Copy link
Author

Choose a reason for hiding this comment

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

Noted. will take care about it from now.

we can add default value to fields by using default attribute. And as per requirement of chapter default date availability date should be in 3 months

Comment on lines 11 to 15
'security/ir.model.access.csv', #Load security first
'views/estate_property_views.xml', #Load Property model views
'views/estate_property_type_views.xml', #Load Property Type model views
'views/estate_property_tag_views.xml', #Load Property Tag model views
'views/estate_menus.xml', #Load menus after views

Choose a reason for hiding this comment

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

No need to add a comment about view loading.

-wrote business logic for following :
- calculate total area based on garden and living area
-inverse function on validity days and computation of date deadline & vice-versa
-onchange functionality on garden field to update garden area&garden orientation

also modified the changes suggested in chain request.
-linked logic with actions when property either sold or cancelled.
-ensured once any button changed it can't changed again
-applied same for accepting or refusing an offer.
-set selling price and buyer once offer is accepted.
-once offer is accepted other offers can not be marked as accept & vice-versa
-Added SQL's CHECK and UNIQUE constrains on given fields.
-CHECK: selling, offer, expected prices should be strictly positive.
-UNIQUE: property type and tag should be unique.
-odoo's @api. constrains on selling & expected price to  make sure that selling
 price does not fall more lower than 90% of expected price
@siha-odoo siha-odoo force-pushed the 18.0-tutorials-siha branch from c17bb1d to cbe1423 Compare February 6, 2025 10:49
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