-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Created an estate application for odoo - Added some basic models and fields - Added security for the models - Added menu, basic views (Form and List)
- Loading branch information
Showing
7 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name":'estate', | ||
"summary": "An estate app", | ||
'depends': [ | ||
'base' | ||
], | ||
'data':[ | ||
'security/ir.model.access.csv', | ||
'views/estate_property_views.xml', | ||
'views/estate_menus.xml' | ||
], | ||
'installable': True, | ||
'application': True, | ||
"license":"LGPL-3" | ||
} |
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 @@ | ||
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from odoo import fields,models | ||
from datetime import datetime, timedelta | ||
|
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_description =" Good real estate" | ||
|
||
name= fields.Char(required=True) | ||
description=fields.Text() | ||
postcode=fields.Char() | ||
date_availability = fields.Date(default= datetime.now() + timedelta(days=90)) | ||
expected_price=fields.Float(required=True) | ||
selling_price=fields.Float(readonly=True) | ||
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(string='Garden orientation', | ||
selection=[ | ||
('North', 'North'), | ||
('West', 'West'), | ||
('South', 'South'), | ||
('East', 'East') | ||
] | ||
) | ||
active = fields.Boolean('Active', default=False) | ||
state= fields.Selection(selection=[('new','New'),('offer received','Offer Received'),('offer accepted','Offer Accepted'),('sold','Sold'), ('cancelled','Cancelled')],required=True, default='New',copy=False) |
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,2 @@ | ||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
access_estate_property,estate_property,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,7 @@ | ||
<odoo> | ||
<menuitem id="estate_property_menu_root" name="Real estate"> | ||
<menuitem id='estate_property_first_level_menu' name='First level'> | ||
<menuitem id ='estate_property_menu_action' action='test_estate_property'/> | ||
</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,9 @@ | ||
<?xml version="1.0"?> | ||
<odoo> | ||
<record id="test_estate_property" model="ir.actions.act_window"> | ||
<field name="name">estate</field> | ||
<field name="res_model">estate.property</field> | ||
<field name="view_mode">list,form</field> | ||
</record> | ||
</odoo> | ||
|