-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Estate module declaration and models #1126
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
base: 19.0
Are you sure you want to change the base?
Conversation
artn-odoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job so far, just a few styling nitpicks but it's good overall !
We try to always add a newline at the end of a file. This can be done by activating the Insert Final Newline if you are using vscode.
Also, we have pretty strict guidelines regarding the commit titles and message. You can find them here for future commits https://www.odoo.com/documentation/16.0/contributing/development/git_guidelines.html
estate/__manifest__.py
Outdated
| 'version':'1.0', | ||
| 'summary':'Track advertisements added for real estate and allow selling them', | ||
| 'website':'https://www.odoo.com/app/estate', | ||
| 'depends':[ | ||
| 'base' | ||
| ], | ||
| 'application':True, | ||
| 'installable':True, | ||
| 'author':'moali', | ||
| 'license':'LGPL-3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to leave a white space after :
| 'version':'1.0', | |
| 'summary':'Track advertisements added for real estate and allow selling them', | |
| 'website':'https://www.odoo.com/app/estate', | |
| 'depends':[ | |
| 'base' | |
| ], | |
| 'application':True, | |
| 'installable':True, | |
| 'author':'moali', | |
| 'license':'LGPL-3' | |
| 'version':' 1.0', | |
| 'summary': 'Track advertisements added for real estate and allow selling them', | |
| 'website': 'https://www.odoo.com/app/estate', | |
| 'depends': [ | |
| 'base' | |
| ], | |
| 'application': True, | |
| 'installable': True, | |
| 'author': 'moali', | |
| 'license': 'LGPL-3' |
estate/models/estate_property.py
Outdated
| _name = 'estate_property' | ||
| _description = 'Estate Property' | ||
|
|
||
| name = fields.Char(string = "Property Name", required = True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try not to put white spaces around the = sign in function calls or function definitions.
The same can be said for all the fields below.
| name = fields.Char(string = "Property Name", required = True) | |
| name = fields.Char(string="Property Name", required=True) |
|
I have created a new commit with the formatted code |
csan-odoo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work overall! Just a few minor adjustments needed. Also:
- When defining view names, please follow the usual Odoo convention by using dot notation (e.g., module.view_name).
- Make sure to include any unnecessary files in the .gitignore to keep the repository clean.
Thanks!
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import controllers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be sure to always leave an empty line at the end of each file
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import controllers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| # -*- coding: utf-8 -*- | ||
|
|
||
| from . import controllers | ||
| from . import controllers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The init.py file is used to load Python code only, so there’s no need to import security files or XML views there. Those are handled through the module manifest instead.
| @@ -0,0 +1,2 @@ | |||
| id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | |||
| 1,access_estate_property,model_estate_property,base.group_user,1,1,1,1 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as an external ID for an access record, it’s generally best to use a descriptive name because it makes the record easier to read and usually more stable over time.
| <field name="name">Property Form</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="property"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <form string="property"> | |
| <form> |
| <field name="postcode" string="Postcode"/> | ||
| <field name="date_availability"/> | ||
| </group> | ||
| <group> | ||
| <field name="expected_price" string="Expected Price"/> | ||
| <field name="selling_price" string="Selling Price"/> | ||
| </group> | ||
| </group> | ||
| <notebook> | ||
| <page string="Details"> | ||
| <group> | ||
| <group> | ||
| <field name="description" string="Description"/> | ||
| <field name="bedrooms" string="Bedrooms"/> | ||
| <field name="living_area" string="Living Area (sqm)"/> | ||
| <field name="facades" string="Facades"/> | ||
| <field name="garage"/> | ||
| <field name="garden"/> | ||
| <field name="garden_area"/> | ||
| <field name="garden_orientation"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick
When you declare a field, Odoo automatically creates a default label by capitalizing the first letter. If this matches what you want to display, there’s no need to set the string manually.
| <field name="name">Property Search</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <search string="property"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <search string="property"> | |
| <search> |
estate/views/search_views.xml
Outdated
| <group expand="1" string="Postcode"> | ||
| <filter string="Postcode" name="postcode_group" context="{'group_by':'postcode'}"/> | ||
| </group> | ||
| <!-- <filter string="Archived" name='active' domain="['!',('active','=',True)]"/> --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <!-- <filter string="Archived" name='active' domain="['!',('active','=',True)]"/> --> |
Estate Included related fields in order to allow the communication between the estate property base model and tags, types, offers, users, and partners model to extend the funcationalities of the current module to cater for the business need of having specific sales info. for each record
Estate Added action buttons to sell/cancel an apartment and accept or refuse a given offer. The added actions and functionalities are aiming to provide the user of the estate app with more flexible actions in order to complete their tasks of selling or cancelling real estate listings as well as accepting or refusing any given offer against that listing. Moreover, accepting an offer will automatically sell the listing to that bidder

No description provided.