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: create real estate module with basic property managemen… #136

Closed
wants to merge 6 commits into from

Conversation

span-odoo
Copy link

…t feature

Property Management: Create and maintain detailed property listings, including type, location, features, and pricing.
Offer Tracking: Record and track offers from potential buyers, facilitating negotiations and decision-making.
Salesperson and Buyer Associations: Link properties to responsible salespersons and interested buyers for better organization.
Custom Views: Designed tailored list and form views to improve data visualization and user interaction.
Business Logic: Implemented essential business rules and workflows, automating processes and ensuring data consistency.
Constraints: Added validation constraints to prevent invalid data entry and maintain data integrity.

…t feature

Property Management: Create and maintain detailed property listings, including
type, location, features, and pricing.
Offer Tracking: Record and track offers from potential buyers, facilitating
negotiations and decision-making.
Salesperson and Buyer Associations: Link properties to responsible salespersons
and interested buyers for better organization.
Custom Views: Designed tailored list and form views to improve data
visualization and user interaction.
Business Logic: Implemented essential business rules and workflows, automating
processes and ensuring data consistency.
Constraints: Added validation constraints to prevent invalid data entry and
maintain data integrity.
This commit extends the Real Estate module by incorporating three types of
inheritance:

Python inheritance: Applied Python inheritance to streamline code
structure, promoting reusability and maintainability.

Model inheritance: Utilized Odoo's model inheritance features to extend existing
models, adding new fields and behaviors while preserving core functionalities.

View inheritance: Employed view inheritance to customize and enrich user
interfaces, ensuring seamless integration with existing elements.
…e code

refactor(real_estate): Enhance module with Kanban view and code optimizations.

This commit introduces a Kanban view for improved visualization and workflow
management in the Real Estate module. Additionally, the codebase has been
polished for better readability and maintainability.
feat(real_estate): Add essential master and demo data for module setup and
testing.
This commit populates the Real Estate module with crucial master data, such as
property types, offer states, and default settings. Additionally, demo data is
included to facilitate testing and showcase the module's functionalities in
action.
…rt template

feat(real_estate): Implement property reports with inheritance for enhanced
functionality.

This commit introduces a new reporting system for properties in the Real Estate
module. It includes a base report template for displaying property details and
utilizes inheritance to create specialized reports for different property types.
This approach improves code organization and allows for flexible report
customization in the future.
Copy link

@adsh-odoo adsh-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 @span-odoo
Some comments mostly regarding the guidelines and coding conventions.
Can you please check.
Thanks!!

</menuitem>
</menuitem>

</odoo>

Choose a reason for hiding this comment

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

Need a new line at EOF.
Please check other files also

Comment on lines +24 to +42
<!-- created a tree view for estate.property.offer model and provided the fields to it -->

<!-- <record id="estate_property_offer_tree_view" model="ir.ui.view">
<field name="name">estate.property.offer.tree.view</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<tree string="estate property offer tree">
<field name="price" string="Price" />
<field name="partner_id" string="Partner" />
<field name="Validity" string="Validity" />
<field name="deadline" string="Deadline" />
<button name="action_accept" type="object" icon="fa-check" title="accept"
invisible="status in ['accepted','refused'] and status != ''"></button>
<button name="action_refuse" type="object" icon="fa-remove" title="refuse"
invisible="status in ['accepted','refused'] and status != ''"></button>
<field name="status" string="Status" />
</tree>
</field>
</record> -->

Choose a reason for hiding this comment

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

Try to avoid pushing the commented code

Comment on lines 116 to 121
if record.state == "canceled":
raise UserError(
"This Property couldn't be sold Because it is alredy canceled."
)
elif record.state == "sold":
raise UserError("This property is alredy Sold.")

Choose a reason for hiding this comment

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

Suggested change
if record.state == "canceled":
raise UserError(
"This Property couldn't be sold Because it is alredy canceled."
)
elif record.state == "sold":
raise UserError("This property is alredy Sold.")
if record.state in ["sold", "canceled"]:
raise UserError(
"Combined message"
)

You can do something like this instead of checking conditions separately

Comment on lines 97 to 105
if (
record.selling_price == 0
or record.selling_price >= (90 / 100) * record.expected_price
):
pass
else:
raise ValidationError(
"the selling price cannot be lower than 90'%' of the expected price."
)

Choose a reason for hiding this comment

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

Suggested change
if (
record.selling_price == 0
or record.selling_price >= (90 / 100) * record.expected_price
):
pass
else:
raise ValidationError(
"the selling price cannot be lower than 90'%' of the expected price."
)
if record.selling_price <= (90 / 100) * record.expected_price:
raise ValidationError(
"the selling price cannot be lower than 90'%' of the expected price."
)

You can do something like this

# created the action for the cancel button that will change the state of the property to canceled
def action_cancel(self):
for record in self:
if record.state == "sold":

Choose a reason for hiding this comment

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

Try same as above

Comment on lines 36 to 37
if record.create_date:
pass

Choose a reason for hiding this comment

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

try to avoid using pass

Comment on lines 1 to 3
from odoo import api, models, fields
from dateutil.relativedelta import relativedelta
from odoo.exceptions import UserError, ValidationError

Choose a reason for hiding this comment

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

Suggested change
from odoo import api, models, fields
from dateutil.relativedelta import relativedelta
from odoo.exceptions import UserError, ValidationError
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
from odoo.exceptions import UserError, ValidationError

generally, we follow a convention in which we first import all the external libraries and the import from odoo in alphabetical order.
Need to check in other files also

Comment on lines 27 to 34
<div class="d-flex justify-content-end">
<header>
<button type="action" name="%(estate.action_open_offer)d" string="Offer"
icon="fa-money" class="oe_stat_button">
<field name="offer_count" class="oe_stat_button"
string="Offers Count" /> Offers </button>
</header>
</div>

Choose a reason for hiding this comment

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

Suggested change
<div class="d-flex justify-content-end">
<header>
<button type="action" name="%(estate.action_open_offer)d" string="Offer"
icon="fa-money" class="oe_stat_button">
<field name="offer_count" class="oe_stat_button"
string="Offers Count" /> Offers </button>
</header>
</div>
<div name="button_box">
<button class="oe_stat_button" type="action" name="%(estate.action_open_offer)d"
icon="fa-ticket">
<field string="Offers" name="offer_count" widget="statinfo"/>
</button>
</div>

You can do something like this for better align ments of stat button

feat(real_estate): Implement robust access control mechanisms for enhanced
security.

This commit introduces a refined access control system to the Real Estate
module, ensuring data protection and appropriate user permissions. It includes:

Granular access rights for different user groups, controlling actions like
property creation, modification, and deletion.

Clear separation of responsibilities between salespersons and managers, limiting
access based on roles.

Integration with Odoo's existing security features to leverage established
access control mechanisms.
@AntoineVDV AntoineVDV closed this Sep 30, 2024
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