Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2604af7
[ADD] added estate module
VIWAR-ODOO Feb 5, 2026
d82ef23
[FIX] delete test data
VIWAR-ODOO Feb 5, 2026
51763b2
[FIX] added application true and installable as true
VIWAR-ODOO Feb 5, 2026
dbcbc7a
[FIX] formate change of manifest file
VIWAR-ODOO Feb 5, 2026
1b9af85
[FIX] removed duplicate author fiels inthe manifest file
VIWAR-ODOO Feb 5, 2026
265e0f4
[FIX] style error removed white spaces
VIWAR-ODOO Feb 5, 2026
0aaabf0
[FIX] no newline error in style fixed removed extra comma
VIWAR-ODOO Feb 5, 2026
5a196fc
[FIX] formated code
VIWAR-ODOO Feb 5, 2026
e97eeb1
[FIX] style error
VIWAR-ODOO Feb 5, 2026
2e78623
[FIX] new line at end , fix error no new newline at the end
VIWAR-ODOO Feb 5, 2026
21041c2
[CLN] remove description
VIWAR-ODOO Feb 5, 2026
828ecf1
[FIX] restyle for test case eror
VIWAR-ODOO Feb 5, 2026
c2e6a0c
[ADD] added estate_property.py model
VIWAR-ODOO Feb 6, 2026
dc89be2
[IMP] estate: Update estate/models/estate_property.py
VIWAR-ODOO Feb 19, 2026
0134897
[IMP] estate : added extra line
VIWAR-ODOO Feb 19, 2026
7955c6a
[IMP] estate: Update estate/models/estate_property.py
VIWAR-ODOO Feb 20, 2026
230f419
[IMP] estate: removed <data> tag , and added "
VIWAR-ODOO Feb 20, 2026
02685cc
[ADD] estate: added the form view and a notebook and added two tabs i…
VIWAR-ODOO Feb 20, 2026
bd0fb4d
[ADD] estate: search added, filter and domain added
VIWAR-ODOO Feb 23, 2026
e055ab4
[ADD] estate: added the property type , implemented the many2one
VIWAR-ODOO Feb 23, 2026
f943aba
[LINT] estate: fix formatting to pass R&D tests
VIWAR-ODOO Feb 24, 2026
7096674
[LINT] estate: fix styling , white space
VIWAR-ODOO Feb 24, 2026
465a892
[IMP] estate: added the the lambda function to acess the self.env._uid
VIWAR-ODOO Feb 24, 2026
1f9a81a
[ADD] estate: added many2many , tag model and implementation
VIWAR-ODOO Feb 24, 2026
23f615e
[ADD] estate: added offers and implemented one2many
VIWAR-ODOO Feb 24, 2026
16c7370
[ADD] estate: added the depends compute field
VIWAR-ODOO Feb 25, 2026
c6c5ce1
[ADD] estate: added the property offer
VIWAR-ODOO Feb 26, 2026
22d1eeb
[ADD] estate: maintainance task done during the meeting
VIWAR-ODOO Feb 26, 2026
1784e4c
[ADD] estate: adde the onchange on the garden to set the garden orien…
VIWAR-ODOO Feb 27, 2026
54239dd
[FIX] estate: fixed the style error
VIWAR-ODOO Feb 27, 2026
c25036c
[FIX] estate: fixed the styling error , and removed the == in the val…
VIWAR-ODOO Feb 27, 2026
ef42266
[FIX] estate: fixed the whitespace for style
VIWAR-ODOO Feb 27, 2026
f249e78
[ADD] estate: added the button for the custom logic on the properties…
VIWAR-ODOO Feb 27, 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
21 changes: 21 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
'name': 'Real Estate',
'version': '1.0',
'depends': ['base'],
'author': 'viwar-odoo',
'category': 'real estate',
'description': "real estate App.",
'data': [
'security/ir.model.access.csv',
'views/estate_property_view.xml',
'views/estate_property_tag_view.xml',
'views/estate_property_type_view.xml',
'views/estate_property_offer_view.xml',
'views/estate_maintainance_form.xml',
'views/estate_menus.xml'
],
'application': True,
'installable': True,
'license': 'LGPL-3',
'website': 'https://odoo.com',
}
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_maintainance_request
from . import estate_property
from . import estate_property_offer
from . import estate_property_tag
from . import estate_property_type
37 changes: 37 additions & 0 deletions estate/models/estate_maintainance_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from odoo import api, models, fields


class EstateMaintainanceRequest(models.Model):
_name = 'estate.maintainance.request'
_description = 'table for the technician maintainance request'

property_id = fields.Many2one('estate.property', required=True, readonly=True)
buyer_id = fields.Many2one('res.users', required=True, default='self.env.uid')
technician_id = fields.Many2one('res.partner', required=False)
state = fields.Selection(
string='state',
default='new',
selection=[
('new', "New"),
('assigned', "Assigned"),
('inprogress', "Inprogress"),
('done', "Done"),
('cancelled', "Cancelled"),
],
)
estimate_cost = fields.Float(required=False)
actual_cost = fields.Float(compute='_compute_actual_cost', store=True)
current_stage = fields.Char(compute='_compute_state_after_assigned', store=True)

@api.depends('state', 'estimate_cost')
def _compute_actual_cost(self):
if self.state == 'done':
self.actual_cost = self.estimate_cost * 1.18

@api.depends('technician_id', 'state')
def _compute_state_after_assigned(self):
if self.state == 'new' and self.technician_id:
self.state = 'assigned'
self.current_stage = 'assigned'
else:
self.current_stage = self.state
89 changes: 89 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
from odoo import api, fields, models
from odoo.exceptions import UserError


class EstateProperty(models.Model):
_name = "estate.property"
_description = "Test Model for real estate"

name = fields.Char(default="Unknown")
last_seen = fields.Datetime("Last Seen", default=fields.Datetime.now)
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(
copy=False, default=fields.Date.add(fields.Date.today(), months=3)
)
expected_price = fields.Float()
selling_price = fields.Float(copy=False, readonly=True)
bedrooms = fields.Integer(default=2)
living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
state = fields.Selection(
string="status",
selection=[
('new', "New"),
('offer received', "Offer Received"),
('offer accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled"),
],
default='new',
)
active = fields.Boolean(default=True)
garden_area = fields.Integer()
garden_orientation = fields.Selection(
string="garden orientation direction",
selection=[
('north', "North"),
('south', "South"),
('east', "East"),
('west', "West"),
],
)
property_type_id = fields.Many2one("estate.property.type")
salesperson_id = fields.Many2one(
'res.users',
string='Salesperson',
index=True,
default=lambda self: self.env.user,
)
buyer_id = fields.Many2one('res.partner', default='None', copy=False)
tag_ids = fields.Many2many('estate.property.tag')
offer_ids = fields.One2many('estate.property.offer', 'property_id', string='offers')
total_area = fields.Float(compute='_compute_total_area')

estate_maintainance_id = fields.One2many(
'estate.maintainance.request', 'property_id'
)

@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.onchange('garden')
def _onchange_garden(self):
if self.garden:
self.garden_area = 10
self.garden_orientation = "north"
else:
self.garden_area = None
self.garden_orientation = None

def button_cancel(self):
if self.state == "cancelled":
raise UserError("The property is already cancelled")
elif self.state == "sold":
raise UserError("The property is already sold, you cannot cancel it")
else:
self.state = "cancelled"

def button_sold(self):
if self.state == "sold":
raise UserError("The property is already sold")
elif self.state == "cancelled":
raise UserError("The property is already cancelled, and cannot be sold")
else:
self.state = "sold"
15 changes: 15 additions & 0 deletions estate/models/estate_property_offer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import fields, models


class EstatePropertyOffer(models.Model):
_name = 'estate.property.offer'
_description = 'estate property offer'

price = fields.Float(copy=False)
status = fields.Selection(
copy=False,
string="status",
selection=[('accepted', "Accepted"), ('refused', "Refused")],
)
partner_id = fields.Many2one('res.partner', required=True)
property_id = fields.Many2one('estate.property', required=True)
8 changes: 8 additions & 0 deletions estate/models/estate_property_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from odoo import fields, models


class EstatePropertytTag(models.Model):
_name = 'estate.property.tag'
_description = 'Estate_property_tag'

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


class EstatePropertyType(models.Model):
_name = 'estate.property.type'
_description = 'Estate_property_type'

name = fields.Char(required=True)
6 changes: 6 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type,access_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tag,access_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1
access_estate_property_offer,access_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1
access_estate_maintainance_request,access_estate_maintainance_request,model_estate_maintainance_request,base.group_user,1,1,1,1
30 changes: 30 additions & 0 deletions estate/views/estate_maintainance_form.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<odoo>
<record id="estate_maintainance_action" model="ir.actions.act_window">
<field name="name">estate_maintainance_action</field>
<field name="res_model">estate.maintainance.request</field>
<field name="view_mode">list,form</field>
</record>
<record id="estate_maintainance_form_view" model="ir.ui.view">
<field name="name">estate.maintainance.type.form.view</field>
<field name="model">estate.maintainance.request</field>
<field name="arch" type="xml">
<form string="maintainance ">
<sheet>
<group>
<field name="property_id"/>
<field name="buyer_id"/>

<field name="technician_id"/>


<field name="state"/>
<field name="estimate_cost"/>
<field name="actual_cost"/>
<field name="current_stage"/>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
41 changes: 41 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<odoo>
<data>
<menuitem id="test_menu_root" name="Real Estate">
<menuitem id="first_level_menu" name="menu">
<!-- __experimented a bit , if we remove the name from the menu item then it will use the id as name -->
<menuitem id="decond_level_menu" name="second menu">
<!-- experimented , if we remove the name from the menu item then it will use the action"s name as name -->
<menuitem id="test_model_menu_action" name="property" action="estate_model_action"/>
</menuitem>
</menuitem>
<!-- #experimental added extra direct menu for learning-->
<menuitem id="direct_property_menu" name="property" action="estate_model_action"/>
<!---->
</menuitem>
<menuitem
id="settings_menu_root"
name="settings"
sequence="10"
parent="test_menu_root"
/>
<menuitem id="property_type_menu" parent="settings_menu_root" name="property type" action="estate_property_type_action"/>
<menuitem id="estate_property_tag_menu" parent="settings_menu_root" name="property tag" action="estate_property_tag_action"/>
<menuitem
id="property_offer"
name="property offer"
sequence="10"
parent="settings_menu_root"
action="estate_property_offer_action"
/>

<menuitem
id="maintainance_request"
name="maintainance_request"
sequence="10"
parent="settings_menu_root"
action="estate_maintainance_action"
/>

</data>
</odoo>
44 changes: 44 additions & 0 deletions estate/views/estate_property_offer_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0"?>
<odoo>


<record id="estate_property_offer_action" model='ir.actions.act_window'>
<field name="name">estate_property_offer</field>
<field name="res_model">estate.property.offer</field>
<field name="view_mode">list,form</field>
</record>


<record id="estate_property_offer_list_view" model='ir.ui.view'>
<field name="name">estate.property.offer.list.view</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<list string="offers" editable="bottom">
<field name="price"/>
<field name="status"/>
<field name="partner_id"/>
<field name="property_id"/>

</list>
</field>
</record>

<record id="estate_property_offer_form_view" model="ir.ui.view">
<field name="name">estate.property.offer.form.view</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<form string="offers">
<sheet>
<group name="offer_form" string="Offer Details" invisible="not property_id">
<field name="property_id" readonly='1'/>
<field name="price"/>
<field name="status"/>
</group>

</sheet>
</form>
</field>
</record>


</odoo>
42 changes: 42 additions & 0 deletions estate/views/estate_property_tag_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<odoo>



<record id="estate_property_tag_action" model='ir.actions.act_window'>
<field name="name">estate_property_tag</field>
<field name="res_model">estate.property.tag</field>
<field name="view_mode">list,form</field>
</record>


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

<record id="estate_property_tag_form_view" model='ir.ui.view'>
<field name="name">estate.property.tag.form.view</field>
<field name="model">estate.property.tag</field>
<field name="arch" type="xml">
<form string="Tag">
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>






</odoo>
21 changes: 21 additions & 0 deletions estate/views/estate_property_type_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<odoo>
<record id="estate_property_type_action" model="ir.actions.act_window">
<field name="name">estate_property_type_action</field>
<field name="res_model">estate.property.type</field>
<field name="view_mode">list,form</field>
</record>
<record id="estate_property_type_form_view" model="ir.ui.view">
<field name="name">estate.property.type.form.view</field>
<field name="model">estate.property.type</field>
<field name="arch" type="xml">
<form string="Property Type">
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
Loading