-
Notifications
You must be signed in to change notification settings - Fork 2.7k
19.0 tutorial roole #1026
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?
19.0 tutorial roole #1026
Changes from 7 commits
98643d9
bcaa21c
c0d3abf
fcc0b54
e0c8d41
8d81369
975c280
2db9f2e
34dff5f
8e360b3
0593194
b51f568
eb4b23b
8fa5e7c
31b424d
6c79c93
f0f7842
f061d13
d147bb8
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 @@ | ||
| { | ||
| 'name': "My Awesome module Roole", | ||
| 'version': '1.0', | ||
| 'depends': ['base'], | ||
| 'author': "roole", | ||
| 'application': True, | ||
| 'installable': True, | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 'category': 'Tutorials', | ||
| 'description': """ | ||
| Description text | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """, | ||
| 'license': 'GPL-3', | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| '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_model |
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import datetime | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class EstateModel(models.Model): | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| _name = "estate.property" | ||
| _description = "Estate description" | ||
| _property = "property" | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| name = fields.Char(required=True) | ||
| description = fields.Text() | ||
| postcode = fields.Char() | ||
| date_availability = fields.Date(copy=False, default=datetime.datetime.now() + datetime.timedelta(days=90)) | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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='Orientation', | ||
| selection=[('north', 'North'), ('south', 'South'), ('west', 'West'), ('east', 'East')]) | ||
| active = fields.Boolean(default=True) | ||
| state = fields.Selection( | ||
| string="Estate status", | ||
| selection=[('new', 'New'), ('offer received', 'Offer Received'), ('offer accepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')], | ||
roole-odoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| help='This field explain the estate status.', | ||
| required=True, | ||
| copy=False, | ||
| default='new' | ||
| ) | ||
| 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_user,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,8 @@ | ||
| <?xml version="1.0"?> | ||
| <odoo> | ||
| <menuitem id="estate_menu_root" name="Estate"> | ||
| <menuitem id="estate_first_level_menu" name="First Level"> | ||
| <menuitem id="estate_model_menu_action" action="estate_model_action"/> | ||
| </menuitem> | ||
| </menuitem> | ||
| </odoo> | ||
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||
| <?xml version="1.0"?> | ||||||
| <odoo> | ||||||
| <record id="estate_model_action" model="ir.actions.act_window"> | ||||||
| <field name="name">Test properties</field> | ||||||
|
||||||
| <field name="name">Test properties</field> | |
| <field name="name">Properties</field> |
Uh oh!
There was an error while loading. Please reload this page.