Conversation
Update of the list and form views and of the search field.
Adding relations between models.
Adding computed fields and onchange observators.
| from . import ( | ||
| estate_property, | ||
| estate_property_offer, | ||
| estate_property_tag, | ||
| estate_property_type, | ||
| ) |
There was a problem hiding this comment.
Nitpick: We usually do something like this instead
| from . import ( | |
| estate_property, | |
| estate_property_offer, | |
| estate_property_tag, | |
| estate_property_type, | |
| ) | |
| from . import estate_property | |
| from . import estate_property_offer | |
| from . import estate_property_tag | |
| from . import estate_property_type |
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
| _name = 'estate_property' |
There was a problem hiding this comment.
We usually use name.of.module.name.of.model
| _name = 'estate_property' | |
| _name = 'estate.property' |
| postcode = fields.Char( | ||
| string='Postcode', | ||
| ) |
There was a problem hiding this comment.
nitpick, if it's possible we try to keep lines as one (if they dont go over ~120 characters)
| postcode = fields.Char( | |
| string='Postcode', | |
| ) | |
| postcode = fields.Char(string='Postcode') |
| date_availability = fields.Date( | ||
| string='Date availability', | ||
| copy=False, | ||
| default=fields.Date.add(fields.Date.today(), months=3), |
There was a problem hiding this comment.
If not used inside a function fields.Date.today() is resolved when the server starts so if it runs for a few days you will end up with errors.
| default=fields.Date.add(fields.Date.today(), months=3), | |
| default=lambda self: fields.Date.add(fields.Date.today(), months=3), |
| estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_tag,access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_type,access_estate_property_type,estate.model_estate_property_type,base.group_user,1,1,1,1 No newline at end of file |
There was a problem hiding this comment.
We try to always have an empty line at the end of every file.
You can use the Ruff extension with the config from https://runbot326.odoo.com/runbot/static/build/125365592-19-0/logs/ruff_config.txt to have warning about style inside your editor.
Disable auto formatting on save as we try to reduce the quantity of diff when editing file made by someone else
You can also check the ci/style from the runbot (https://runbot.odoo.com/runbot/bundle/190-technical-training-demat-512697) to check what it says.
| @@ -0,0 +1,19 @@ | |||
| { | |||
| 'name': 'Real Estate', | |||
| 'author': 'macau', | |||
There was a problem hiding this comment.
| 'author': 'macau', | |
| 'author': 'Odoo S.A.', |
| @@ -0,0 +1,114 @@ | |||
| from odoo import _, api, fields, models | |||
There was a problem hiding this comment.
nitpick: useless import
| from odoo import _, api, fields, models | |
| from odoo import api, fields, models |

No description provided.