-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
18.0 Technical onboarding guja #359
base: 18.0
Are you sure you want to change the base?
Conversation
added init and manifest files
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, keep on ! 💪
I suggest you to configure your development environment to add the empty line at the end of your files automatically, it will save you time 🙂
You can also ask your IDE to trim useless whitespaces at the end of lines.
estate/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
from . import models |
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.
Missing empty line at the end of all files 🙂
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.
Like everywhere 😄
'demo': [ | ||
], | ||
'application': True, | ||
'installable': 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.
You'll need to add a license
to get rid of the runbot warning and turn it to green 🙂
@@ -0,0 +1,23 @@ | |||
from odoo import fields, models | |||
|
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.
Two lines between the imports and the class.
estate/models/estate_property.py
Outdated
from odoo import fields, models | ||
|
||
class EstateProperty(models.Model): | ||
_name = "estate_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.
_name = "estate_property" | |
_name = "estate.property" |
By convention, models _name
use dots separators.
estate/models/estate_property.py
Outdated
name = fields.Char(required=True) | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Datetime() |
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.
date_availability = fields.Datetime() | |
date_availability = fields.Date() |
Maybe a Date type is enough ? 🤔
estate/__manifest__.py
Outdated
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
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.
No need for this anymore.
estate/__manifest__.py
Outdated
'name': "Real Estate", | ||
'version': '1.0', | ||
'depends': ['base'], | ||
'author': "Author Name", |
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.
'author': "Author Name", | |
'author': "Odoo S.A.", |
estate/__manifest__.py
Outdated
'author': "Author Name", | ||
'category': 'Category', | ||
'description': """ | ||
Description text |
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.
No need to do it in a new line.
estate/__manifest__.py
Outdated
Description text | ||
""", | ||
'website': 'https://www.odoo.com/page/estate', | ||
# data files always loaded at installation |
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.
Those comments don't add any value 😬
estate/__manifest__.py
Outdated
|
||
|
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.
Extra space. We waste bits with that, think of the planet 😄
estate/__manifest__.py
Outdated
'demo': [ | ||
], |
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.
No need.
name = fields.Char(required=True) | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Datetime(copy=False, default=fields.Datetime.add(fields.Datetime.now(), months=+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.
We can inline this.
estate/models/estate_property.py
Outdated
garden_area = fields.Integer() | ||
garden_orientation = fields.Selection( | ||
string='Orientation', | ||
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')], |
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.
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')], | |
selection=[ | |
('north', 'North'), | |
('south', 'South'), | |
('east', 'East'), | |
('west', 'West'), | |
], |
Like this we can add new values without breaking the git history.
estate/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
from . import models |
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.
Like everywhere 😄
…eadline date, and the garden
…, and accept and refuse button for offers
…xpected and selling price, tag and type names
…, attibutes and options, search and stat button
added init and manifest files