-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[ADD] estate: add estate model for tutorials #1123
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.
Nice job so far !
Just a few styling nitpicks, the rest is good overall
We have pretty strict guidelines when it comes to commit names and messages, you can find them here https://www.odoo.com/documentation/16.0/contributing/development/git_guidelines.html
Also, we try to always put an empty line at the end of every file. If you are using vscode, this can be done automatically by activating the Insert Final Newline option.
estate/__manifest__.py
Outdated
| @@ -0,0 +1,11 @@ | |||
| # -*- coding: utf-8 -*- | |||
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.
This is not mandatory anymore in newer Odoo versions
| # -*- coding: utf-8 -*- |
|
|
||
| class EstateProperty(models.Model): |
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 to always put 2 newlines before a class definition
| class EstateProperty(models.Model): | |
| class EstateProperty(models.Model): |
- created init and manifest files - added the name and dependencies
- create the estate property model - add fields and attributes
- created access.csv file - defined the read/write permissions to be able to access the model
e1cc4ea to
4e859ee
Compare
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 looking good !
estate/__init__.py
Outdated
| @@ -0,0 +1 @@ | |||
| from . import models No newline at end of file | |||
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.
Don't forget to put a newline at the end of the file! The option that does it automatically is only triggered once you save the file, so if you didn't touch this file since activating the option, it wasn't added
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.
Got it, can't believe I missed that one
estate/models/estate_property_tag.py
Outdated
| _description = 'Estate Property Tag Information' | ||
|
|
||
| name = fields.Char(string='Tag Name', required=True) | ||
|
No newline at end of file |
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.
Seems like this line contains some whitespaces, so it wasn't counted as a newline
- created menus to see the fields of the model
- added the list view with several fields - edited the form view to have two columns and a "Description" tab - added a search view with search fields, filter for available properties, and group properties by postcode. - fixed style: added newline at the end of files and two lines before class definition
Chapter 7 of the Server 101 tutorial on model relationships. - Added a model for property types and added buyers and salesmen to the estate property model to showcase many2one relationships - Added tags to showcase many2many relationships - Added a model for offers to showcase one2many relationships - Created list and form views for the models and added fields to the property model
- added computed fields to calculate total area and best offer price - added a compute function to calculate the deadline from the number of validity days - added an inverse function to determine the validity in days from the deadline - added onchange function to adjust the garden area and orientation based on whether the garden option is set
ebe7950 to
95d3d2a
Compare

Dilya Anvarbekova - Chapter 2 of the Server Framework 101 tutorial. Created the real estate module.