-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 new real estate module #108
base: 17.0
Are you sure you want to change the base?
Conversation
Creating new module: -model: estate.property with fields such as name bedrooms,living_area,facades,state -views: Tree and Form views of estate properties. -security: Access Right define in ir.model.access.csv file.
f7ddd46
to
7527972
Compare
The new module includes : -Includes relationship between model -Creating many_to_one relations in estate.property.type model -Creating many_to_many relations in estate.property.tag model -Creating one_to many relations in estate.property.offer model
7527972
to
96fdd78
Compare
Button & Action -Creating two button cancelled and sold -Initialize action for both the buttons -Added functionality cancelled property can not be sold and and sold property can not be cancelled -Created two button for offer accepted and refused through the icon and added functionality on it, if click on refused icon then my offer status is refused and click on accepted icon status will accepted. End here chapter 9 Sql constraints & Python constrains -Added functionality for expected price,offer price and selling price must be positive and property_tag_name and property_type_name must be unique through the _sql_constraints and using of unique keyword -Add a constraint so that the selling price cannot be lower than 90% of the expected price using of python_constrains and showing error using of ValidationError .
59ff321
to
5c399ff
Compare
-Add the property type form view and showing all the property of this type -Using of widgets creating statusbar to display state of the property -Creating a record to view "estate.property" to Descending ID -Creating a record to view "estate.property.offer" to Descending price -Add the sequence -Creating conditional display of buttons and fields -Add tag colors -Creating garden_area and orientation invisible -Adding colour to accept and refuse button -Creating offer is readonly when offer in sold,accept,cancel state -Create the estate.property.offer and estate.property.tag list views editable. -Create the field date_availability on the estate.property list view optional and hidden by default. -Adding available filter by-default -Add a filter_domain to the living area to include properties with an area equal to or greater than the given value. -Add state button for property type offer
5c399ff
to
947622a
Compare
…t model Add business logic and view inheritance for real estate module - Prevent deletion of properties not in 'New' or 'Canceled' state using `ondelete`. - Set property state to 'Offer Received' on offer creation and prevent creating offers with lower amounts than existing ones. - Add `property_ids` field to `res.users` model to list salesperson’s available properties. - Extend `base.view_users_form` to display `property_ids` in a new notebook page.
71d6d84
to
5e7c24a
Compare
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 @krku-odoo
I have added a few remarks and a couple of suggestions.
Can you please have a look?
Thanks!!
estate/models/estate_property.py
Outdated
else: | ||
record.best_offer = 0.0 | ||
|
||
_sql_constraints = [ |
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.
Generally, we define SQL constraints just after the field declarations.
estate/models/property_offer.py
Outdated
from odoo import api, models, fields | ||
from dateutil.relativedelta import relativedelta |
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 dateutil.relativedelta import relativedelta | |
from odoo import api, fields, model |
We follows a convention in which we first import the external libraries and then imports from odoo in alphabetically order.
estate/models/property_offer.py
Outdated
if record.property_id.create_date and record.deadline_date: | ||
flag = fields.Date.from_string(record.deadline_date) | ||
flag1 = fields.Date.from_string(record.property_id.create_date) | ||
if flag and flag1: | ||
record.validity = (flag - flag1).days | ||
else: | ||
record.validity = 7 | ||
else: | ||
record.validity = 7 |
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.property_id.create_date and record.deadline_date: | |
flag = fields.Date.from_string(record.deadline_date) | |
flag1 = fields.Date.from_string(record.property_id.create_date) | |
if flag and flag1: | |
record.validity = (flag - flag1).days | |
else: | |
record.validity = 7 | |
else: | |
record.validity = 7 | |
record.validity = (record.deadline_date - record.property_id.create_date.date()).days |
I think we can simplify it But make sure to check all the cases working fine.
estate/views/res_users_view.xml
Outdated
</record> | ||
|
||
</data> | ||
</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 blank line at EOF check for other files as well
if record.property_id.create_date: | ||
record.deadline_date = record.property_id.create_date + relativedelta( | ||
days=record.validity | ||
) | ||
else: | ||
record.deadline_date = False |
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.property_id.create_date: | |
record.deadline_date = record.property_id.create_date + relativedelta( | |
days=record.validity | |
) | |
else: | |
record.deadline_date = False | |
record.deadline_date = record.property_id.create_date + relativedelta( | |
days=record.validity | |
) |
estate/models/property_offer.py
Outdated
property_id = vals.get("property_id") | ||
property_users = self.env["estate_property"].browse(property_id) |
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.
property_id = vals.get("property_id") | |
property_users = self.env["estate_property"].browse(property_id) | |
property = self.env["estate_property"].browse(vals.get("property_id")) |
<field name="view_mode"> | ||
tree,form | ||
</field> | ||
<field name="domain"> | ||
[('property_type_id', '=', active_id)] | ||
</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.
<field name="view_mode"> | |
tree,form | |
</field> | |
<field name="domain"> | |
[('property_type_id', '=', active_id)] | |
</field> | |
<field name="view_mode">tree,form</field> | |
<field name="domain">[('property_type_id', '=', active_id)]</field> |
Check in other files also
<button type="action" name="%(estate.estate_property_offer_action)d" string="Offers" class="oe_stat_button" icon="fa-ticket"> | ||
<div class="o_stat_info"> | ||
<field name="offer_count" widget="statinfo" string="" /> | ||
<span class="o_stat_text">Offer</span> | ||
</div> | ||
</button> |
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.
<button type="action" name="%(estate.estate_property_offer_action)d" string="Offers" class="oe_stat_button" icon="fa-ticket"> | |
<div class="o_stat_info"> | |
<field name="offer_count" widget="statinfo" string="" /> | |
<span class="o_stat_text">Offer</span> | |
</div> | |
</button> | |
<div name="button_box"> | |
<button class="oe_stat_button" type="action" name="%(estate.estate_property_offer_action)d" | |
icon="fa-ticket"> | |
<field string="Offers" name="offer_count" widget="statinfo"/> | |
</button> | |
</div> |
we can do something like this to properly format the stat button.
estate/models/estate_property.py
Outdated
|
||
|
||
class MyModel(models.Model): | ||
_name = "estate_property" |
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.
_name = "estate_property" | |
_name = "estate.property" |
Modify the model name as per the convention.
feat(estate_account): Implement invoice creation on property sale - Created `estate_account` module, dependent on `estate` and `account` modules. - Added logic in `estate.property` model to generate a customer invoice when a property is marked as 'Sold'. - The invoice includes: - A line charging 6% of the property's selling price. - A line charging an additional .00 as administrative fees. Completed chapter till Chapter-13
2f35263
to
250a74b
Compare
Add minimal Kanban view for properties in real estate module - Created a basic Kanban view displaying property names. - Improved the view to conditionally show 'best price' and 'selling price' based on offer status. - Added fields: expected price, best price, selling price, and tags. - Grouped properties by type by default and disabled drag-and-drop functionality.
- Added master data for standard Real Estate Property Types: Residential, Commercial, Industrial, and Land. - Added demo data for the estate module, including properties like Big Villa and Trailer Home - Created demo data for offers linked to demo properties using existing partners. - Ensured that demo properties have their Property Type set to Residential. - Added date handling for demo offers to be relative to the module installation date. - Utilized `Command` methods to create offers directly within the One2many field of a new property. - Implemented data extension examples for XML-based record updates.
- Implemented a property offers PDF report using QWeb templates. - Created `estate_property_templates.xml` to define the report template for displaying property offers. - Added `estate_property_reports.xml` for the ir.actions.report to include the report in the module's business logic. - Enhanced the report by adding logic to conditionally handle cases with no offers using `t-if` and `t-else`. - Introduced a sub-template to separate the table portion of the offers, promoting code reuse. - Created a new report for `res.users` to list all the Real Estate Properties for a salesperson, including property offers. - Extended the property report in the `estate_account` module to include invoice information for sold properties using QWeb inheritance. Files Added: - `estate/report/estate_property_templates.xml` - `estate/report/estate_property_reports.xml` - Updated `__manifest__.py` to include the new report files in the module's data list.
4097231
to
b8dcd5b
Compare
*Add 'Properties' menu to list available properties with images and pagination on website using of controller. - Created a 'Properties' menu on the website to display available properties in a grid. - Added image support for properties and displayed them on the front end. - Implemented pagination to display a maximum of 6 properties per page. - Created a dedicated, responsive property detail page using Bootstrap. *Add 'Add Offer' wizard to Real Estate module for bulk offer creation - Added 'Add Offer' button to the estate property tree view header. - Implemented wizard for selecting multiple properties to make an offer. - Wizard includes fields for price, validity, and buyer details. - Added 'Make an Offer' and 'Cancel' buttons to handle business logic and cancellation. *Implement security restrictions for Real Estate module - Created security.xml file to define security groups and access rights. - Added Real Estate Agent and Manager groups with appropriate access levels. - Set access rights: full access for Managers, limited access for Agents, and r estricted access for non-agents. - Defined record rules to restrict access to properties based on the agent assigned. - Implemented bypass for invoice creation security checks in estate_account module using `sudo()`. - Added company-based record rules for multi-company security management. - Restricted Settings menu visibility to Managers only.
b8dcd5b
to
3c09613
Compare
- Created different models for this: dental.patients, dental.allergies, dental.habits, dental.chronic.condition, dental.medical.aids, dental.medication - Created appropriate views file for all of the models - Added security file: ir.model.access.csv
- ADD the invoice - Visible on Website - Create form view for patient -Create customer history
-Create Controller -Show the the list of patient -Redirect medical aid and personal and medical history to the form view of these
0ba8db8
to
44a3499
Compare
-Create breadcrumb to all the route -Create form view for Medical Aid and Personal -Create list view for Medical History and Dental History -Create form view of each Dental History
15cf972
to
550b9d0
Compare
Create Installment For sales Order -create setting for installment -create a button add emi to inherit sale order form view -creating product to sale order down payment and installment - show the wizard to all fields and calculate all value according to installment -create invoice for penalty with installment amount using cron -create document for installment and generate file request for sales.order
-Created new model waranty feture for sale order -Create delete functionality for sale.order.line -Create wizard for show to product which is sale.order.line and show the year end_date
ec6c3f8
to
7dec18a
Compare
- Introduced warranty management in the Sales Order (SO) process. - Updated system to handle warranty details for products. - Enhanced customer communication for warranty information. - Added flow for tracking warranty terms post-sale.
7dec18a
to
335e94c
Compare
-Create end date create in report
Training adding the estate module