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: Created Real Estate Application #111

Draft
wants to merge 18 commits into
base: 17.0
Choose a base branch
from

Conversation

akpu-odoo
Copy link

Real Estate Module for training

Enhanced estate_property model by adding new fields and applying constraints as
outlined in the chapters. Configured required fields, default values, and
non-copyable settings to ensure data integrity and proper functionality. Added
some views specified in the chapters.
Enhanced estate_property model by adding new fields and applying constraints as
outlined in the chapters. Configured required fields, default values, and
non-copyable settings to ensure data integrity and proper functionality. Added
some views specified in the chapters
Enhanced estate_property model by adding new fields and applying constraints as
outlined in the chapters. Configured required fields, default values, and
non-copyable settings to ensure data integrity and proper functionality. Added
some views specified in the chapters
- Added relational fields:
  - `EstateProperty` has a One2many relationship with `EstatePropertyOffer`.
  - `EstatePropertyOffer` has a Many2one relationship with `EstateProperty`.
  -  Implemented a Many2many relationship between `EstateProperty`
- Added computed fields `deadline_date` and `validity` with proper compute and
  inverse methods. `deadline_date` and `created_date`.
- Added `onchange` method to dynamically update fields based on user input.
- Added action button in the view
  - Resets the property's buyer and selling price if the offer is rejected by
    the buyer.
  - Raises `UserError` if the offer cannot be rejected.
- Ensured that the `EstateProperty` model has the `buyer_id` and `selling_price`
  fields.
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 @akpu-odoo

Added few remarks primarily related to guidelines for cleaning up the code.
Beside this the checkstyle of runbot is also failing due to linting issue Can you please resolve that also.

Thanks

'license': 'LGPL-3',

'summary': "Starting module for Real Estate Business model",

Choose a reason for hiding this comment

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

No need for the blank lines here.

@@ -0,0 +1,15 @@
from odoo import fields, models

Choose a reason for hiding this comment

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

Generally, between imports and declaration of class, we give two blank lines.

('unique_property_tag','unique(name)','The property tag should be unique')
]


Choose a reason for hiding this comment

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

No need for these blank lines here Also we give only one blank line when we start declaring fields after defining the model attributes.

else:
raise UserError("You cannot reject this offer")
# def action_refuse(self):
# if self.property_id.buyer == self.property_id:

Choose a reason for hiding this comment

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

Avoid pushing the commented code if you require some code for future purposes probably you could stash them or make a patch file to use them.

</record>


</odoo>

Choose a reason for hiding this comment

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

Make sure to add the blank lines at the end of the file.

@@ -0,0 +1,107 @@
from odoo import fields, models ,api
from datetime import datetime, timedelta

Choose a reason for hiding this comment

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

External libraries are imported first before the import of odoo.

property_id = fields.Many2one('estate.property', required=True)
validity = fields.Integer(default=7)
deadline_date = fields.Date(compute="_compute_validity", inverse="_inverse_validity",store=True)
created_date = fields.Date(default=lambda self: datetime.today())

Choose a reason for hiding this comment

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

Suggested change
created_date = fields.Date(default=lambda self: datetime.today())
create_date = fields.Date(default=lambda self: datetime.today())

I think we can override the existing create_date field here instead a new field.

@api.depends("validity", "created_date")
def _compute_validity(self):
for record in self:
if record.created_date:

Choose a reason for hiding this comment

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

As we are providing the default value in the field so I think there is no need for this extra check

else:
record.deadline_date = False

@api.depends("created_date", "deadline_date")

Choose a reason for hiding this comment

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

No need for this i think we can keep the generic behavior of inverse method that reflects the changes after saving the records in our usecase.

record.best_offer = 0

@api.onchange("garden")
def _onchange_(self):
Copy link

@adsh-odoo adsh-odoo Aug 12, 2024

Choose a reason for hiding this comment

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

Give the method name as per the use cases and try avoiding the generic keywords.

- Added relational fields
- Added Tree View for Property Offers
- Connected Property Types and Property Offers with Relational Models
-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.

Completed chapter till Demo Data.

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.
-Extended the property report in the estate_account module to include
invoice information for sold properties using QWeb inheritance.y Types and
Property Offers with Relational Models
-Web Controllers: Implemented new web controllers to handle property-related HTTP
 requests, enhancing the web functionality of the estate module.
-Wizard Implementation: Introduced a wizard to streamline the process of creating
 and assigning offers to multiple properties simultaneously.
-Web Controllers: Implemented new web controllers to handle property-related HTTP
 requests, enhancing the web functionality of the estate module.
-Wizard Implementation: Introduced a wizard to streamline the process of creating
 and assigning offers to multiple properties simultaneously.
-Web Controllers: Implemented new web controllers to handle property-related
HTTP requests, enhancing the web functionality of the estate module.
-Wizard Implementation: Introduced a wizard to streamline the process of
creating and assigning offers to multiple properties simultaneously.
-Fixed some linting issues
-Created Agent and Manger
-Implemented the Access Right to Agent and Manager
-Created Agent and Manger
-Implemented the Access Right to Agent and Manager
- Added new module make meeting
- created a new meeting function to add event to calendar
 - Added new module make meeting
- created a new meeting function to add event to calendar
- Created Models in the module as per given instructions
- Created some Actions and views in the module
- Added Invoicing and reports to in the module
- Added sequencing in the tree view of all models
- Added some models as per given instructions
- Added controller in the module as per given task
   - patient details page
- Designed the overall ui of module
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.

2 participants