-
Notifications
You must be signed in to change notification settings - Fork 2.1k
estate module: Write importable modules tutorial #806
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
base: 18.0
Are you sure you want to change the base?
Conversation
…d created the x_estate_property_type model
… one2many field to a property + refactor the model definitions in a separated file
…del and update views to include it
…update related fields
…es for public access
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, good job ! Just a few short comments 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @arthurrrm !
Don't hesitate to ask if one of my comment is unclear or does not make sense. Most of these are suggestions, so we can discuss pros / cons if you like.
Cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed those two ones
<field name="compute"><![CDATA[for property in self: | ||
property['x_garden_area'] = 0 if not property.x_garden else 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
back to this: this is not correct. It is in an onchange, to set back to a default value when editing the boolean in the form. But here you would totally erase the value entered by the user.
for offer in records: | ||
offer.write({'x_status': 'accepted'}) | ||
offer.x_property_id.write({'x_selling_price': offer.x_price, 'x_partner_id': offer.x_partner_id}) | ||
for other_offer in offer.x_property_id.x_offer_ids: | ||
if other_offer != offer: | ||
other_offer.write({'x_status': 'refused'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but what if you accept two offers for the same property? It seems like only one will be accepted, but it is kind of magic, no? Shouldn't we take more care (and maybe raise in such cases)?
No description provided.