-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base: 18.0
Are you sure you want to change the base?
Conversation
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
There was a problem hiding this 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.
estate/models/estate_property.py
Outdated
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line
<group expand="1" string="Group By"> | ||
<filter string="Postcode" name="postcode" context="{'group_by':'postcode', 'residual_visible':True}"/> | ||
</group> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
estate/models/estate_property.py
Outdated
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))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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
estate/__manifest__.py
Outdated
'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 |
There was a problem hiding this comment.
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
c17bb1d
to
cbe1423
Compare
Added new module of Real Estate for tutorial purpose.