Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
39c9e64
[ADD] Tutorial - Ch 1, 2, 3 - Add module, models, and basic fields
andha-odoo Mar 16, 2026
9448e18
[IMP] Tutorial - Chapter 4 - Security
andha-odoo Mar 16, 2026
c8a3e91
[IMP] Tutorial - Chapter 5 - Actions and Menus
andha-odoo Mar 16, 2026
077ffd7
[IMP] Tutorial - Chapter 5 - Fields, Attributes, View, Default Values
andha-odoo Mar 17, 2026
b266f26
[IMP] Tutorial - Chapter 6 - List, Form, and Search Views
andha-odoo Mar 17, 2026
1d80309
[FIX] Datetime calculation as lambda and renaming values
andha-odoo Mar 17, 2026
e9e2d4c
[IMP] Tutorial - Chapter 7 - Relations Between Models
andha-odoo Mar 17, 2026
cde4aaf
[FIX] styling fixes
andha-odoo Mar 17, 2026
5bc4790
[IMP] Tutorial - Chapter 8 - Computed Fields and Onchanges
andha-odoo Mar 17, 2026
f7a41c9
[IMP] Tutorial - Chapter 9 - Ready For Some Action?
andha-odoo Mar 18, 2026
a4e18a2
[IMP] Tutorial - Chapter 10 - Constraints
andha-odoo Mar 18, 2026
6d77cf4
[IMP] Tutorial - Chapter 11 - Sprinkles
andha-odoo Mar 18, 2026
0b90b2f
[FIX] Rename access record entries
andha-odoo Mar 18, 2026
f7402bc
[FIX] Rename access record entries (again)
andha-odoo Mar 18, 2026
d2011ff
[FIX] Rename access record entries (again x2)
andha-odoo Mar 19, 2026
286105a
[FIX] Rename access record entries (again x3)
andha-odoo Mar 19, 2026
80e0a16
[LINT] Cleaning up various .py and .xml files
andha-odoo Mar 19, 2026
c267b65
[IMP] Tutorial - Chapter 12 - Inheritance
andha-odoo Mar 19, 2026
aa77f29
[IMP] Tutorial - Chapter 13 - Invoicing
andha-odoo Mar 19, 2026
9ce82fb
[IMP] Tutorial - Chapter 14 - Kanban View
andha-odoo Mar 19, 2026
dcdfb4c
[LINT] Remove unused variable declaration
andha-odoo Mar 19, 2026
55b2bc5
[ADD] Web Framework Tutorial - Chapter 1
andha-odoo Mar 23, 2026
0edbed8
[ADD] Web Framework Tutorial - Chapter 2 - Ch 1...8
andha-odoo Mar 23, 2026
b1bc98e
[IMP] Web Framework Tutorial - Chapter 2 - Ch 9, 10, 11
andha-odoo Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
12 changes: 12 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Real Estate",
"version": "1.0",
"depends": ["base"],
"author": "Anmol Dhaliwal",
"category": "Category",
"data": [
"security/ir.model.access.csv",
"views/estate_property_views.xml",
"views/estate_menus.xml",
]
}
1 change: 1 addition & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import estate_property
Comment thread
lost-odoo marked this conversation as resolved.
43 changes: 43 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from odoo import fields, models
from dateutil.relativedelta import relativedelta

class RecurringPlan(models.Model):
_name = "estate.property"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We typically use single quotes for strings, and reserve double quotes for user-facing text.

Suggested change
_name = "estate.property"
_name = 'estate.property'

I'll let you modify it at other places

_description = "A specific property"

name = fields.Char(required=True)
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date('Date Available', copy=False, default=(fields.Date.today() + relativedelta(months=3)))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You should use a lambda here; otherwise, this value will be evaluated at server start and remain static.

expected_price = fields.Float(required=True)
selling_price = fields.Float(readonly=True, copy=False)
bedrooms = fields.Integer(default=2)
living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(
string='Garden Orientation',
selection=[
('north', 'North'),
('east', 'East'),
('south', 'South'),
('west', 'West')
]
)
active = fields.Boolean(default=True)
state = fields.Selection(
string='State',
selection=[
('new', 'New'),
('offer_received',
'Offer Received'),
('offer_accepted', 'Offer Accepted'),
('sold', 'Sold'),
('cancelled', 'Cancelled'),
],
required=True,
copy=False,
default='new'
)
2 changes: 2 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing new line

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
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1
access.estate.property.user,access_estate_property_user,estate.model_estate_property,base.group_user,1,1,1,1

8 changes: 8 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem id="estate_property_menu_root" name="Estate Properties">
<menuitem id="properties" name="Properties">
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
<menuitem id="properties" name="Properties">
<menuitem id="estate_properties_menu" name="Properties">

<menuitem id="estate_model_menu_action" action="estate_property_action"/>
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
<menuitem id="estate_model_menu_action" action="estate_property_action"/>
<menuitem id="estate_property_action" action="estate_property_action"/>

</menuitem>
</menuitem>
</odoo>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here too

8 changes: 8 additions & 0 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="estate_property_action" model="ir.actions.act_window">
<field name="name">Action Button</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
</record>
</odoo>