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

{
'name': 'Estate',
'version': '1.0',
'category': 'Sales/Estate',
'sequence': 15,
'summary': 'Track all the properties you own',
'website': 'https://www.odoo.com/app/estate',
'depends': [
'base'
],
'data': [
'security/ir.model.access.csv',
'views/estate_property_views.xml',
'views/estate_menus.xml'
],
'demo': [
],
'installable': True,
'application': True,
'assets': {
},

Choose a reason for hiding this comment

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

We don't have to declare the assets key if it is empty so you can remove it until you actually need it

'author': 'Odoo S.A.',
'license': 'LGPL-3',
}
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
28 changes: 28 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from odoo import models, fields


class EstateProperty(models.Model):
_name = "estate.property"
_description = "Estate properties"
name = fields.Char('Property Name', required=True, translate=True)

Choose a reason for hiding this comment

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

Always have an empty line between the fields declaration and the class properties

description = fields.Text('Property Description', required=True)
postcode = fields.Char('Property postcode')
date_availability = fields.Date('Property availability date', copy=False, default=fields.Date.add(fields.Date.today(), months=3))
expected_price = fields.Float('Property expected price')
selling_price = fields.Float('Property selling price', readonly=True)
bedrooms = fields.Integer(default=2)
active = fields.Boolean(default=True)
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'), ('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.

Suggested change
selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')])
selection=[
('north', 'North'),
('south', 'South'),
('east', 'East'),
('west',` 'West')
])

Would be better for readability to have them in multiple lines

state = fields.Selection(
string='State',
required=True,
default='new',
copy=False,
selection=[('new', 'New'), ('offer_received', 'Offer Received'), ('offer_accepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')])

Choose a reason for hiding this comment

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

Suggested change
selection=[('new', 'New'), ('offer_received', 'Offer Received'), ('offer_accepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')])
selection=[
('new', 'New'),
('offer_received', 'Offer Received'),
('offer_accepted', 'Offer Accepted'),
('sold', 'Sold'),
('cancelled', 'Cancelled')
])

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
8 changes: 8 additions & 0 deletions estate/views/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_main_menu" name="Real Estate">
<menuitem id="estate_advertisement_menu" name="Advertisment">
<menuitem id="estate_property_menu_action" action="estate_property_action" />
</menuitem>
</menuitem>
</odoo>

Choose a reason for hiding this comment

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

You should have an empty line by the end of every file

19 changes: 19 additions & 0 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<odoo>
<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>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
List all your properties
</p>
<p>
track thier rental state
</p>
<p>
track thier mentainance
</p>
</field>
</record>
</odoo>

Choose a reason for hiding this comment

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

Same, empty line by the end of the file

Choose a reason for hiding this comment

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

Missing EOL