-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ADD] real_estate : add real estate property and create invoice #845
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
base: 18.0
Are you sure you want to change the base?
Conversation
one model created real estate and display in app. one table created for estate property in database with dome database . variable of table like name, description, date etc.
first i add data with csv file in module and after that with xml file code i add data that display on frontend in list view and form view both also disable selling price so anyone cannot change it
…or property implement Sold and Cancel button in estate property with validation add offer option in property with accept and refused button automatic update selling price when buyer accept offer only one buyer can accept one offer through validation
…or offers Added stat button on property type to show related offers with domain filtering Applied decorations on offer and property list views for status indication Made 'offer' and 'tag' list views editable and added optional availability field Set default filter for 'Available' properties, improved living area search logic
…ritance Added logic to create a customer invoice when a property is marked as Sold Invoice includes 6% commission and ₹100 administrative fees Display property in user which buy by them only can delete property if it is in new or cancelled state
fixed check style and tutorial changes in estate_account and estate_property
improve code and change file name according to guidelines rename model name same as the record name
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.
Here is the review!
Some comments:
Follow commit message guidelines. This tool can be helpful.
- Last 2 Commits are useless you should use commit amend and fix it in the original commit.
- Commit messages should be objective, concise, and written in the third person, focusing on what was changed rather that who did it or how. eg: phrases like: "I added...", "I did...", "First I did X, then I did Y", etc should be avoided.
- Can you have a look at linting in all your files. I see too many linting issues.
real_estate/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
from . import models |
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 always add a EOL in each file so that when someone adds lines in the future, the last line of the previous devs is not in the diff. Also github shows a red marker for it.
'name': 'real_estate', | ||
'depends': [ | ||
'base_setup', | ||
], |
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.
Shouldn't the dependency be base
. Also Linting.
You change from base_setup
to base
in commit 2 better to use base from commit 1 itself.
@@ -0,0 +1,28 @@ | |||
|
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.
Unnecessary empty line.
|
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_description = "Estate" |
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.
Description could be little better. How about "Real Estate Property".
from odoo import fields, models | ||
|
||
class EstateProperty(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.
Module is named real_estate
, but model is estate.property
. It's better to be consistent either both should use real_estate
as prefix or stick to "Estate" as name.
@@ -0,0 +1,48 @@ | |||
from odoo import models, fields, api |
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.
Sort them alphabetically.
real_estate/view/estate_menus.xml
Outdated
<!-- Action Menu --> | ||
<menuitem id="menu_estate_property_action" action="action_estate_property" parent="menu_real_estate_properties"/> | ||
|
||
<menuitem id="setting" |
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.
Linting.
@api.depends('living_area', 'garden_area') | ||
def _compute_total_area(self): | ||
for record in self: | ||
record.total_area = (record.living_area or 0.0) + (record.garden_area or 0.0) | ||
|
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.
Unnecessary diffs, better to keep these empty lines.
property_type_id = fields.Many2one( | ||
related="property_id.property_type_id", | ||
store=True, | ||
readonly=True | ||
) |
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.
What will be the co-model for this?
if not record.selling_price: | ||
raise UserError("Please set a Selling Price before generating an invoice.") | ||
|
||
journal = self.env['account.journal'].search([('type', '=', 'sale')], limit=1) |
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.
This should be moved outside of for loop. Can you tell me the reason why?
firstly create real_estate module and add estate property in property module, add offers in property and also sales person and buyer name .
add business logic to validate offer amount, compute deadline and manage status.
generate invoice when successful sale property and also show in buyer(user) profile