[ADD] : Creation of the new module - #1412
macai-odoo wants to merge 7 commits into
Conversation
Module creation as requested in the tutorial
Relate to chapter 3 of the tutorial
Relate to chapter 4 of the tutorial
msho-odoo
left a comment
There was a problem hiding this comment.
Nice work 🔥
For the commit message we write in a way that aligns with when this commit is merged it will ..... and we add the name of the modules before the column :
so you might change it to something like [IMP] estate: add estate property model or however you like to describe your changes :)
refer to Git Guidlines
Also, left you some comments, thanks!
| @@ -0,0 +1 @@ | |||
| from . import estate_property No newline at end of file | |||
There was a problem hiding this comment.
Always add a new line for end of files :)
| garden_orientation = fields.Selection( | ||
| string='Garden Orientation', | ||
| selection=[('North','North'),('South','South'),('East','East'),('West','West')] | ||
| ) |
There was a problem hiding this comment.
The one line on the selection field is okay but when you have many values, it's better to have it like this.
Also, it's preferable to have the key as all small letters, so no confusion happens when they are used inside the code in if statements for example.
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
But I see you have all single quotes so good for me but thought to mention it so you know.
| garden_orientation = fields.Selection( | |
| string='Garden Orientation', | |
| selection=[('North','North'),('South','South'),('East','East'),('West','West')] | |
| ) | |
| garden_orientation = fields.Selection( | |
| string='Garden Orientation', | |
| selection=[ | |
| ('north', 'North'), | |
| ('south', 'South'), | |
| ('east', 'East'), | |
| ('west', 'West') | |
| ] | |
| ) |
| @@ -0,0 +1,2 @@ | |||
| id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | |||
| access_estate,estate,model_estate_property,base.group_user,1,1,1,1 No newline at end of file | |||
There was a problem hiding this comment.
EOF new line please for all files :)
Also alwyas refer to your runbot ci/style, if it's red, it will be telling you in the logs what's to fix :)
| @@ -0,0 +1,2 @@ | |||
| id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | |||
| access_estate,estate,model_estate_property,base.group_user,1,1,1,1 No newline at end of file | |||
There was a problem hiding this comment.
better to have it like this
| access_estate,estate,model_estate_property,base.group_user,1,1,1,1 | |
| access_estate_property_user,access.estate.property,model_estate_property,base.group_user,1,1,1,1 |
The access_ thing is just a convention for this and I added _user at the end because this access rule is for the base user, you might have other rules on the same model but for _manager for example and son on.
| 'name':'Real Estate', | ||
| 'version':'1.0', | ||
| 'depends':['base'], | ||
| 'data':['security/ir.model.access.csv'] |
There was a problem hiding this comment.
| 'data':['security/ir.model.access.csv'] | |
| 'data': [ | |
| 'security/ir.model.access.csv', | |
| ] |
there is also a space after each column : :)
As mentioned in the chapter 5 of the training
Corrected the code based on the feedback from the PR (Thank you !)
|
@macai-odoo please mention me here when you think the PR is ready for another review so I know, typically, after each chapter :) |
Feature based on chapter 6 of the training
Feature based on chapter 6 of the training
|
Hello ! Thank you ! |

Module creation as requested in the tutorial