[ADD] estate: property model with fields, views, and menu access#1177
[ADD] estate: property model with fields, views, and menu access#1177karimgamaleldin wants to merge 16 commits intoodoo:19.0from
Conversation
karimgamaleldin
commented
Feb 16, 2026
- Add estate_property model with fields
- Add active field with default True
- Set date_availability default to 3 months from today
- Create list, form, and search views for estate.property
- Add search filters and group by postcode
- Configure access rights in ir.model.access.csv
blse-odoo
left a comment
There was a problem hiding this comment.
This looks good. Could you make one commit per chapter, to make it easier to review?
blse-odoo
left a comment
There was a problem hiding this comment.
👍
I noticed you always used the [ADD] tag in the commit, you can check out the git guidelines to see the other ones (ADD should be used for commits that new modules)
92cca54 to
eb83670
Compare
Thanks for pointing that out. I’ve updated the commit tags accordingly. I initially thought [ADD] was equivalent to feat: in Conventional Commits, but I understand now that [ADD] should only be used when introducing new modules. I’ll follow the git guidelines more closely going forward. |
eb83670 to
d0697ba
Compare
|
I can't try the current version, there is some error when I start the server with an empty database. Could you have a look? |
d0697ba to
3cd43d1
Compare
I created a completely new database from scratch and started the server, and I’m not seeing any errors on my side. Everything starts correctly. Could you please send me the exact error message you're getting when starting with an empty database? That will help me investigate further. |
|
The runbot encounters the same error, you can look at the logs for the "ci/tutorial" (or we can have a look together tomorrow) |
3cd43d1 to
2970fb6
Compare
8490d5b to
cf55aac
Compare
5641507 to
7f3667a
Compare
- Add estate_property model with fields - Add active field with default True - Set date_availability default to 3 months from today - Create list, form, and search views for estate.property - Add search filters and group by postcode - Configure access rights in ir.model.access.csv
* Add estate.property.type model with form view and Settings menu * Add estate.property.tag model with form view and Settings menu * Add estate.property.offer model with form/list views for tracking offers * Update estate.property model with: - property_type_id: Many2one relation to property types - tag_ids: Many2many relation to property tags - offer_ids: One2many relation to offers - buyer_id and salesperson_id fields * Update property form view to display tags, type, offers, buyer, and salesperson * Reorganize menus: Advertisements and Settings submenus * Add security access rules for all new models
* estate.property: - Add total_area computed field (living_area + garden_area) - Add best_offer computed field (max of offer prices) - Add onchange method for garden field to auto-populate garden_area and orientation * estate.property.offer: - Add validity field (days, default 7) - Add date_deadline computed field based on create_date + validity - Add inverse method to update validity when deadline is changed * Update views to display new computed fields (total_area, best_offer) * Update offer views to include validity and date_deadline fields
* estate.property:
- Add action_set_sold() method to mark property as sold
- Add action_cancel() method to cancel property
- Add validation: prevent selling canceled properties
- Add validation: prevent canceling sold properties
* estate.property.offer:
- Add accept_offer() method: sets status to accepted, updates selling price,
property state, and buyer
- Add refuse_offer() method: sets status to refused, updates property state
* Update views:
- Add "Mark as Sold" and "Cancel" buttons to property form header
- Add accept/refuse buttons (icons) to offer list view
* estate.property: - Add SQL constraint: expected_price must be strictly positive - Add SQL constraint: selling_price must be non-negative - Add Python constraint: selling_price must be >= 90% of expected_price * estate.property.offer: - Add SQL constraint: offer price must be strictly positive * estate.property.tag: - Add SQL constraint: tag name must be unique * estate.property.type: - Add SQL constraint: property type name must be unique
The default argument for date_availability was evaluating get_date_in_3_months() at module load time rather than at record creation time. WHY: This caused all properties created after the module was loaded to share the same availability date. For example, if the database started on 01/01 and get_date_in_3_months() returned 01/04, any property created days or weeks later (e.g., on 17/01) would still have 01/04 as the default date instead of the correct date relative to when the record was created. WHAT: Wrapped the function call in a lambda to defer evaluation until record creation time. Changed from `default=get_date_in_3_months()` to `default=lambda self: get_date_in_3_months()`, ensuring each new property gets a correctly computed availability date based on its creation time.
Ensures all files end with a newline character as per PEP8 and standard coding conventions.
The Python constraint method `_check_selling_price` and SQL constraints shared similar names or were ambiguous, making it difficult to distinguish between them and understand their specific purposes. This commit renames: - The Python constraint to `_check_selling_price_vs_expected_price` to better describe the 90% validation logic. - The SQL constraints to `_check_expected_price_pos` and `_check_selling_price_pos` to explicitly indicate they enforce positive values.
Previously, it was possible to accept multiple offers for the same property. This commit adds a validation check in the `accept_offer` method. Now, if a user attempts to accept an offer for a property that already has an accepted offer, a UserError is raised to block the action.
7f3667a to
b63c964
Compare
Enhance the user experience for the real estate module by adding advanced search capabilities and quick navigation. - Add One2many field property_ids to the estate.property.type model and display it in the estate.property.type form view - Add a statusbar widget to display the state for each estate.property - Add default model ordering for estate.property (ID desc), estate.property.offer (price desc), estate.property.tag (name) and estate.property.type (sequence, name) - Add manual ordering for estate.property.type by adding a sequence field and use the handle widget to allow the user to reorder - Add color field to estate.property.tag model and the color picker widget to choose the color - Add invisible attribute to Sold and Cancel header buttons depending on the property state - Add constraint to prevent adding offers when property state is offer_accepted, sold or cancelled - Add invisible attribute to Accept and Refuse buttons when the offer status is already set - Add invisible attribute to garden_area and garden_orientation fields when garden is False on estate.property - Add editable attribute to estate.property.offer and estate.property.tag list views - Add optional and invisible by default attribute to date_availability field on the estate.property list view - Add green decoration for properties with an offer received, green and bold for offer accepted and muted for sold on the estate.property list view - Add red decoration for refused offers and green for accepted offers and add invisible attribute to the status field on the estate.property.offer list view - Add available filter selected by default on the estate.property search view via search_default_available context - Add filter_domain on living_area search field to include properties with an area equal to or greater than the given value - Add property_type_id as a stored related field on estate.property.offer pointing to property_id.property_type_id - Add offer_ids One2many field on estate.property.type as the inverse of property_type_id on estate.property.offer - Add offer_count computed field on estate.property.type that counts the number of offers using offer_ids - Add stat button on estate.property.type form view displaying offer_count with a cash icon, hidden when no offers exist - Add estate.property.offer action with a domain filtering offers by property_type_id equal to active_id and link it to the stat button
- Remove trailing whitespace - Remove unnecessary blank lines - Add missing newline at end of files
Control the property CRUD operations by adding buisness logic, blocking deletions and checking offer prices. We also updated the user profile so salespeople can see and manage all their properties in one place. - Prevent deletion of properties unless state is 'New' or 'Cancelled' using the 'ondelete' decorator. - Update property state to 'Offer Received' upon offer creation. - Raise a validation error if a new offer price is lower than existing offers. - Extend 'res.users' to include a list of properties assigned to the salesperson via a One2many field with a domain for available properties. - Inherit the users form view to display assigned properties in a new notebook page.
This module extends the estate property functionality by automatically creating a customer invoice when a property is marked as sold. - Add `estate_account` module inheriting from `estate.property` - Override `action_set_sold` to auto-generate a customer invoice containing: - 6% commission fee based on the property selling price - Fixed administration fee of 100
To comply with the naming conventions for all res.users inheritances that can be found elsewhere in the codebase. - Rename `estate_sales_person.py` to `res_users.py` - Rename `estate_sales_views.xml` to `res_users_views.xml` - Rename `EstateSalesPerson` class to `ResUsers` class
Add a kanban view to give users a better visual overview of properties. The view groups properties by type to keep things organized and shows important price details only when they are relevant. - Add kanban to the property action view_mode. - Create a kanban view showing property name and tags. - Show 'best price' only when an offer exists and 'selling price' only when an offer is accepted. - Group properties by type by default. - Disable the drag-and-drop feature for kanban columns.
438cb18 to
d63766b
Compare
This commit introduces a series of Owl components and features as part of the Owl training chapter. It covers the core building blocks of the framework. The following features were implemented: - Playground: Converted into a counter using 'useState' and basic event handling. - Counter: Extracted as a standalone reusable component with prop validation and callback support for parent-child communication. - Card: Created a generic UI component supporting props, 'markup' for HTML rendering, and 'slots' for flexible content. Added a toggle state to collapse/expand content. - TodoList & TodoItem: - List rendering with 't-foreach' and unique keys. - Dynamic attribute binding for completion styling. - Task creation with input handling and auto-focus via 'useRef'. - Task deletion and toggling using callback props. - Utils: Added 'useAutofocus' custom hook for DOM manipulation.
d63766b to
10f2794
Compare
