chean - Technical Onboarding#1341
Conversation
Python cache files are environment-specific generated artifacts. Remove tracked pycache files and add the corresponding .gitignore rules.
924da73 to
fcca45b
Compare
Add ensure_one() to actions intended to run on a single record and use more explicit variable names to improve code readability.
Add status ribbons for sold and cancelled properties and display tags in the property list view for better visibility.
ziriraha
left a comment
There was a problem hiding this comment.
Good work, can you please squash all the commits into a single one?
| property_type_id = fields.Many2one( | ||
| comodel_name="estate.property.type", | ||
| string="Property Type", | ||
| ) |
There was a problem hiding this comment.
| property_type_id = fields.Many2one( | |
| comodel_name="estate.property.type", | |
| string="Property Type", | |
| ) | |
| property_type_id = fields.Many2one("estate.property.type", "Property Type") |
No need to apply this change, but just so you know, this is possible to do
| < 0 | ||
| ): | ||
| raise ValidationError( | ||
| _( |
There was a problem hiding this comment.
| _( | |
| self.env._( |
we no longer use the _ import, its better to use self.env._ (basically because its horrible when you want to do a for _ in ... and you cant)
| raise UserError(_("You cannot refuse an offer once it has been accepted.")) | ||
|
|
||
| self.status = "refused" | ||
| return True |
There was a problem hiding this comment.
fyi (i dont know if its explained in the tutorial) actions can return action objects so you can say things like: open this popup, reload the page, redirect to here
| access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 | ||
| access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1 | ||
| access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1 | ||
| access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1 No newline at end of file |
| parent="estate_settings_menu" | ||
| sequence="20" | ||
| /> | ||
| </odoo> No newline at end of file |
| <field name="model">res.users</field> | ||
| <field name="inherit_id" ref="base.view_users_form"/> | ||
| <field name="arch" type="xml"> | ||
| <xpath expr="//notebook" position="inside"> |
There was a problem hiding this comment.
| <xpath expr="//notebook" position="inside"> | |
| <notebook position="inside"> |
I think you can also do overrides like this without xpath
| "partner_id": record.buyer_id.id, | ||
| "move_type": "out_invoice", | ||
| "invoice_line_ids": [ | ||
| Command.create( |
There was a problem hiding this comment.
you can also do
| Command.create( | |
| (0, 0, |
some people hate Command... but i dont know why
| properties = self.env["estate.property"].browse( | ||
| [vals["property_id"] for vals in vals_list] | ||
| ) | ||
| properties_by_id = {property_.id: property_ for property_ in properties} |
There was a problem hiding this comment.
this is good but isnt needed, you just call properties.browser(id) after and it would be the same effect
Something like:
properties = self.env["estate.property"].browse([vals["property_id"] for vals in vals_list])
for vals in vals_list:
property = properties.browse(vals["property_id"])| @@ -0,0 +1,4 @@ | |||
| { | |||
| "name": "Estate Account", | |||
| "depends": ["estate", "account"], | |||
There was a problem hiding this comment.
Sometimes we add auto_install: True to tell it to install automatically when all the depends modules are installed.

No description provided.