Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 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
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/
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_setup"],
"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
55 changes: 55 additions & 0 deletions estate/models/estate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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)

@api.depends("living_area", "garden_area")
def _compute_total_area(self):
for record in self:
record.total_area = record.living_area + record.garden_area
14 changes: 14 additions & 0 deletions estate/models/estate_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from odoo import models, fields


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)
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.
237 changes: 237 additions & 0 deletions estate/postgres-studio/bun.lock

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions estate/postgres-studio/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "drizzle-kit";

export default defineConfig({
dialect: "postgresql",
dbCredentials: {
url: process.env.DATABASE_URL!,
},
out: "./drizzle",
});
1 change: 1 addition & 0 deletions estate/postgres-studio/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Hello via Bun!");
21 changes: 21 additions & 0 deletions estate/postgres-studio/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "postgres-studio",
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"studio": "drizzle-kit studio",
"studio:pull": "drizzle-kit pull && drizzle-kit studio"
},
"devDependencies": {
"@types/bun": "latest",
"drizzle-kit": "^0.31.10"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"drizzle-orm": "^0.45.2",
"pg": "^8.22.0"
}
}
30 changes: 30 additions & 0 deletions estate/postgres-studio/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext"],
"target": "ESNext",
"module": "Preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
"types": ["bun"],

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}
7 changes: 7 additions & 0 deletions estate/pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extraPaths": ["../../community"],
"typeCheckingMode": "basic",
"reportPrivateLocalImportUsage": "none",
"reportUnannotatedClassAttribute": "none",
"reportArgumentType": "none",
}
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,access_estate,model_estate,base.group_user,1,1,1,1
access_estate_type,access_estate_type,model_estate_type,base.group_user,1,1,1,1
access_estate_tag,access_estate_tag,model_estate_tag,base.group_user,1,1,1,1
access_estate_offer,access_estate_offer,model_estate_offer,base.group_user,1,1,1,1
11 changes: 11 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo>
<menuitem id="estate_menu_root" name="Real Estate">
<menuitem id="estate_first_level_menu" name="Advertisements">
<menuitem id="estate_model_menu_action" action="estate_action" />
</menuitem>
<menuitem id="estate_type_first_level_menu" name="Settings">
<menuitem id="estate_type_menu_action" action="estate_type_action" />
<menuitem id="estate_tag_menu_action" action="estate_tag_action" />
</menuitem>
</menuitem>
</odoo>
31 changes: 31 additions & 0 deletions estate/views/estate_offers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<odoo>

<record id="estate_offer_list_view" model="ir.ui.view">
<field name="name">Estate Offer List</field>
<field name="model">estate.offer</field>
<field name="arch" type="xml">
<list>
<field name="price" />
<field name="partner_id" />
<field name="status" />
</list>
</field>
</record>

<record id="estate_offer_form_view" model="ir.ui.view">
<field name="name">Estate Offer Form</field>
<field name="model">estate.offer</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="partner_id" />
<field name="price" />
<field name="status" />
</group>
</sheet>
</form>
</field>
</record>

</odoo>
Loading