19.0 tutorial delje - #1415
19.0 tutorial delje#1415Delvaux-Jean-Baptiste wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
@Delvaux-Jean-Baptiste
Nice job on the branch situation 🔥
For the commit message we write in a way that aligns with when this commit is merged it will .....
so you might change [IMP] estate: Added models to something like [IMP] estate: add estate property model or however you like to describe your changes :)
refer to Git Guidlines
but really nice job, well done 👍
also left some comments for you to check
| bedrooms= fields.Integer() | ||
| living_area= fields.Integer() | ||
| facades= fields.Integer() | ||
| garage= fields.Boolean() |
There was a problem hiding this comment.
Good practice to have boolean fields on the form is_something or has_something so you might change this to has_garden and has_garage
| facades= fields.Integer() | ||
| garage= fields.Boolean() | ||
| garden= fields.Boolean() | ||
| garden_orientation= fields.Selection(string='Type', |
There was a problem hiding this comment.
It's good, but it's better to commit to a convention and follow it all the way, so for example in this field you wrote the attribute string before ='Type' but you didn't do that in name field Char('Estate Name')
| garden_orientation= fields.Selection(string='Type', | ||
| selection=[('east', 'East'), | ||
| ('west', 'West'), | ||
| ('north', 'North'), | ||
| ('south', 'South') | ||
| ] | ||
| ) |
There was a problem hiding this comment.
It's correct but we style it like this (see the suggestion).
nitpick: some teams might stick to single quotes being only on technical strings (the ones that the user don't see) and double quotes are for the strings that the user can see)
so for example the selection can be ('east', "East") instead of ('east', 'East') but some teams don't do this, they just stick to their own convention which is all single quotes (if possible) or all double quotes
| garden_orientation= fields.Selection(string='Type', | |
| selection=[('east', 'East'), | |
| ('west', 'West'), | |
| ('north', 'North'), | |
| ('south', 'South') | |
| ] | |
| ) | |
| garden_orientation= fields.Selection( | |
| string='Type', | |
| selection=[ | |
| ('east', 'East'), | |
| ('west', 'West'), | |
| ('north', 'North'), | |
| ('south', 'South'), | |
| ] | |
| ) |
| _name = "estate_property" | ||
| _description = "The details of a property" | ||
|
|
||
| name= fields.Char('Estate Name', required= True) |
There was a problem hiding this comment.
We do spaces before and after the operator so it's name = fields not name= fields.
Better to check all style errors in your runbot and fix it :)
The log there provides a description for the reason of the error
[ADD] estate: add estate access for base users
|
@Delvaux-Jean-Baptiste please mention me here when you think the PR is ready for another review, typically, after each chapter :) |
added fields and default values in fields of new estate [IMP] estate: updated gitignore to exclude vs config
|
@msho-odoo I believe I am ready for the last review of the day ;-) |
[IMP] estate: Update List, Form and Search for cleaner display
msho-odoo
left a comment
There was a problem hiding this comment.
Thanks for the good work!
Regarding the commit message we use [ADD] for adding whole new modules, but in this case (adding some field, view or feature/logic) we use [IMP] tag (for improvement) which you will be using most of the time in your team :)
I also left you some comments to check and please Always remember to green your runbot before pinging of the review 😉
| expected_price = fields.Float(required = True) | ||
| selling_price = fields.Float() | ||
| bedrooms = fields.Integer() | ||
| date_availability = fields.Date(copy=False, default=fields.Date.today()+relativedelta(months=3)) |
There was a problem hiding this comment.
directly valuating the fields.Date at default will work when imported but it will be stuck at this value, you should use lambda function. Search the codebase for it and let me know if you have any question :)
| /> | ||
| </menuitem> | ||
| </menuitem> | ||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
Please Always check your runbot and make sure it's not red :)
it should be telling you you are missing a new line on the EOF here :)
| <field string="Estate" name="name"/> | ||
| <field name="postcode"/> | ||
| <field name="bedrooms"/> | ||
| <field string="Living Area (sqm)" name="living_area"/> |
There was a problem hiding this comment.
nitpick: usually we have name attribute before string so other developers see right away what field you are referring to
| <field string="Living Area (sqm)" name="living_area"/> | ||
| <field name="facades"/> | ||
|
|
||
| <filter string="Available" name="available" domain="['|',('state', '=', 'New'), ('state', '=', 'offer_received')]"></filter> |
There was a problem hiding this comment.
The key you check on is 'new' not 'New'
This could be easier to read
| <filter string="Available" name="available" domain="['|',('state', '=', 'New'), ('state', '=', 'offer_received')]"></filter> | |
| <filter string="Available" name="available" domain="[('state', 'in', ('new', 'offer_received'))]"></filter> |
| <!-- | ||
| <record id="[ID given to this record]" model="[Model being modified]"> | ||
| <field name="name">[name for this field]</field> | ||
| <field name="model">[Model from which to gather data]</field> | ||
| <field name="arch" type="[Type of data architecture]"> | ||
| <list string="Estates"> | ||
| <field string="[Column String Visible]" name="[Data name from Model]"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
| --> |
| @@ -127,3 +127,4 @@ dmypy.json | |||
|
|
|||
There was a problem hiding this comment.
ops, I shouldn't see this file here :)
environmental files like this one (or .vscode) for example shouldn't be pushed with your commit
| </record> | ||
|
|
||
| <!-- List View --> | ||
| <record id="estate_property_list" model="ir.ui.view"> |
There was a problem hiding this comment.
Should be id="estate_property_view_list" according to coding guidelines
I am writing this to grab your attention to the existing of such guidelines, you can have a look there although you might come across some existing files in the codebase that are not following this comment for example (maybe they are old enough or the team is not strict on conventions) but you should always follow guidelines for new diffs in the code :)
Created offers Created tags
added computed field on offer validity added onchange on has_garden
Added the accept offer and refuse offer to offers

[REF] Updated branch name
[FIX] Added extra end of file line