-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
9d9bc7d
to
113c347
Compare
…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.
113c347
to
2bbbbe9
Compare
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.
f44c91d
to
8d72692
Compare
…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.
d8aa279
to
a3a7461
Compare
…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.
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 @span-odoo
Some comments mostly regarding the guidelines and coding conventions.
Can you please check.
Thanks!!
estate/views/estate_menu.xml
Outdated
</menuitem> | ||
</menuitem> | ||
|
||
</odoo> |
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.
Need a new line at EOF.
Please check other files also
<!-- 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> --> |
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.
Try to avoid pushing the commented code
estate/models/estate_property.py
Outdated
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.") |
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.
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
estate/models/estate_property.py
Outdated
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." | ||
) |
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.
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": |
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.
Try same as above
if record.create_date: | ||
pass |
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.
try to avoid using pass
estate/models/estate_property.py
Outdated
from odoo import api, models, fields | ||
from dateutil.relativedelta import relativedelta | ||
from odoo.exceptions import UserError, ValidationError |
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.
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
<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> |
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.
<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.
…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.