Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b2837d2
[ADD] estate: bare-minimum structure to make module
hagav-odoo Jul 3, 2026
7b8a6fe
[IMP] estate: basic model for estate module
hagav-odoo Jul 3, 2026
82e5899
[IMP] estate: add ir.model.access.csv file for security of access rights
hagav-odoo Jul 3, 2026
01ff0fe
[FIX] estate: update missing properties in manifest
hagav-odoo Jul 3, 2026
385eb62
[LINT] estate: add new line to fix type check errors
hagav-odoo Jul 3, 2026
fa64dd8
[IMP] estate: add Pyright and Odoo LS configs
hagav-odoo Jul 7, 2026
7fa4c95
[IMP] estate: add missing fields to Estate Model
hagav-odoo Jul 7, 2026
1b44b46
[IMP] estate: add views(actions) & menus
hagav-odoo Jul 7, 2026
e68219c
[IMP] estate: set default values and other field customizations
hagav-odoo Jul 7, 2026
c296088
[IMP] estate: add state(selection) & active(bool) fields
hagav-odoo Jul 7, 2026
8003e01
[IMP] estate: add list view
hagav-odoo Jul 7, 2026
2e5fe6a
[IMP] estate: update form ui
hagav-odoo Jul 7, 2026
9738b9b
[IMP] estate: add search shortcuts, filters & groupBy
hagav-odoo Jul 8, 2026
5e1106a
[IMP] estate: add missing fields in views
hagav-odoo Jul 9, 2026
95767ec
[IMP] estate: add Drizzle Studio for local database viewing
hagav-odoo Jul 9, 2026
a75e298
[IMP] estate: New model estate.type is added to use as type of estate
hagav-odoo Jul 13, 2026
8ebcd8b
[IMP] estate: add buyer & seller to model and view
hagav-odoo Jul 13, 2026
c04603a
[IMP] estate: add estate.tag model for tags
hagav-odoo Jul 13, 2026
5634742
[IMP] estate: add estate.offer model
hagav-odoo Jul 13, 2026
f315778
[IMP] estate: add total_area computed field
hagav-odoo Jul 14, 2026
9c95d3d
[FIX] estate: use for-loop for compute total
hagav-odoo Jul 15, 2026
9d82971
[FIX] estate: correction 'base_setup' -> 'base' in dependency
hagav-odoo Jul 22, 2026
48671cd
[IMP] estate: add best_offer computed field
hagav-odoo Jul 27, 2026
f784ceb
[IMP] estate: add deadline and validity field with compute and inverse
hagav-odoo Jul 29, 2026
eb52087
[IMP] estate: set default values when garden bool is changed
hagav-odoo Jul 31, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ venv.bak/
dmypy.json

# Pyre type checker
.pyre/
.pyre/
17 changes: 17 additions & 0 deletions estate/.zed/debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"label": "Debug Odoo: rd-demo",
"adapter": "Debugpy",
"request": "launch",
"python": "/home/odoo/odoo19/community/.venv/bin/python",
"program": "/home/odoo/odoo19/community/odoo-bin",
"cwd": "/home/odoo/odoo19/community",
"args": [
"--addons-path=addons,../enterprise/,../tutorials/",
"-d",
"rd-demo",
"-u",
"estate"
]
}
]
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 @@
{ # pyright: ignore[reportUnusedExpression]
"name": "estate",
"depends": ["base"],
"author": "Havit",
"license": "LGPL-3",
"data": [
"security/ir.model.access.csv",
"views/estate_views.xml",
"views/estate_offers.xml",
"views/estate_menus.xml",
],
}
4 changes: 4 additions & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import estate
from . import estate_type
from . import estate_tag
from . import estate_offer
71 changes: 71 additions & 0 deletions estate/models/estate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models


class Estate(models.Model):
_name = "estate"
_description = "Real Estate Module"

# fields
name = fields.Char(required=True)
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(
default=lambda self: fields.Date.today() + relativedelta(months=3)
)
expected_price = fields.Float()
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(
selection=[
("north", "North"),
("south", "South"),
("east", "East"),
("west", "West"),
]
)
state = fields.Selection(
selection=[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],
required=True,
copy=False,
default="new",
)
active = fields.Boolean(default=True)
estate_type_id = fields.Many2one("estate.type", string="Estate Type")
seller_id = fields.Many2one("res.users", string="Seller", default=lambda self: self.env.user)
buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False)
tag_ids = fields.Many2many("estate.tag", string="Tags")
offer_ids = fields.One2many("estate.offer", "property_id", string="Offers")
total_area = fields.Integer(compute="_compute_total_area", store=True)
best_offer = fields.Float(compute="_compute_best_offer")

@api.depends("living_area", "garden_area")
def _compute_total_area(self):

for record in self:
record.total_area = record.living_area + record.garden_area

@api.depends("offer_ids")
def _compute_best_offer(self):
for record in self:
record.best_offer = max(record.offer_ids.mapped("price")) if record.offer_ids else 0

@api.onchange("garden")
def _onchange_garden(self):
if self.garden:
self.garden_area = 10
self.garden_orientation = "north"
else:
self.garden_area = 0
self.garden_orientation = False
26 changes: 26 additions & 0 deletions estate/models/estate_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from dateutil.relativedelta import relativedelta
from odoo import models, fields, api


class EstateOffer(models.Model):
_name = 'estate.offer'
_description = 'Estate Offer'

price = fields.Float()
status = fields.Selection(
selection=[('accepted', 'Accepted'), ('refused', 'Refused')],
copy=False,
)
partner_id = fields.Many2one('res.partner', required=True)
property_id = fields.Many2one('estate', required=True)
validity = fields.Integer(default=7)
date_deadline = fields.Date(compute='_compute_date_deadline', inverse='_inverse_date_deadline')

@api.depends('validity')
def _compute_date_deadline(self):
for record in self:
record.date_deadline = (record.create_date or fields.Date.today()) + relativedelta(days=record.validity)

def _inverse_date_deadline(self):
for record in self:
record.validity = (record.date_deadline - (record.create_date.date() or fields.Date.today())).days
8 changes: 8 additions & 0 deletions estate/models/estate_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import models, fields


class EstateTag(models.Model):
_name = 'estate.tag'
_description = 'Estate Tag'

name = fields.Char(string='Name', 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 EstateType(models.Model):
_name = 'estate.type'
_description = 'Estate Type'

name = fields.Char(string='Name', required=True)
9 changes: 9 additions & 0 deletions estate/odools.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[config]]
name = "default"
odoo_path = "/home/odoo/odoo19/community"
addons_paths = [
"/home/odoo/odoo19/community/addons",
"/home/odoo/odoo19/enterprise",
"/home/odoo/odoo19/tutorials"
]
python_path = "python3"
36 changes: 36 additions & 0 deletions estate/postgres-studio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# dependencies (bun install)
node_modules

# output
out
dist
*.tgz

# code coverage
coverage
*.lcov

# logs
logs
_.log
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store

drizzle
15 changes: 15 additions & 0 deletions estate/postgres-studio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# postgres-studio

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

This project was created using `bun init` in bun v1.3.14. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
Loading