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: added my estate module #325

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

Conversation

mevi-odoo
Copy link

After this commit:

  • Added init and manifest file

After this commit:
- Added init and manifest file
@robodoo
Copy link

robodoo commented Feb 6, 2025

Pull request status dashboard

@mevi-odoo mevi-odoo marked this pull request as draft February 6, 2025 07:41
After this commit:
- Added init and estate python file.
estate/__init__.py Outdated Show resolved Hide resolved
estate/__manifest__.py Outdated Show resolved Hide resolved
estate/models/estate.py Outdated Show resolved Hide resolved
estate/models/estate.py Outdated Show resolved Hide resolved
estate/models/estate.py Outdated Show resolved Hide resolved
estate/models/estate.py Outdated Show resolved Hide resolved
estate/__manifest__.py Show resolved Hide resolved
@shag-odoo
Copy link

Hello @mevi-odoo
make sure your PR tile incorporates github guideline that our community follows
ref : https://www.odoo.com/documentation/18.0/contributing/development/git_guidelines.html

estate/security/ir.model.access.csv Outdated Show resolved Hide resolved
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.
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/__manifest__.py Outdated Show resolved Hide resolved
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),)

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(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?

Copy link
Author

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.

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.

estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/views/estate_menus.xml Outdated Show resolved Hide resolved
estate/views/estate_menus.xml Outdated Show resolved Hide resolved
estate/views/estate_property_views.xml Outdated Show resolved Hide resolved
estate/views/estate_property_views.xml Outdated Show resolved Hide resolved

<!-- Group by Postcode -->
<group expand="0" string="Group By">
<filter name="group_by_postcode" string="Postcode" context="{'group_by': 'postcode'}"/>

Choose a reason for hiding this comment

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

Suggested change
<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?

Copy link
Author

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.

estate/views/list_views.xml Outdated Show resolved Hide resolved
<field name="living_area"/>
<field name="expected_price"/>
<field name="selling_price"/>
<field name="state" optional="hide"/>

Choose a reason for hiding this comment

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

Suggested change
<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?

Copy link
Author

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.
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.
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