Skip to content

[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

Open
wants to merge 20 commits into
base: 18.0
Choose a base branch
from

Conversation

MaximeNoirhomme229
Copy link

@MaximeNoirhomme229 MaximeNoirhomme229 commented May 19, 2025

  • Setup estate application
  • Add models: estate property, estate property type, estate property tag, estate property offer
  • Access right setup: all access to base user.
  • Add a list and form
  • Add filter and group by
  • Add computed fields (best offer, total area and offer deadline) and onchange trigger function (garden)

@robodoo
Copy link

robodoo commented May 19, 2025

Pull request status dashboard

@MaximeNoirhomme229 MaximeNoirhomme229 force-pushed the 18.0-task-tutorial-noma branch from f37268c to 0ac9735 Compare May 19, 2025 15:17
@barracudapps
Copy link

Hi @MaximeNoirhomme229
Can you please review the name of your PR and your commits titles/messages ?
Everything you need to know is here

Copy link

@barracudapps barracudapps left a 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!

Copy link

@barracudapps barracudapps left a 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 🔍

'version': '1.0',
'depends': ['base'],
'author': "Maxime Noirhomme",
'author': 'Maxime Noirhomme',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'author': 'Maxime Noirhomme',

Remove your name or put "Odoo" (or "Odoo SA", ...)

Comment on lines +5 to +6
_name = 'estate.property'
_description = 'estate property module'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_name = 'estate.property'
_description = 'estate property module'
_name = "estate.property"
_description = "estate property module"

Keep double quotes for private properties

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')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Comment on lines 130 to 132

# Ruff lint config
pyproject.toml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Ruff lint config
pyproject.toml

Don't push your local configuration files or customizations

@MaximeNoirhomme229 MaximeNoirhomme229 force-pushed the 18.0-task-tutorial-noma branch from cbd15e7 to a67237e Compare May 20, 2025 08:29
@MaximeNoirhomme229 MaximeNoirhomme229 changed the title Estate app fundation: first model + access right [ADD] Create a basic estate application May 20, 2025
@barracudapps
Copy link

@MaximeNoirhomme229
Please keep this in mind:

Hi @MaximeNoirhomme229 Can you please review the name of your PR and your commits titles/messages ? Everything you need to know is here

@MaximeNoirhomme229 MaximeNoirhomme229 changed the title [ADD] Create a basic estate application [ADD] Estate: Create a basic estate application May 21, 2025
@MaximeNoirhomme229 MaximeNoirhomme229 changed the title [ADD] Estate: Create a basic estate application [ADD] estate: it creates a basic estate application May 21, 2025
@@ -0,0 +1 @@
from . import estate_property, estate_property_type, estate_property_tag, estate_property_offer

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

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 ?

<field name="bedrooms"/>
<field name="living_area"/>
<field name="facades"/>
<filter string="available" name="available" domain="['|', ('status', '=', 'new'), ('status', '=', 'offer received')]"/>

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants