-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] estate: menus and estate_property fields added
- Loading branch information
Showing
9 changed files
with
60 additions
and
34 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import models | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
{ | ||
'name': "Awesome Estate", | ||
'depends': ['base'], | ||
'installable': True, | ||
'application': True, | ||
'data':['security/ir.model.access.csv'] | ||
} | ||
'data':[ | ||
'security/ir.model.access.csv', | ||
|
||
'views/estate_property_views.xml', | ||
'views/estate_menu_views.xml' | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from . import estate_property | ||
from . import estate_property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,45 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from odoo import fields, models | ||
from dateutil.relativedelta import relativedelta | ||
|
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_name = 'estate.property' | ||
_description = "Estate Properties" | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Date() | ||
date_availability = fields.Date(copy=False, default= lambda _self: fields.Date.today()+relativedelta(months=3)) | ||
expected_price = fields.Float(required=True) | ||
selling_price = fields.Float() | ||
bedrooms = fields.Integer() | ||
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([('north','North'), ('south','South'), ('east', 'East'), ('west', 'West')], string = 'Garden Orientation') | ||
garden_orientation = fields.Selection( | ||
[ | ||
('north', "North"), | ||
('south', "South"), | ||
('east', "East"), | ||
('west', "West"), | ||
], | ||
string="Garden Orientation", | ||
) | ||
|
||
active = fields.Boolean(default=True) | ||
state = fields.Selection( | ||
[ | ||
('new', "New"), | ||
('offer_received', "Offer Received"), | ||
('offer_accepted', "Offer Accepted"), | ||
('sold', "Sold"), | ||
('cancelled', "Cancelled"), | ||
], | ||
required=True, | ||
copy=False, | ||
default='new' | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,0,0,0 | ||
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<menuitem id="estate_menu_root" name="Estate"> | ||
<menuitem id="estate_first_level_menu" name="Advertisements"> | ||
<menuitem id="estate_property_menu_action" name="Properties" action="estate.estate_property_action"/> | ||
</menuitem> | ||
</menuitem> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<odoo> | ||
<data> | ||
|
||
<record id="estate_property_action" model="ir.actions.act_window"> | ||
<field name="name">Estate Property</field> | ||
<field name="res_model">estate.property</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
|
||
</data> | ||
</odoo> |