-
Notifications
You must be signed in to change notification settings - Fork 2.6k
HAZEI Onboarding #1000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
HAZEI Onboarding #1000
Changes from 9 commits
c2f4e01
ae40a80
2ebfca3
c451738
e7f8afa
500f0fc
c85b983
85903f1
26e9cb3
dd4f93c
dca37b2
5bee9d6
fbe8107
b78a704
cdbf0e2
ae6c1ab
4d8c35d
791378e
e66f5d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
'name': 'Odoo Tutorial Real Estate', | ||
'category': 'Real Estate', | ||
'version': '19.0.1.0', | ||
'author': 'Hazei', | ||
'license': 'LGPL-3', | ||
'summary': 'Real Estate Management Tutorial', | ||
'application': True, | ||
'depends': [ | ||
'base', | ||
], | ||
'data': [ | ||
'security/ir.model.access.csv', | ||
'views/estate_property_views.xml', | ||
'views/menu_views.xml', | ||
], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import estate_property |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,30 @@ | ||||||
from odoo import models, fields | ||||||
from datetime import date | ||||||
from dateutil.relativedelta import relativedelta | ||||||
|
||||||
|
||||||
class EstateProperty(models.Model): | ||||||
_name = "estate.property" | ||||||
_description = "Real Estate Property" | ||||||
|
||||||
name = fields.Char(string="Title", required=True) | ||||||
description = fields.Text() | ||||||
postcode = fields.Char() | ||||||
date_availability = fields.Date(copy=False, readonly=True, default=date.today() + relativedelta(months=3)) | ||||||
expected_price = fields.Float(required=True) | ||||||
selling_price = fields.Float(readonly=True, copy=False) | ||||||
bedrooms = fields.Integer(default=2) | ||||||
living_area = fields.Integer(string='Living Area (m2)') | ||||||
facades = fields.Integer() | ||||||
garage = fields.Boolean() | ||||||
garden = fields.Boolean() | ||||||
garden_area = fields.Integer(string='Garden Area (m2)') | ||||||
garden_orientation = fields.Selection( | ||||||
string='garden_orientation', | ||||||
selection=[('north', 'North'), ('south', 'South'), | ||||||
('east', 'East'), ('west', 'West')]) | ||||||
active = fields.Boolean(default=False) | ||||||
|
active = fields.Boolean(default=False) | |
active = fields.Boolean() |
False is already the default for Boolean
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 |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,77 @@ | ||||||||||||||
<?xml version="1.0"?> | ||||||||||||||
<odoo> | ||||||||||||||
<record id="estate_property_action" model="ir.actions.act_window"> | ||||||||||||||
<field name="name">Property</field> | ||||||||||||||
<field name="res_model">estate.property</field> | ||||||||||||||
<field name="view_mode">list,form</field> | ||||||||||||||
</record> | ||||||||||||||
<record id="estate_property_view_list" model="ir.ui.view"> | ||||||||||||||
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you can add a blank line between the records, so it will be a bit clearer ? |
||||||||||||||
<field name="name">estate.property.list</field> | ||||||||||||||
<field name="model">estate.property</field> | ||||||||||||||
<field name="arch" type="xml"> | ||||||||||||||
<list string="Property"> | ||||||||||||||
<field name="name"/> | ||||||||||||||
<field name="bedrooms"/> | ||||||||||||||
<field name="expected_price"/> | ||||||||||||||
<field name="selling_price"/> | ||||||||||||||
<field name="date_availability"/> | ||||||||||||||
</list> | ||||||||||||||
</field> | ||||||||||||||
</record> | ||||||||||||||
<record id="estate_property_view_form" model="ir.ui.view"> | ||||||||||||||
<field name="name">estate.property.form</field> | ||||||||||||||
<field name="model">estate.property</field> | ||||||||||||||
<field name="arch" type="xml"> | ||||||||||||||
<form string="Property Form"> | ||||||||||||||
<sheet> | ||||||||||||||
Comment on lines
+32
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alignment issue here to 😃 , as is the parent of and is the parent of sheet.
Suggested change
|
||||||||||||||
<div class="oe_title"> | ||||||||||||||
<h1> | ||||||||||||||
<field name="name"/> | ||||||||||||||
</h1> | ||||||||||||||
</div> | ||||||||||||||
<seperator/> | ||||||||||||||
<group> | ||||||||||||||
<group> | ||||||||||||||
<field name="postcode"/> | ||||||||||||||
<field name="date_availability"/> | ||||||||||||||
</group> | ||||||||||||||
<group> | ||||||||||||||
<field name="expected_price"/> | ||||||||||||||
<field name="selling_price"/> | ||||||||||||||
</group> | ||||||||||||||
</group> | ||||||||||||||
<notebook> | ||||||||||||||
<page string="Description"> | ||||||||||||||
<group> | ||||||||||||||
<field name="description"/> | ||||||||||||||
<field name="bedrooms"/> | ||||||||||||||
<field name="living_area"/> | ||||||||||||||
<field name="facades"/> | ||||||||||||||
<field name="garage"/> | ||||||||||||||
<field name="garden"/> | ||||||||||||||
<field name="garden_area"/> | ||||||||||||||
<field name="garden_orientation"/> | ||||||||||||||
</group> | ||||||||||||||
</page> | ||||||||||||||
</notebook> | ||||||||||||||
</sheet> | ||||||||||||||
</form> | ||||||||||||||
</field> | ||||||||||||||
</record> | ||||||||||||||
<record id="estate_property_view_search" model="ir.ui.view"> | ||||||||||||||
<field name="name">estate.property.views.search</field> | ||||||||||||||
<field name="model">estate.property</field> | ||||||||||||||
<field name="arch" type="xml"> | ||||||||||||||
<search string="Estate Property"> | ||||||||||||||
<field name="name"/> | ||||||||||||||
<field name="living_area"/> | ||||||||||||||
<separator/> | ||||||||||||||
<filter string="Archived" name="active" domain="[('active', '=', False)]"/> | ||||||||||||||
<filter string="status" name="status" domain="[('status', 'in', ('new', 'offer_received'))]"/> | ||||||||||||||
<filter string="active" name="group_active" context="{'group_by':'active'}"/> | ||||||||||||||
<filter string="postcode" name="group_active" context="{'group_by':'postcode'}"/> | ||||||||||||||
<filter string="bedrooms" name="group_bedrooms" context="{'group_by':'bedrooms'}"/> | ||||||||||||||
</search> | ||||||||||||||
</field> | ||||||||||||||
</record> | ||||||||||||||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
|
||
<odoo> | ||
<menuitem id="estate_menu_root" name="RealEstate"> | ||
<menuitem id="estate_first_level_menu" name="First Level"> | ||
<menuitem id="estate_model_menu_action" action="estate_property_action"/> | ||
</menuitem> | ||
</menuitem> | ||
</odoo> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't do this, it will only be evaluated one time and not work tomorrow on a long running instance.