Skip to content

Commit 8bc87b0

Browse files
committed
[IMP] estate: added views to access the app menus
1 parent 1b35044 commit 8bc87b0

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

estate/__manifest__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
'license': "LGPL-3",
1010
'data': [
1111
'security/ir.model.access.csv',
12+
'views/estate_property_views.xml',
13+
'views/estate_property_menu_views.xml',
1214
]
1315
}

estate/models/estate_property.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from odoo import fields, models
2-
2+
from datetime import date
3+
from dateutil.relativedelta import relativedelta
34

45
class EstateProperty(models.Model):
56
_name = "estate.property"
@@ -8,11 +9,11 @@ class EstateProperty(models.Model):
89
name = fields.Char('name', required=True)
910
description = fields.Text('desc')
1011
postcode = fields.Char('postcode')
11-
date_availability = fields.Date()
12+
date_availability = fields.Date(copy=False,default=date.today() + relativedelta(months=3))
1213
expected_price = fields.Float()
13-
selling_price = fields.Float()
14-
bedrooms = fields.Integer('# Bedrooms')
15-
living_area = fields.Integer('living.area.size')
14+
selling_price = fields.Float(readonly=True,copy=False)
15+
bedrooms = fields.Integer('# Bedrooms', default=2)
16+
living_area = fields.Integer('living area size')
1617
facades = fields.Integer('# Facades')
1718
garage = fields.Boolean()
1819
garden = fields.Boolean()
@@ -21,3 +22,11 @@ class EstateProperty(models.Model):
2122
string='Orientation',
2223
selection=[('North', 'North'), ('West', 'West'), ('East', 'East'), ('South', 'South')]
2324
)
25+
active = fields.Boolean(default=True)
26+
state = fields.Selection(
27+
string='Sate',
28+
selection=[('New','New'), ('Offer Received','Offer Received'), ('Offer Accepted','Offer Accepted'), ('Sold','Sold'), ('Cancelled','Cancelled')],
29+
required=True,
30+
copy=False,
31+
default="New"
32+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<odoo>
3+
<menuitem id="test_menu_root" name="Estate">
4+
<menuitem id="test_first_level_menu" name="ADs">
5+
<menuitem id="estate_property_menu_action" action="estate_property_action"/>
6+
</menuitem>
7+
</menuitem>
8+
</odoo>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<odoo>
3+
<data>
4+
<record id="estate_property_action" model="ir.actions.act_window">
5+
<field name="name">estate property</field>
6+
<field name="res_model">estate.property</field>
7+
<field name="view_mode">list,form</field>
8+
</record>
9+
</data>
10+
</odoo>

0 commit comments

Comments
 (0)