-
Notifications
You must be signed in to change notification settings - Fork 2.6k
MATHO Onboarding #999
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?
MATHO Onboarding #999
Changes from 2 commits
7076246
8f82d4d
3ebb0c4
af44200
cda8d01
259a7b3
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,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Part of Odoo. See LICENSE file for full copyright and licensing details. | ||
|
||
|
||
|
||
{ | ||
'name': 'Estate', | ||
'version': '0.1', | ||
'application': True, | ||
'author': 'matho', | ||
'depends': [ | ||
'base', | ||
], | ||
'data': [ | ||
'security/ir.model.access.csv', | ||
'views/estate_property_views.xml', | ||
'views/estate_menus.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,28 @@ | ||
from odoo import fields, models | ||
|
||
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. One blank line is missing here. There must be two blank line above a class. It is in the pep8 😃 . This are the guidelines to have a clean python code. |
||
class EstateProperty(models.Model): | ||
_name = "estate.property" | ||
_description = "ici je mets une phrase" | ||
|
||
name = fields.Char(required=True) | ||
description = fields.Text() | ||
postcode = fields.Char() | ||
date_availability = fields.Date(default=fields.Date.add(fields.Date.today(), months=3), copy=False) | ||
expected_price = fields.Float(required=True) | ||
selling_price = fields.Float(readonly=True,copy=False) | ||
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', 'N'), ('South', 'S'),('East', 'E'),('West', 'W')], | ||
help="Specify the orientation of the garden to know when you're gonna enjoy the sun") | ||
state = fields.Selection( | ||
selection=[('New','New'), ('Offer Received', 'Offer Received'),('Offer Accepted', 'Offer Accepted'),('Sold', 'Sold'),('Cancelled', 'Cancelled')], | ||
default='New' | ||
) | ||
active = fields.Boolean(default=True) | ||
|
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 | ||
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<odoo> | ||
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. The file should be named estate_property_menus.xml as it must contains the name of your model which is estate.property. |
||
<data> | ||
<menuitem id="test_menu_root" name="Real Estate"> | ||
<menuitem id="test_first_level_menu" name="Advertisements"> | ||
<menuitem id="test_model_menu_action" action="mon_action"/> | ||
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. The id should be estate_property_menu and the action should be estate_property_action. |
||
</menuitem> | ||
</menuitem> | ||
</data> | ||
</odoo> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<odoo> | ||
<data> | ||
|
||
<record id="mon_action" model="ir.actions.act_window"> | ||
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. The action should be estate_property_action as it must contain the name of the model. |
||
<field name="name">Properties</field> | ||
<field name="res_model">estate.property</field> | ||
<field name="view_mode">list,form</field> | ||
<field name="search_view_id" ref="perso_recherche"/> | ||
</record> | ||
|
||
<record id="perso_colonnes" model="ir.ui.view"> | ||
|
||
<field name="name">estate.property.view.list</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<list string="Channel" > | ||
<field name="name"/> | ||
<field name="postcode"/> | ||
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="expected_price"/> | ||
<field name="selling_price"/> | ||
<field name="date_availability"/> | ||
</list> | ||
</field> | ||
|
||
</record> | ||
|
||
<record id="perso_tab1" model="ir.ui.view"> | ||
<field name="name">estate.property.view.form</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<form string="Test"> | ||
<sheet> | ||
<h1> | ||
<field name="name"/> | ||
</h1> | ||
<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> | ||
Comment on lines
+87
to
+90
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. Something fail with the indentation. It comes from the starting form tag. The code underneath is also impacted. |
||
|
||
<record id="perso_recherche" model="ir.ui.view"> | ||
|
||
<field name="name">estate.property.view.search</field> | ||
<field name="model">estate.property</field> | ||
<field name="arch" type="xml"> | ||
<search string="Search something"> | ||
<field name="name"/> | ||
<field name="postcode"/> | ||
<field name="expected_price"/> | ||
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="facades"/> | ||
</search> | ||
</field> | ||
</record> | ||
|
||
</data> | ||
</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.
Same here.