Skip to content

[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

Draft
wants to merge 3 commits into
base: 18.0
Choose a base branch
from

Conversation

jcha-odoo
Copy link

@jcha-odoo jcha-odoo commented Jul 24, 2025

🏡 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

  • 📖 Complete 15-chapter tutorial covering Odoo server framework fundamentals
  • 🏠 Property, offers, property types, and tags management with intuitive UI
  • 💰 New estate_account module automating invoice creation on property sales
  • 🔒 Enhanced business logic enforcing data validation and workflow automation
  • 🎨 UI improvements: status bars, action buttons, filters, and default ordering
  • 🧹 Refactored codebase adhering to Odoo coding standards with detailed documentation

🎯 High-Level Functionality

  • 🏢 Manage real estate properties with full lifecycle states (new, offer received, sold, canceled)
  • 🤝 Handle offers including acceptance/refusal, automatically updating property details
  • 🏷️ Organize properties using types and tags with color coding and sequencing
  • 🧾 Seamlessly generate accounting invoices linked to property sales
  • 🖥️ Improve user experience with better navigation, filtering, and interactive UI elements

📚 Technical Concepts Covered

  • 🏗️ Odoo architecture and core server components
  • 🧩 Model creation, field definitions (including computed and onchange fields)
  • 🔍 ORM operations: searches, domain filters, create/write/unlink
  • 🧬 Model inheritance and extension patterns
  • 🖼️ Views: form, tree, search, and dynamic UI widgets
  • 🌐 Controllers and HTTP routing
  • 🔐 Security implementation with access control lists (ACLs) and record rules
  • 🗂️ Actions, menus, and translations (internationalization)
  • 🧪 Unit testing setup and writing tests
  • 📄 Reporting creation and module packaging/deployment

@robodoo
Copy link

robodoo commented Jul 24, 2025

Pull request status dashboard

Copy link

@bit-odoo bit-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,
Can you please adapt your commit title according to guideline.

'name': "Real Estate",
'version': '1.0',
'depends': ['base'],
'author': "Jay Chauhan",

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.

_name = 'estate.property'
_description = 'Estate Property'

# Title of the property (required)

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.

@@ -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

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.

Comment on lines 9 to 23
<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" />

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.

@jcha-odoo jcha-odoo force-pushed the 18.0-tutorials-jcha branch 2 times, most recently from 2fe6a7a to 9ac4d89 Compare July 29, 2025 12:43
Copy link

@bit-odoo bit-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,Your commit message and header is still not as per guideline.

# -----------------------------
# SQL Constraints
# -----------------------------
_sql_constraints = [
Copy link

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':
Copy link

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':
Copy link

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.

Copy link
Author

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.

Comment on lines 113 to 115
record.property_id.state = 'offer_accepted'
record.property_id.selling_price = record.price
record.property_id.buyer_id = record.partner_id
Copy link

Choose a reason for hiding this comment

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

You can use .write().

</menuitem>
</menuitem>
</data>
</odoo>
Copy link

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>
Copy link

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>
Copy link

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.

mattosgood and others added 3 commits August 4, 2025 18:16
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
@jcha-odoo jcha-odoo force-pushed the 18.0-tutorials-jcha branch from 0eeb68c to b2cbb43 Compare August 4, 2025 12:50
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.

4 participants