-
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: added my estate module #325
base: 18.0
Are you sure you want to change the base?
Conversation
After this commit: - Added init and manifest file
After this commit: - Added init and estate python file.
339a5d9
to
c8c727e
Compare
Hello @mevi-odoo |
After this commit: - Add security rights -ir.model.access made this csv file to grant access to base group user. -they have read, write,create,delete permissions.
cc55bd6
to
ff5b4d6
Compare
After this commit: - Made xml files in views folder, added it to manifest. -Added menus -Added new attributes, set their default vales , make the copy false. -Added states as given.
estate/models/estate_property.py
Outdated
name = fields.Char(required=True) | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Date(copy=False,default=lambda self: 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(copy=False,default=lambda self: fields.Date.today() + relativedelta(months=3),) | |
date_availability = fields.Date(copy=False,default=lambda self: fields.Date.today() + relativedelta(months=3),) |
1.what is the usecase of copy
2. what is lambda function used for?
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.
copy=False means this field won’t be copied when duplicating a record.
lambda function is a short function used to set default values.
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.
Basically, fields are not copied, the data associated with them is copied, which will be restricted if False
is passed.
|
||
<!-- Group by Postcode --> | ||
<group expand="0" string="Group By"> | ||
<filter name="group_by_postcode" string="Postcode" context="{'group_by': 'postcode'}"/> |
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.
<filter name="group_by_postcode" string="Postcode" context="{'group_by': 'postcode'}"/> | |
<filter name="group_by_postcode" string="Postcode" context="{'group_by': 'postcode'}"/> |
what is the usecase of context here?
why context is been used?
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.
The context="{'group_by': 'postcode'}" in the filter tells Odoo to group properties by postcode when the filter is selected. This means that instead of showing all properties in a regular list, Odoo will organize them under different postcode categories. It helps in quickly finding and managing properties based on their location. Without this context, the filter would not know how to group the records.
<field name="living_area"/> | ||
<field name="expected_price"/> | ||
<field name="selling_price"/> | ||
<field name="state" optional="hide"/> |
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.
<field name="state" optional="hide"/> | |
<field name="state" optional="hide"/> |
what is the purpose of optional="hide" attribute
If it is removed what changes occurs?
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.
The optional="hide" attribute allows users to hide in the list view using the Odoo UI.
After this commit: -Made list view and added fields like postcode,bedrooms,garden,facades and etc. -Designed the form view for the estate.property model . -Added search functionality -Added filter and group by domain.
After this commit: -added total area field which is sum of the living_area and the garden_area -added best_price which is maximum of the offer price -added validity and deadline to estate.property.offer -added inverse function so if we changes the deadline -the validity will change accordingly -create onChange in estate property model where if garden is true -the garden area will set to 10 and garden orientation to north.
5b54b4b
to
c76399f
Compare
After this commit: -Added cancel and sold button and throws error if some unusual operation takes place. -Added accept and refuse button that will automatically set the status to accepted or refused. -Computed the selling price and buyer of the property once property is accepted.
After this commit: