19.0: Onboarding bepro - #1365
Conversation
bcb799c to
a33e72e
Compare
a33e72e to
64cd738
Compare
YassinWalid
left a comment
There was a problem hiding this comment.
Thanks for the impressive work. I have left a few comments in the PR, so feel free to check them (and if you don't agree with sth we can always discuss it, since in many cases there is no "absolute truth". Please also check the coding guidelines below.
Patterns for names and ids for records in xml files:
please check this link: https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#xml-ids-and-naming
Also, please split your views into one file per model, so they can be found easier.
|
|
||
| description = fields.Text(string='description') | ||
| postcode = fields.Char(string='postcode') | ||
| date_availability = fields.Date(string='Available from', default=lambda _: fields.Date.add(fields.Date.today(), months=3), copy=False) |
There was a problem hiding this comment.
| date_availability = fields.Date(string='Available from', default=lambda _: fields.Date.add(fields.Date.today(), months=3), copy=False) | |
| date_availability = fields.Date(string='Available from', default=fields.Date.add(fields.Date.today(), months=3), copy=False) |
We don't need the lambda here. We could just put the value as it is.
There was a problem hiding this comment.
I tested the approach without lambda and fieldtype datetime. The form value is stuck at a datetime around startup of odoo server, meaning that the default value is generated once and reused as default. The purpose of the field is to have a date set 3 months into the future at point of record creation, implying the date must be calculated at that point in time, hence the lambda is required.
Info @SaddemAmine
| <form string="Estate Property Type"> | ||
| <sheet> | ||
| <div class="oe_button_box" name="button_box"> | ||
| <button name="%(estate.estate_properties_offers_view)d" type="action" class="oe_stat_button" invisible="not offer_count"> |
There was a problem hiding this comment.
but why do we want to make it invisible if there are no offers? The user might use this button to navigate to the offers view and create an offer from there right away. Please let me know what you think
968ff04 to
3768c17
Compare

No description provided.