Skip to content

Conversation

@OmarKhalil2001
Copy link

@OmarKhalil2001 OmarKhalil2001 commented Dec 15, 2025

[ADD] Implementation for Estate Module of Python Framework

Description:

  1. Chapter 1: Introduction
  2. Chapter 2: Added Module Estate. Added Manifest and Init python files. Defined the module as an app
  3. Chapter 3: Introduced building model to Estate module
  4. Chapter 4: Added a new access rules to the Estate modules allowing users to read, write, create, but no delete.
  5. Chapter 5: Added basic GUI of the Estate Module

@robodoo
Copy link

robodoo commented Dec 15, 2025

Pull request status dashboard

@barracudapps barracudapps self-requested a review December 15, 2025 16:23
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Some comments here and there. Can you also please review your PR title and description following our guidelines (https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html)?
A clear commit message is really important to describe what you did and why you did it.

@OmarKhalil2001 OmarKhalil2001 changed the title [ADD] adding real state module [ADD] Estate Module (Python Framework Training) Dec 16, 2025
@OmarKhalil2001 OmarKhalil2001 force-pushed the omkha/first_pr_tutorial branch 2 times, most recently from 1911748 to 162d90a Compare December 16, 2025 21:13
@OmarKhalil2001 OmarKhalil2001 force-pushed the omkha/first_pr_tutorial branch from 162d90a to bf9de48 Compare December 16, 2025 21:16
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Thanks for the feature. Here are some comments.

Avoid as much redundancy as possible, ease the searching and respect our naming conventions.
Let's take buildings_model.py as an example. The file is in the models folder of the estate module a better naming would have been building.py (or maybe estate_building.py as it allow a quick search on the module name and building.py might exist in many modules with different meanings).
Moreover, as it is a model the name should not be plural. Indeed, this is the template to create one building (multiple times but it's still 1 item).
Last thing here: please follow the instructions as if the task (tutorial) was written by a PO). You can of course challenge everything but I would've gone with a property instead of a building.

Also, can you please change the PR message and tell a bit more about what the added code is doing and why you added these lines?

"category": "Tutorials",
"version": "1.1",
"application": True,
"data": ["security/ir.model.access.csv", "views/views.xml", "views/menus.xml"],

Choose a reason for hiding this comment

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

Please split your data files (same comment for as many lists as possible):

Suggested change
"data": ["security/ir.model.access.csv", "views/views.xml", "views/menus.xml"],
"data": [
"security/ir.model.access.csv",
"views/views.xml",
"views/menus.xml",
],

If someone has to add a file, it will be way easier and keep a clear overview (with git history) of the changes.

"version": "1.1",
"application": True,
"data": ["security/ir.model.access.csv", "views/views.xml", "views/menus.xml"],
"author": "OMKHA",

Choose a reason for hiding this comment

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

Suggested change
"author": "OMKHA",
"author": "Odoo",

As you are developing for Odoo, the company is the author of the file.

Comment on lines +2 to +3
"name": "real estate",
"description": "real estate renting management system",

Choose a reason for hiding this comment

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

I would have capitalized these lines

from odoo import models, fields


class building_type_model(models.Model):

Choose a reason for hiding this comment

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

The class name should match the file name (for most cases) and follow the PascalCase convention.
As PEP8 says (https://peps.python.org/pep-0008/#class-names):

Class names should normally use the CapWords convention

Suggested change
class building_type_model(models.Model):
class BuildingType(models.Model):

description = fields.Text()
value = fields.Integer(copy=False)
availability_date = fields.Date(
default=fields.Date.today() + timedelta(days=90), copy=False

Choose a reason for hiding this comment

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

Use a lambda function or call a compute method because this will fix the default date to the server starting date

access_first_model,access_first_model,model_estate_buildings,base.group_user,1,1,1,1
access_building_type_model,access_building_type_model,model_estate_building_type,base.group_user,1,1,1,1
access_building_tags_model,access_building_tags_model,model_estate_building_tags,base.group_user,1,1,1,1
access_offers_model,access_offers_model,model_estate_offers,base.group_user,1,1,1,1 No newline at end of file

Choose a reason for hiding this comment

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

Don't forget Unix conventions on text files' structure based on a line definition (cf. https://peps.python.org/pep-0008/ and https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206)

Check all XML files too

<field name="name"/>
<field name="value"/>
<separator/>
<filter string="Available" name="Available" domain="['|', ('state', '=', 'new' ), ('state', '=', 'offer received')]"/>

Choose a reason for hiding this comment

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

Maybe try something like [('state', 'in', ['new', 'offer_received'])]

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