-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[ADD] estate: created a platform for customers to sell and buy properties. #212
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
Conversation
Created a new module named Estate. Completed till the basic ui of the module.
Created relational models, Computed fields, and On Changes. Completed 8 modules out of 15.
Cleaned the code according to the coding standards Completed 8 modules out of 15.
Completed the module along with the coding standards
When trying to delete a property, there was a validation issue which is resolved in this commit. Cleaned the code according to the coding conventions.
Made changes in the estate property schema as well
Implemented access rules for the users. Added a new field named company_id in the estate property model.
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,
I have added a few changes. Can you please have a look?
@@ -0,0 +1,15 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<odoo> | |||
<record id="estate_property_type_id1" model="estate.property.type"> |
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 give proper names. Avoid _id1
estate/models/__init__.py
Outdated
from . import estate_property_type | ||
from . import estate_property_tags | ||
from . import estate_property_offer |
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.
Arrange in alphabetical order
user_id = fields.Many2one( | ||
"res.users", | ||
string="Salesperson", | ||
index=True, | ||
tracking=True, | ||
default=lambda self: self.env.user, | ||
) |
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.
Use proper formatting
estate/models/estate_property.py
Outdated
garden_orientation = fields.Selection( | ||
[("north", "North"), ("south", "South"), ("east", "East"), ("west", "West")], | ||
"Garden Orientation" | ||
) | ||
state = fields.Selection( | ||
[ | ||
("new", "New"), | ||
("offer_received", "Offer Received"), | ||
("offer_accepted", "Offer Accepted"), | ||
("sold", "Sold"), | ||
("cancelled", "Cancelled"), | ||
], | ||
default="new", | ||
) |
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.
Use proper formatting
_sql_constraints = [ | ||
( | ||
"check_expected_price", | ||
"CHECK(expected_price >= 0)", | ||
"A property expected price must be strictly positive", | ||
), | ||
( | ||
"check_selling_price", | ||
"CHECK(selling_price >= 0)", | ||
"A property selling price must be positive", | ||
), | ||
] |
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.
Use proper formatting
"You cannot delete a property that is not in New or Cancelled state." | ||
) | ||
|
||
def action_change_state(self): |
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 have separate functions
|
||
@api.model | ||
def create(self, vals): | ||
property_id = vals.get("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.
This wont work if multiple records are created. i.e. getting list of dict in vals
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.
We don't have the functionality to add multiple offers for one property at a time, so do we need to implement this in our module?
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.
but what if someone creates property by importing a file that has multiple offers
estate/security/ir.model.access.csv
Outdated
1,access_estate_property,model_estate_property,estate.estate_group_manager,1,1,1,1 | ||
2,access_estate_property_type,model_estate_property_type,estate.estate_group_manager,1,1,1,1 | ||
3,access_estate_property_tags,model_estate_property_tags,estate.estate_group_manager,1,1,1,1 | ||
4,access_estate_property_offer,model_estate_property_offer,estate.estate_group_manager,1,1,1,1 | ||
5,access_estate_property,model_estate_property,estate.estate_group_user,1,1,1,0 | ||
6,access_estate_property_type,model_estate_property_type,estate.estate_group_user,1,0,0,0 | ||
7,access_estate_property_tags,model_estate_property_tags,estate.estate_group_user,1,0,0,0 | ||
8,access_estate_property_offer,model_estate_property_offer,estate.estate_group_user,1,1,1,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.
ids as 1,2,3?
Refer codebase and correct it
</list> | ||
</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.
Remove extra space
<field name="res_model">estate.property</field> | ||
<field name="view_mode">list,form,kanban</field> | ||
<field name="context">{'search_default_active': True, 'search_default_current': True}</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.
add a blank line here
… and users. This commit includes: 1) Implementation of a wizard to add a single offer to multiple properties. 2) Download reports for multiple properties and users. 3) Code cleaning according to the coding conventions.
Features added: 1) User can create their WhatsApp templates. 2) A WhatsApp message will be sent to the buyer when the property is sold.
Specification: 1) Different warranty configurations can be created. Example- 1 year, 2 year. 2) Warranty can be added for products in the sales order.
fe5c060
to
ad69395
Compare
What I have fixed: 1) If the user deletes the product from the sale order line, the attached warranty will also be deleted. 2) If a product is attached with a warranty it will not show in the wizard list.
38c55c0
to
1cba226
Compare
Changes made: 1) removed the wizard_id field as there was a pre-created field in the sale order line i.e. linked_line_id.
Before this commit: The warranty was not being deleted on the click of the delete button for the sale order line or related product. After This commit: The warranty is deleted on the click of the delete button for the sale order line or related product.
Created a new module named Estate.