Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
df8d524
[ADD] estate: create the app
jugurtha-gaci Oct 20, 2025
b84e916
[ADD] estate: chapter 3
jugurtha-gaci Oct 20, 2025
c3c8c66
[ADD] estate: define access rights (chapter 4)
jugurtha-gaci Oct 20, 2025
223bbb6
[ADD] estate: create the actions and views (chapter 5) && [FIX] fix P…
jugurtha-gaci Oct 21, 2025
c7523f7
[ADD] estate: customize the view (chapter 6)
jugurtha-gaci Oct 21, 2025
094f139
[IMP] estate: Add notes.
Mathilde411 Oct 21, 2025
a9e95fd
[ADD] estate: create relationship tables : offers, tags, types - (cha…
jugurtha-gaci Oct 22, 2025
ed6ba56
[ADD] estate: implement compute, inverse, and onchange methods && [IM…
jugurtha-gaci Oct 22, 2025
7b1a091
[ADD] estate: add actions (chapter 9) && [FIX] estate: fix runbot errors
jugurtha-gaci Oct 22, 2025
21a1729
[FIX] fix runbot errors
jugurtha-gaci Oct 22, 2025
0b46628
[FIX] fix runbot errors
jugurtha-gaci Oct 22, 2025
c8c8d80
[FIX] fix runbot errors
jugurtha-gaci Oct 22, 2025
491c499
[ADD] estate: add constraints (chapter 10)
jugurtha-gaci Oct 22, 2025
e165dc8
[ADD] estate: chapter 11 & 12
jugurtha-gaci Oct 24, 2025
e0ef55f
[IMP] fix runbot errors
jugurtha-gaci Oct 24, 2025
7e1411d
[FIX] fix runbot errors
jugurtha-gaci Oct 24, 2025
02054ed
[FIX] estate: fix runbot errors
jugurtha-gaci Oct 24, 2025
5fc2e02
[ADD] estate: create invoices for sold properties (chapter 13)
jugurtha-gaci Oct 24, 2025
f6db4a4
[IMP] estate: add the kanban view for the estate properties (chapter 14)
jugurtha-gaci Oct 24, 2025
3d7c3b6
[IMP] estate: refactoring
jugurtha-gaci Oct 27, 2025
1e70ae4
[FIX] estate: fix runbot errors
jugurtha-gaci Oct 27, 2025
afa71ba
[FIX] estate: fix runbot errors
jugurtha-gaci Oct 27, 2025
ae39b49
[ADD] awesome_owl: finish all the chapters
jugurtha-gaci Oct 28, 2025
5342ef1
[FIX] awesome_owl: fix toggle state
jugurtha-gaci Oct 28, 2025
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

Choose a reason for hiding this comment

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

Missing newline

15 changes: 15 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
'name': "Estate",
'version': '1.0',
'depends': ['base'],
'author': "GACI Jugurtha (jugac)",
'application': True,
'data': [
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_property_type_views.xml',
'views/estate_property_tag_views.xml',
'views/estate_property_offer_views.xml',
'views/estate_menus.xml',
]
}
5 changes: 5 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from . import estate_property
from . import estate_type
from . import estate_tags
from . import estate_offer

19 changes: 19 additions & 0 deletions estate/models/estate_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from odoo import models, fields

class EstateProperty(models.Model):
_name = "estate.property.offer"
_description = "Estate property offers"


price = fields.Float(required=True)
status = fields.Selection(
selection=[
('refused', 'Refused'),
('accepted', 'Accepted')
],
copy=False
)

# relations
partner_id = fields.Many2one("res.partner", required=True)
property_id = fields.Many2one("estate.property", required=True)
52 changes: 52 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from odoo import models, fields

class EstateProperty(models.Model):
_name = "estate.property"
_description = "Table that stores the estate properties"

Choose a reason for hiding this comment

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

Suggested change
_description = "Table that stores the estate properties"
_description = "Estate Property"

_description is the human-readable name of the model, not an actual description. It' a misnomer.



name = fields.Char(required=True)
description = fields.Text()
notes = fields.Html()
postcode = fields.Char()

date_availability = fields.Date(
string="Available From",
copy=False,
default=lambda self: fields.Date.add(fields.Date.today(), months=3)
)

expected_price = fields.Float(required=True)
selling_price = fields.Float(readonly=False, copy=False)

bedrooms = fields.Integer(default=2)
living_area = fields.Integer(string="Living Area (sqm)")
facades = fields.Integer()
garage = fields.Boolean()

garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(
selection=[
('north', 'North'),
('south', 'South'),
('east', 'East'),
('west', 'West')
]
)

active = fields.Boolean(default=True)
state = fields.Selection(
selection=[
('new', 'New'),
('received', 'Received'),
('accepted', 'Accepted')
]
)

Choose a reason for hiding this comment

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

Suggested change
state = fields.Selection(
selection=[
('new', 'New'),
('received', 'Received'),
('accepted', 'Accepted')
]
)
state = fields.Selection(
selection=[
('new', 'New'),
('received', 'Received'),
('accepted', 'Accepted')
], required=True, default='new'
)

state should always be set, and new by default

Choose a reason for hiding this comment

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

This again


# relations
property_type_id = fields.Many2one("estate.property.type")
buyer_id = fields.Many2one("res.partner")
salesman_id = fields.Many2one("res.users")
tag_ids = fields.Many2many("estate.property.tag")
offer_ids = fields.One2many("estate.property.offer", "partner_id")

Choose a reason for hiding this comment

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

Missing newline

8 changes: 8 additions & 0 deletions estate/models/estate_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import models, fields

class EstateProperty(models.Model):
_name = "estate.property.tag"
_description = "Estate property tags"


name = fields.Char(required=True)
8 changes: 8 additions & 0 deletions estate/models/estate_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import models, fields

class EstateProperty(models.Model):
_name = "estate.property.type"
_description = "Estate property types"


name = fields.Char(required=True)
5 changes: 5 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_estate_group_user,estate.group.user,model_estate_property,base.group_user,1,1,1,1
access_estate_type_group_user,estate.type.group.user,model_estate_property_type,base.group_user,1,1,1,1
access_estate_tag_group_user,estate.tag.group.user,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_offer_group_user,estate.offer.group.user,model_estate_property_offer,base.group_user,1,1,1,1
17 changes: 17 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem id="estate_menu_root" name="Real Estate">

<menuitem id="menu_estate_home" name="Advertisements">
<menuitem id="estate_property_menu" action="estate_property_action"/>
</menuitem>

<menuitem id="menu_estate_settings" name="Settings">
<menuitem id="estate_property_type_menu" action="estate_property_type_action"/>
<menuitem id="estate_property_tag_menu" action="estate_property_tag_action"/>
</menuitem>

</menuitem>
</data>
</odoo>

Choose a reason for hiding this comment

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

Missing newline

28 changes: 28 additions & 0 deletions estate/views/estate_property_offer_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="estate_property_offer_list" model="ir.ui.view">
<field name="name">estate.property.offer.list</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<list string="Estate offer">
<field name="price"/>
<field name="partner_id"/>
<field name="status"/>
</list>
</field>
</record>

<record id="estate_property_offer_form" model="ir.ui.view">
<field name="name">estate.property.offer.form</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<form string="Estate offer">
<field name="price"/>
<field name="partner_id"/>
<field name="status"/>
</form>
</field>
</record>
</data>
</odoo>

Choose a reason for hiding this comment

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

Missing newline

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

<record id="estate_property_tag_list" model="ir.ui.view">
<field name="name">estate.property.tag.list</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<list string="Estate tag">
<field name="name"/>
</list>
</field>
</record>

<record id="estate_property_tag_form" model="ir.ui.view">
<field name="name">estate.property.tag.form</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<form string="Estate tag">
<field name="name"/>
</form>
</field>
</record>
</data>
</odoo>

Choose a reason for hiding this comment

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

Missing newline

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

<record id="estate_property_type_list" model="ir.ui.view">
<field name="name">estate.property.type.list</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<list string="Estate type">
<field name="name"/>
</list>
</field>
</record>

<record id="estate_property_type_form" model="ir.ui.view">
<field name="name">estate.property.type.form</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<form string="Estate type">
<field name="name"/>
</form>
</field>
</record>
</data>
</odoo>

Choose a reason for hiding this comment

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

Missing newline

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

<record id="estate_property_list" model="ir.ui.view">
<field name="name">estate.property.list</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<list string="Estate proprties">
<field name="name"/>
<field name="postcode"/>
<field name="bedrooms"/>
<field name="living_area"/>
<field name="expected_price"/>
<field name="selling_price"/>
<field name="date_availability"/>
</list>
</field>
</record>

<record id="estate_property_form" model="ir.ui.view">
<field name="name">estate.property.form</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<form string="Estate property">
<sheet>
<h1> <field name="name"/> </h1>
<group>
<group>
<field name="tag_ids" widget="many2many_tags"/>
<field name="postcode"/>
<field name="date_availability"/>
</group>
<group>
<field name="expected_price"/>
<field name="selling_price"/>
</group>
</group>
<notebook>
<page string="Description">
<group> <field name="description"/> </group>
<group> <field name="bedrooms"/> </group>
<group> <field name="living_area"/> </group>
<group> <field name="facades"/> </group>
<group> <field name="garage"/> </group>
<group> <field name="garden"/> </group>
<group> <field name="garden_area"/> </group>
<group> <field name="garden_orientation"/> </group>
</page>
<page name="notes" string="Notes">
<field name="notes"/>
</page>

<page string="Offers">
<field name="offer_ids">
<list string="Estate offers">
<group>
<field name="price"/>
</group>
<group>
<field name="partner_id"/>
</group>
<group>
<field name="status"/>
</group>
</list>

Choose a reason for hiding this comment

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

Suggested change
<list string="Estate offers">
<group>
<field name="price"/>
</group>
<group>
<field name="partner_id"/>
</group>
<group>
<field name="status"/>
</group>
</list>
<list string="Estate offers">
<field name="price"/>
<field name="partner_id"/>
<field name="status"/>
</list>

No groups needed in a list view

</field>
</page>
<page string="Other infos">
<group> <field name="salesman_id"/> </group>
<group> <field name="buyer_id"/> </group>
<group> <field name="buyer_id"/> </group>

Choose a reason for hiding this comment

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

Same here, only one group needed

</page>
</notebook>
</sheet>
</form>
</field>
</record>

<!-- SEARCH -->

<record id="estate_property_search_view" model="ir.ui.view">
<field name="name">estate.property.search</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<search string="Search estates">
<field name="name"/>
<field name="postcode"/>
<field name="expected_price"/>
<field name="bedrooms"/>
<field name="living_area"/>
<field name="facades"/>

<filter string="Available properties" name="available_properties" domain="[('state', 'in', ['new', 'received'])]"/>
<filter string="Postcode" name="postcode" context="{'group_by':'postcode'}"/>
</search>
</field>
</record>

</odoo>

Choose a reason for hiding this comment

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

Missing newline