-
Notifications
You must be signed in to change notification settings - Fork 759
Odoo training #73
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: master
Are you sure you want to change the base?
Odoo training #73
Conversation
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 !
just some minor comments about the good practice
from . import estate_property_tag | ||
from . import estate_property_offer | ||
from . import estate_property | ||
from . import res_users 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.
As a good practice we leave a blank line at the end of the file
|
||
# SQL Constraints | ||
_sql_constraints = [ | ||
('check_expected_price', 'CHECK(expected_price > 0)', |
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 have a consistency with the quote, either we use double quote everywhere or we use single quote everywhere
#api.depends area | ||
@api.depends("living_area", "garden_area") | ||
def _compute_total_area(self): | ||
for record in self: |
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.
for record in self: | |
for property in self: |
We tend to use a variable that show in which model we are so it is clearer for the person reading the code
return True | ||
|
||
@api.model | ||
def create(self, vals_list): |
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.
def create(self, vals_list): | |
def create(self, vals): |
As you are not working with @api.model_create_multi, you would only have a vals (dictionary) and not a vals_list (list of vals)
No description provided.