-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ADD] training: add Real Estate root menu with Advertisements submenu #890
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
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,
Can you please adapt your commit title according to guideline.
estate/__manifest__.py
Outdated
'name': "Real Estate", | ||
'version': '1.0', | ||
'depends': ['base'], | ||
'author': "Jay Chauhan", |
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.
Follow the one style (single quote) through files. Do not mix single quotes and double quotes.
estate/models/estate_property.py
Outdated
_name = 'estate.property' | ||
_description = 'Estate Property' | ||
|
||
# Title of the property (required) |
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.
Writing a comment is good, but no need to write it for every single line. we can add comment on important line or on complex function to help other to easily understand.
estate/security/ir.model.access.csv
Outdated
@@ -0,0 +1,2 @@ | |||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | |||
estate.property,estate.ir.model.access,model_estate_property,base.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.
Should be one empty line.
<field name="name" /> | ||
<field name="description" /> | ||
<field name="postcode" /> | ||
<field name="date_availability" /> | ||
<field name="expected_price" /> | ||
<field name="selling_price" /> | ||
<field name="bedrooms" /> | ||
<field name="living_area" /> | ||
<field name="facades" /> | ||
<field name="garage" /> | ||
<field name="garden" /> | ||
<field name="garden_area" /> | ||
<field name="garden_orientation" /> | ||
<field name="state" /> | ||
<field name="active" /> |
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.
You don't need to display all fields in list view. You can use the optional. So the user can add fields that he/she need.
2fe6a7a
to
9ac4d89
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,Your commit message and header is still not as per guideline.
estate/models/estate_property.py
Outdated
# ----------------------------- | ||
# SQL Constraints | ||
# ----------------------------- | ||
_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.
Avoid writing SQL constraints between field declarations.
def action_sold(self): | ||
"""Set property state to 'sold', with validation against invalid states.""" | ||
for record in self: | ||
if record.state == 'cancelled': |
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 if there is no offer available?
for record in self: | ||
if record.state == 'sold': | ||
raise UserError('A sold property cannot be cancelled.') | ||
elif record.state == 'cancelled': |
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.
Does this condition require? Because you are hiding the 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.
Yes but it is added so that even if the function is called explicitly from somewhere else, it still checks for constraints.
record.property_id.state = 'offer_accepted' | ||
record.property_id.selling_price = record.price | ||
record.property_id.buyer_id = record.partner_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.
You can use .write().
estate/views/estate_menu.xml
Outdated
</menuitem> | ||
</menuitem> | ||
</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.
Should be one empty line at end of the file.
<field name="view_mode">list,form</field> | ||
</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.
Should be one empty line at end of the file.
<field name="view_mode">list,form</field> | ||
</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.
Should be one empty line at end of the file.
This commit adds the complete tutorial "Server Framework 101" covering: - Chapter 1: Odoo architecture overview and components - Chapter 2: Creating and using models - Chapter 3: Defining and working with fields - Chapter 4: Using the ORM for data manipulation - Chapter 5: Accessing and modifying data with domains and contexts - Chapter 6: Model inheritance and extension - Chapter 7: Onchange and computed fields - Chapter 8: Working with views (form, tree, search) - Chapter 9: Creating controllers and routing - Chapter 10: Implementing security (access control, record rules) - Chapter 11: Using actions and menus - Chapter 12: Working with translations and internationalization - Chapter 13: Testing (unit tests, environment setup) - Chapter 14: Creating reports - Chapter 15: Deploying and packaging modules This tutorial provides a walkthrough of Odoo server-side development concepts.
- Implement basic Owl components and setup as per official tutorial - Add Counter component with reactive state management - Configure assets bundle and QWeb templates for frontend rendering - Setup route and controller for standalone Owl playground - Follow tutorial steps for mounting and updating components dynamically This commit reflects learning and code progress from https://www.odoo.com/documentation/18.0/developer/tutorials/discover_js_framework/01_owl_components.html#section-8
… cancel, add missing eod
0eeb68c
to
b2cbb43
Compare
🏡 Estate Module: Complete Server Framework 101 Tutorial Integration + Enhancements 📚✨
This PR integrates the entire Server Framework 101 tutorial into the Estate module, providing a practical, end-to-end learning experience embedded within a real-world Odoo application. It also introduces new features and improvements to Estate’s property and offer management workflows.
🚀 Features
estate_account
module automating invoice creation on property sales🎯 High-Level Functionality
📚 Technical Concepts Covered