Skip to content

[ADD] : Creation of the new module - #1412

Open
macai-odoo wants to merge 7 commits into
odoo:19.0from
odoo-dev:19.0-training-tutorial-macai
Open

macai-odoo wants to merge 7 commits into
odoo:19.0from
odoo-dev:19.0-training-tutorial-macai

Conversation

@macai-odoo

Copy link
Copy Markdown

Module creation as requested in the tutorial

Module creation as requested in the tutorial
@robodoo

robodoo commented Sep 15, 2026

Copy link
Copy Markdown

Pull request status dashboard

Relate to chapter 3 of the tutorial
Relate to chapter 4 of the tutorial

@msho-odoo msho-odoo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread estate/models/__init__.py Outdated
@@ -0,0 +1 @@
from . import estate_property No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always add a new line for end of files :)

Comment on lines +19 to +22
garden_orientation = fields.Selection(
string='Garden Orientation',
selection=[('North','North'),('South','South'),('East','East'),('West','West')]
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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')
]
)

Comment thread estate/security/ir.model.access.csv Outdated
@@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Comment thread estate/security/ir.model.access.csv Outdated
@@ -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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to have it like this

Suggested change
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.

Comment thread estate/__manifest__.py Outdated
'name':'Real Estate',
'version':'1.0',
'depends':['base'],
'data':['security/ir.model.access.csv']

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'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 !)
@msho-odoo

Copy link
Copy Markdown

@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
@macai-odoo

Copy link
Copy Markdown
Author

Hello !
@msho-odoo I just finished the chapter 6 of the training !

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants