19.0 tutorials ancha - #1357
Conversation
Add the basic structure for the estate module as part of the Odoo Server Framework 101 training.
Setup and authenticated DB to have the estate_property table created schema with initial fields for the same
this would configure the access of the estate property table and more. We can add the rule row in the csv file
- add window action for estate.property - create Real Estate menu hierarchy - register XML views in the manifest - add active and state fields - configure default values and field attributes
- add window action for estate.property - create Real Estate menu hierarchy - register XML views in the manifest - add active and state fields - configure default values and field attributes
- Window action for properties - Root and submenu entries - List view for property records - Form view for property details - Search view with filters and group by options
Implement relational fields for the estate module by adding: - Property types and tags - Property offers - One2many and Many2one relationships - Offer management from the property form - Configuration menus for property types and tags
cfc3c6d to
ef8a011
Compare
…property offer models
- compute the total-area of the property - compute the best-price of the property using private methods - compute the deadline from create_date and validity - implement an inverse method to update validity from the deadline - handle record creation by providing a fallback when create_date is not yet available - display the new fields in the offer tree and form views
7e1de5e to
fa72d08
Compare
This change allows users to: - accept or refuse property offers. - mark properties as sold or cancelled. - keep the selling price in sync with the accepted offer. - ensure the sales process follows the expected workflow.
fa72d08 to
7198b8c
Compare
mash-odoo
left a comment
There was a problem hiding this comment.
Hello!!
Good beginning on the task..
I have added a few comments and questions..
Please have a look🐣
And if you can, please remove the .idea folder while pushing.
PS: Please change your PR title and description. Also add chapter number along with your commits.
|
|
||
| @api.depends("living_area", "garden_area") | ||
| def _compute_total_area(self): | ||
| for realEstateProperty in self: |
There was a problem hiding this comment.
we need it because self is a recordset and it's length is not fixed.
| state = fields.Selection( | ||
| [ | ||
| ("new", "New"), | ||
| ("offer_received", "Offer Received"), | ||
| ("offer_accepted", "Offer Accepted"), | ||
| ("sold", "Sold"), | ||
| ("cancelled", "Cancelled"), | ||
| ], |
There was a problem hiding this comment.
| state = fields.Selection( | |
| [ | |
| ("new", "New"), | |
| ("offer_received", "Offer Received"), | |
| ("offer_accepted", "Offer Accepted"), | |
| ("sold", "Sold"), | |
| ("cancelled", "Cancelled"), | |
| ], | |
| state = fields.Selection( | |
| [ | |
| ('new', "New"), | |
| ('offer_received', "Offer Received"), | |
| ('offer_accepted', "Offer Accepted"), | |
| ('sold', "Sold"), | |
| ('cancelled', "Cancelled"), | |
| ], |
Try to keep the key i.e the technical strings in single quotes and the values which are to be displayed to the user in double quotes
| def _compute_best_price(self): | ||
| self.best_price = max(self.offer_ids.mapped("price")) if self.offer_ids else 0 | ||
|
|
||
| @api.onchange("garden") |
| price = fields.Float(string="Price") | ||
| status = fields.Selection( |
There was a problem hiding this comment.
You don't need to explicitly pass string here if you want to have the string name same as the field name.
You can have a look at the codebase regarding how the string value is calculated if you do not pass explicitly.
| <field name="partner_id"/> | ||
| <field name="validity"/> | ||
| <field name="date_deadline"/> | ||
| <button name="set_accepted" string="Accept" type="object" icon="fa-check"/> |
There was a problem hiding this comment.
What is the working of the attribute type?
What are the alternatives for the values?
| <search> | ||
| <field name="name"/> | ||
| <filter name="group_by_bedrooms" string="Bedrooms" context="{'group_by':'bedrooms'}"/> | ||
| <filter name="filter" string="price" domain="[('expected_price', '>',5000)]"/> |
There was a problem hiding this comment.
| <filter name="filter" string="price" domain="[('expected_price', '>',5000)]"/> | |
| <filter name="filter" string="price" domain="[('expected_price', '>', 5000)]"/> |
NIT
| </field> | ||
| </record> | ||
|
|
||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
Always leave an extra line at the end of the file.
| <menuitem | ||
| id="estate_menu_root" | ||
| name="Real Estate"> | ||
|
|
||
| <menuitem | ||
| id="estate_first_level_menu" | ||
| name="Advertisements"> | ||
|
|
||
| <menuitem | ||
| id="estate_property_menu_action" | ||
| action="estate_property_action"/> | ||
| </menuitem> |
There was a problem hiding this comment.
| <menuitem | |
| id="estate_menu_root" | |
| name="Real Estate"> | |
| <menuitem | |
| id="estate_first_level_menu" | |
| name="Advertisements"> | |
| <menuitem | |
| id="estate_property_menu_action" | |
| action="estate_property_action"/> | |
| </menuitem> | |
| <menuitem | |
| id="estate_menu_root" | |
| name="Real Estate" | |
| > | |
| <menuitem | |
| id="estate_first_level_menu" | |
| name="Advertisements" | |
| > | |
| <menuitem | |
| id="estate_property_menu_action" | |
| action="estate_property_action" | |
| /> | |
| </menuitem> |
Indentation issue
| @@ -0,0 +1,37 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| "base", | ||
| ], | ||
| "application": True, | ||
| "author": "Ansh Chamriya", |
There was a problem hiding this comment.
When you are working for a company, you should keep the author name as Odoo S.A. or just skip writing it.


PR containing the server framework tutorials