odoo/tutorials#1082
Created by Farah Ahmed (ahmfa)
Blocked
- Merge method
- Review
-
CI
- ci/style: (runtime 2s)
- ci/tutorial: (runtime 23s)
- label
- odoo-dev:19.0-tut-ahmfa
- head
- 34e81d61f96f73785b3a1c28c92b4daf5bd14bac
| odoo/tutorials | |
|---|---|
| 19.0 | #1082 missing statuses missing r+ |
| master |
[ADD] estate: module with property model and corresponding views. (framework 101)
/estate/init.py file imports all the models inside models related to estate
/estate/manifest.py file defines the name. version, category, sequence, summary, website link, dependencies, related data (views and access right files) of the "Estate" application.
/estate/models/estate_property.py creates the table "estate.property" with all its attributes:
- name: fields.Char is the title of the posted property
- type: fields.Selection is the type of the posted property (office, apartment, house, studio)
- postcode: fields.Char is the postcode where the property is located
- availability: fields.Date is the date from when the apartment is available
- description: fields.Text is the description of the posted property
- bedrooms: fields.Integer is the number of the bedrooms in the apartment
- living_area: fields.Integer is the area (in sqm) of the apartment
- currency_id: fields,Many2one imports the EUR currency
- expected_price: fields.Monetary is the expected price of the posted apartment in euros
- selling_price: fields.Monetary is the selling price of the posted apartment in euros
- facades: fields.Integer is the number of facades in the posted apartment
- garage: fields.Boolean indicates if there's a garage for the apartment
- garden: fields.Boolean indicates if there's a garden for the apartment
- garden_area: fields.Integer is the area (in sqm) of the apartment's garden
- garden_orientation: fields.Selection is the orientation of the posted property's garden (north, south, east, west)
- total_area: fields.Integer is the total area (in sqm) of the apartment
- state: fields.Selection is the status of the posted property in regards to offers (new. offer_received, offer_accepted, sold, canceled)
- active: fields.Boolean indicates if the posting of the property is still active
/estate/models/init.py file imports the estate_property.py table
/estate/models/security/ir.model.access.csv file defines the access rights of the estate_property model
/estate/models/views/estate_menus.xml: defines the top menu in the Estate application which views properties returned from the action estate_property_action
/estate/models/views/estate_property_views.xml:
- defines the list view of the properties with the fields name, postcode, bedrooms, living_area, expected_price, selling_price and availability visible.
- defines the form view of the properties as a sheet with the field name as the title. Visible underneath the title are the fields postcode, expected_price, selling_price and availability. Then the fields description, bedrooms, living_area, facades, garage, garden, garden_area, and garden orientation grouped in a notebook page.
- defines an action estate_property_action which retrieves all the properties inside the estate.propety model in list or form views.
- defines the search view of the properties where a user with the valid access rights can :
= search for a property using the fields name, postcode, expected_price, bedrooms. living_area, or facades
= filter the apartments based on the availability state (results will show the apartments where the 'state' field is 'new' or 'offer_received')
= group properties by postcode