risri - Technical Training#1326
Conversation
This module is created as part of the Odoo Server Framework 101 training. The estate module provides a foundation for building a real estate advertisement application, which is not covered by any existing standard Odoo module.
Add the EstateProperty model in estate/models/estate_property.py with all required field definitions for the real estate advertisement module. Fields include name, description, postcode, date_availability,expected_price, selling_price, bedrooms, living_area, facades,garage, garden, garden_area and garden_orientation (Selection).Both name and expected_price are required fields.
Introduce estate.property.type and estate.property.tag as new models to categorize properties, following the same pattern as estate.property. Add property_type_id, buyer_id and salesperson_id as many2one fields on estate.property and added many2many fields as property tags.
…y types(updated for runbot tutorial) .
…y types(updated for runbot tutorial) .
…y types(updated for runbot tutorial) .
mash-odoo
left a comment
There was a problem hiding this comment.
Hello,
Good start on the task!!
I have added a few comments.
Have a look at it..
| _name = "estate.property" | ||
| _description = "Real Estate Property" | ||
|
|
||
| name = fields.Char(string="Name", required=True) |
There was a problem hiding this comment.
If the string is similar to the field name, then you can skip adding the string as it will automatically take the name from the field directly. You can apply it everywhere
| selection=[ | ||
| ('new', 'New'), | ||
| ('offer_received', 'Offer Received'), | ||
| ('offer_accepted', 'Offer Accepted'), | ||
| ('sold', 'Sold'), | ||
| ('cancelled', 'Cancelled'), |
There was a problem hiding this comment.
| selection=[ | |
| ('new', 'New'), | |
| ('offer_received', 'Offer Received'), | |
| ('offer_accepted', 'Offer Accepted'), | |
| ('sold', 'Sold'), | |
| ('cancelled', 'Cancelled'), | |
| selection=[ | |
| ('new', "New"), | |
| ('offer_received', "Offer Received"), | |
| ('offer_accepted', "Offer Accepted"), | |
| ('sold', "Sold"), | |
| ('cancelled', "Cancelled"), |
The value should be wrapped in double quotes as it will be viewed by the users
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <!--Property Types--> | ||
| <record id="property_type_house" model="estate.property.type"> |
There was a problem hiding this comment.
You can make different files for different models which will help you to track easily.
Also there is a room to improve the file name.
| from dateutil.relativedelta import relativedelta | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): |
There was a problem hiding this comment.
Why have you used here models.Model?
| id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 | ||
| access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1 | ||
| access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1 No newline at end of file |
There was a problem hiding this comment.
Please leave an extra line at the end of the file
| <menuitem | ||
| id="estate_menu_root" name="Real Estate" | ||
| web_icon="estate,static/description/icon.png"> | ||
| </menuitem> |
There was a problem hiding this comment.
| <menuitem | |
| id="estate_menu_root" name="Real Estate" | |
| web_icon="estate,static/description/icon.png"> | |
| </menuitem> | |
| <menuitem | |
| id="estate_menu_root" | |
| name="Real Estate" | |
| web_icon="estate,static/description/icon.png"> | |
| </menuitem> |
| <filter | ||
| name="available" | ||
| string="Available" | ||
| domain="['|', ('state', '=', 'new'),('state','=','offer_received')]" |
| <filter | ||
| name="groupby_postcode" | ||
| string="postcode" | ||
| context="{'group_by':'postcode'}" |
There was a problem hiding this comment.
What's the diff between domain and context?
| @@ -0,0 +1,15 @@ | |||
| { | |||
| 'name': 'Real Estate', | |||
| 'author': 'ritvik', | |||
There was a problem hiding this comment.
Try keeping author name as Odoo S.A. as we are working as a whole or you can skip this as well, it's not a mandatory one
| 'name': 'Real Estate', | ||
| 'author': 'ritvik', | ||
| 'license': 'LGPL-3', | ||
| 'depends': ['base'], |

This module is created as part of the Odoo Server Framework 101 training. The estate module provides a foundation for building a real estate advertisement application, which is not covered by any existing standard Odoo module.