Conversation
blse-odoo
left a comment
There was a problem hiding this comment.
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`
|
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... 🧐 |
|
I think it is fixed by 121e523#diff-8000c23a2907f34f0cc387be9dc4178411fda81b674724854bd4d048f9e11b16L50 |
| 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!') |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
ce25143 to
bfa5035
Compare
| from odoo import models, fields | ||
|
|
||
| class EstateUser(models.Model): | ||
| _inherit = "res.users" |
There was a problem hiding this comment.
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 ;)
- 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
35461f8 to
e3aa5b0
Compare
Trying to match coding guidelines [FIX] estate_account: remove security folder No need for security file for inherited class
Display smart button to easily acces Invoice(s) linked to a Property and vice versa
a0852d1 to
8b7fedd
Compare
[LINT] estate: code polishing 3rd pass
8b7fedd to
31b1cf4
Compare
| html1 = "<div class='text-primary'>some content</div>"; | ||
| html2 = markup("<div class='text-primary'>some content</div>"); |
There was a problem hiding this comment.
I did not find where these html1 and html2 are used, is it just the remains of some experiments around markup and html injection?
Using the markup function like that, in a PR for odoo, should result in the security checks to raise a warning, as it allows to pass any string as the first argument, not just a literal string. So calls to this function is a potential source of injection (in case attackers control the first argument, they can add arbitrary html, for example <script> malicious_code() </script>). In your case this is safe, as you pass a literal string (you control the string as you wrote it).
The preferred way to call markup with a literal string, is to use it like this:
html2 = markup`<div class='text-primary'>some content</div>`;
Hi, first commit here!