Skip to content

Comments

renol - Technical Training#1170

Open
renol-odoo wants to merge 20 commits intoodoo:19.0from
odoo-dev:19.0-server101-renol
Open

renol - Technical Training#1170
renol-odoo wants to merge 20 commits intoodoo:19.0from
odoo-dev:19.0-server101-renol

Conversation

@renol-odoo
Copy link

Hi, first commit here!

@robodoo
Copy link

robodoo commented Feb 16, 2026

Pull request status dashboard

@blse-odoo blse-odoo assigned blse-odoo and unassigned blse-odoo Feb 16, 2026
Copy link

@blse-odoo blse-odoo left a comment

Choose a reason for hiding this comment

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

It is a good start, congrats on your first PR!
I noticed you used very short commit messages, did you have a look at the git guidelines? Just to get familiar with the process, I think would be better to try to follow them a bit

- Deleting module 'chapter1_firstmodule'
- Moving module 'chapter2_estate' to 'estate' as it will be used through all chapters
Fixing `estate_property_action` id error on module installation due to wrong order in `__manifest__.py`
Copy link

@blse-odoo blse-odoo left a comment

Choose a reason for hiding this comment

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

It is looking good!
There is one bug: if user tries to refuse an offer, there is a crash 😮
(and like we said, it fails to start from a fresh db)

@renol-odoo
Copy link
Author

I failed to reproduce the bug mentioned above (crash on refused offer). Let me know if it is still there or in which conditions it is happening... 🧐

@blse-odoo
Copy link

Copy link

@blse-odoo blse-odoo left a comment

Choose a reason for hiding this comment

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

This looks good 👍

def _unlink_if_new_or_canceled(self):
for record in self:
if record.state not in ['new', 'canceled']:
raise exceptions.UserError('Cannot delete a property with offers or that is sold!')

Choose a reason for hiding this comment

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

I'm not sure what is causing the following error with these steps:

  • Create a property and save it
  • Add an offer and save
  • Cancel the property
  • Delete the property (confirm delete) → This causes an error

Copy link
Author

Choose a reason for hiding this comment

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

Once an offer has been linked to a property, the property cannot be deleted (even is state=canceled) because of the forgein key constraint in the DB. I've added an error message in 72992f8 to avoid the crash. Another option is to delete the property AND the offer(s) linked to it

Add/customize the following wiews :
- property list
- property search
- property form
'active' and 'garden_orientation' fields were not creating in the DB due to comma at end of line
Implementing new property related models :
- Property type: M2O
- Property tags: M2M
- Property offers: O2M
- Property total area auto computed
- Best offer selection
- Offer validity & date auto update
- Property garden onchange pre-filling
- `partener_id` typo fix
Default value was set on server startup time, using a callable (lambda) set value on record creation.
- Set property as sold/cancel
- Set offer as accepted/refused (only one accepted offer per property)
- Set buyer and selling price when offer is accepted
- SQL constraints for positive property expected/selling price
- SQL constraint for positive offer price
- SQL constraints for unique tags/types names
- Python constraint to check selling above 90% of expected price
Tuning our views

[FIX] estate: tag color in views

- Show tags color in property view
- Show tags color field in list view
from odoo import models, fields

class EstateUser(models.Model):
_inherit = "res.users"

Choose a reason for hiding this comment

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

You can have a look at the other _inherit = "res.users" in odoo. You may want to adapt the code here to follow the naming convention for the file and the class ;)

Copy link
Author

Choose a reason for hiding this comment

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

Yep, updated and squashed into 52efca0

- Property ondelete method
- Offer creation method
- Inherited user model and view

[FIX] estate: renaming res.user subclass

Renaming the user class inheriting from `res.user` to follow conventions
Don't allow to delete canceled propertis that recived offers.
Otherwise forgein key constraint clash in DB
Add a new estate_account link module to trigger invoice creation when a property is marked as sold
Adding a kanban view for our properties
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