-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[ADD] estate: it creates a basic estate application #787
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: 18.0
Are you sure you want to change the base?
Conversation
f37268c
to
0ac9735
Compare
Hi @MaximeNoirhomme229 |
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.
@MaximeNoirhomme229
Can you please apply these small changes?
Check all your files as the requested modifications may apply to other code lines.
Thanks!
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!
Still, there are some small comments to consider 🔍
estate/__manifest__.py
Outdated
'version': '1.0', | ||
'depends': ['base'], | ||
'author': "Maxime Noirhomme", | ||
'author': 'Maxime Noirhomme', |
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': 'Maxime Noirhomme', |
Remove your name or put "Odoo" (or "Odoo SA", ...)
_name = 'estate.property' | ||
_description = 'estate property module' |
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' | |
_description = 'estate property module' | |
_name = "estate.property" | |
_description = "estate property module" |
Keep double quotes for private properties
estate/models/estate_property.py
Outdated
date_availability = fields.Date("Date Availability") | ||
expected_price = fields.Float("Expected Price", required=True) | ||
selling_price = fields.Float("Selling Price", default=0) | ||
date_availability = fields.Date('Date Availability') |
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.Date('Date Availability') | |
date_availability = fields.Date("Date Availability") |
Keep double quotes for user displayed strings as this line does the same as date_availability = fields.Date(string="Date Availability")
.
The string
parameter of a field often refers to visible text.
Apply this everywhere where it's needed
.gitignore
Outdated
|
||
# Ruff lint config | ||
pyproject.toml |
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.
# Ruff lint config | |
pyproject.toml |
Don't push your local configuration files or customizations
cbd15e7
to
a67237e
Compare
… other info fields
@MaximeNoirhomme229
|
…ffer by adapting the view accordingly
estate/models/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
from . import estate_property, estate_property_type, estate_property_tag, estate_property_offer |
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.
Separate your imports on multiple lines so it's easier if someone needs to add one import.
Moreover, it takes it easier to blame the changes
@api.depends('garden_area', 'living_area') | ||
def _compute_total_area(self): | ||
for record in self: | ||
record.total_area = record.garden_area + record.living_area |
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.
What happens here if there is no garden ?
estate/views/view_properties.xml
Outdated
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="facades"/> | ||
<filter string="available" name="available" domain="['|', ('status', '=', 'new'), ('status', '=', 'offer received')]"/> |
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.
Maybe more readable with in
- Sql contraints: - prevent stricly negative expected price and negative selling price - unique tag and proprety type - Python constraint to prevent selling price below a threshold relative to the expected price (complex logic not suited for SQL)
- Add a status bar on the estate property view - Add a default deterministic order for the 4 different models - Add a manual ordering for estate property type view (i.e an handle) - Conditionnal display and add color to tags - Make tag list view editable - Add some decoration to offer list view and estate property one - Add a stat button to know how many and which offer are linked to a property type
Uh oh!
There was an error while loading. Please reload this page.