Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

Comment on lines +1 to +3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

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 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
Comment on lines +1 to +2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

{
'name': 'Estate',
'version': '0.0.1',
'category': 'Sales',
'depends': [
'base',
],
'data': [
'security/ir.model.access.csv',
'data/estate_property_views.xml',
'data/estate_menus.xml',
],
'summary': 'Real Estate Module - Training',
'website': 'https://www.odoo.com/jobs',
'installable': True,
'application': True,
'author': 'Jérémie Parisel',
'license': 'LGPL-3',
}
8 changes: 8 additions & 0 deletions estate/data/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<odoo>
<menuitem id="estate_menu_root" name="Real Estate">
<menuitem id="estate_first_level_menu" name="Adverstissement">
<menuitem id="estate_model_menu_action" action="estate_model_create"/>
</menuitem>
</menuitem>
</odoo>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an end of file line here

14 changes: 14 additions & 0 deletions estate/data/estate_property_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<odoo>
<record id="estate_model_create" model="ir.actions.act_window">

<field name="name">Create new property</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new real estate good in the database
</p>
</field>
</record>
</odoo>
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
35 changes: 35 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from odoo import fields, models
from dateutil import relativedelta

class EstateProperty(models.Model):
_name = "estate.property"
_description = "Real Estate Properties to sell"

name = fields.Char(required=True)
active = fields.Boolean('Active', default=True)
state = fields.Selection(
selection =[
('new', 'New'),
('offer_received','Offer Received'),
('offer_accepted','Offer Accepted'),
('sold','Sold'),
('canceled', 'Cancelled')],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
('canceled', 'Cancelled')],
('canceled', 'Cancelled'),
],

required = True,
default = 'new',
copy = False,
)
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(default=fields.Date.today() + relativedelta.relativedelta(months=3))
expected_price = fields.Float(required=True)
selling_price = fields.Float()
bedrooms = fields.Integer('Bedrooms',default=2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bedrooms = fields.Integer('Bedrooms',default=2)
bedrooms = fields.Integer('Bedrooms', default=2)

living_area = fields.Integer()
facades = fields.Integer()
garage = fields.Boolean()
garden = fields.Boolean()
garden_area = fields.Integer()
garden_orientation = fields.Selection(
string='Orientation',
selection=[('north', 'North'), ('south', 'South'),('east', 'East'),('west', 'West')],

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation please, new line for each pair :D

help="Orientation of the garden of the property")
2 changes: 2 additions & 0 deletions estate/security/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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an end of file line here