Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
23 changes: 23 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
'name': "Estate",
'summary': """
The Real Estate Advertisement module
""",

'description': """
The Real Estate Advertisement module
""",
'author': "Odoo",
'website': "https://www.odoo.com/",
'category': 'Tutorials',
'version': '0.1',
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
'application': True,
'installable': True,
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
'depends': ['base'],
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
'data': [
'data/ir.model.access.csv',
'views/estate_property_views.xml',
'data/estate_menus.xml',
],
'license': 'AGPL-3'
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
}
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
7 changes: 7 additions & 0 deletions estate/data/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<odoo>
<menuitem id="estate_menu_root" name="Estate">
<menuitem id="estate_first_level_menu" name="Advertisements">
<menuitem id="estate_model_menu_action" action="estate_model_action"/>
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
</menuitem>
</menuitem>
</odoo>
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
2 changes: 2 additions & 0 deletions estate/data/ir.model.access.csv
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,access_estate_property,model_estate_property,base.group_user,1,1,1,1
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
1 change: 1 addition & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import estate_property
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
40 changes: 40 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from odoo import fields, models


class EstateProperty(models.Model):
_name = "estate.property"
_description = "Estate Property"
active = True
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
name = fields.Char('Property Name', required=True)
description = fields.Text('Description')
postcode = fields.Char('Postcode')
date_availability = fields.Date('Availability Date', copy=False, default=fields.Date.add(fields.Date.today(), months=3))
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
expected_price = fields.Float('Expected Price', required=True)
selling_price = fields.Float('Selling Price', readonly=True, copy=False)
bedrooms = fields.Integer('Bedrooms', default=2)
living_area = fields.Integer('Living Area')
facades = fields.Integer('Facades')
garage = fields.Boolean('Garage')
garden = fields.Boolean('Garden')
garden_area = fields.Integer('Garden Area')
garden_orientation = fields.Selection(
string='Garden Orientation',
selection=[
('north', 'North'),
('south', 'South'),
('east', 'East'),
('west', 'West'),
],
)
state = fields.Selection(
string='State',
selection=[
('new', 'New'),
('offer received', 'Offer Received'),
('offer accepted', 'Offer Accepted'),
('sold', 'Sold'),
('cancelled', 'Cancelled'),
],
default='new',
required=True,
)
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
Comment thread
Mathilde411 marked this conversation as resolved.
Outdated
7 changes: 7 additions & 0 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<odoo>
<record id="estate_model_action" model="ir.actions.act_window">
<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
</record>
</odoo>