-
Notifications
You must be signed in to change notification settings - Fork 2.3k
XAFR - Technical Training #740
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
Open
xafr-odoo
wants to merge
21
commits into
odoo:18.0
Choose a base branch
from
odoo-dev:18.0-training-xafr
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c33277d
[ADD] Chapter 1: Manifest & init
xafr-odoo 7bbe040
[IMP] Chapter 1: Manifest & init
xafr-odoo 6c39232
[IMP] Chapter 2: New Application
xafr-odoo c398bbf
[IMP] Chapter 3: Models & Basic Fields
xafr-odoo bcdabc8
[IMP] Chapter 4: Security (+ added license in manifest to remove warn…
xafr-odoo a8cf2ae
[IMP] estate - Chapter 5: UI
xafr-odoo 82d7ec7
[IMP] estate - Chapter 5: UI
xafr-odoo 92195f6
[IMP] estate - Chapter 6: Basic Views
xafr-odoo a5ea174
[IMP] estate: Chapter 7
xafr-odoo 93b7190
[IMP] estate: Chapter 8
xafr-odoo b517f01
[IMP] estate: Chapter 9
xafr-odoo 6ee2a07
[IMP] estate: Chapter 10
xafr-odoo a4863d5
[IMP] estate: Chapter 11
xafr-odoo 1742244
[IMP] estate: Chapter 12
xafr-odoo 3ebcdc6
[IMP] estate: Chapter 13
xafr-odoo 6a42330
[IMP] estate: Chapter 13
xafr-odoo 7e14dac
[IMP] estate: Chapter 14
xafr-odoo 92ffc6d
[IMP] estate: Chapter 15
xafr-odoo 27cf297
[IMP] awesome_owl: Chapter 1
xafr-odoo 4e78b9f
[IMP] awesome_owl: Chapter 2
xafr-odoo 05a315d
[IMP] awesome_owl: Chapter 2
xafr-odoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[IMP] Chapter 2: New Application
- Loading branch information
commit 6c3923211e54822e70d3b9535cf9ea4481d69eab
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import estate_property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from odoo import fields, models, api | ||
|
||
class TestModel(models.Model): | ||
_name = "estate.property" | ||
_description = "Estate properties" | ||
|
||
name = fields.Char('Title', required=True, translate=True) | ||
description = fields.Text('Description') | ||
postcode = fields.Integer('Postcode', help="Your post code in 4 or 5 digits.") | ||
date_availability = fields.Date('Date Availability') | ||
expected_price = fields.Float('Expected Price', required=True) | ||
selling_price = fields.Float('Selling Price') | ||
bedrooms = fields.Integer(string='Bedrooms') | ||
living_area = fields.Integer('Living Area (sqm)') | ||
facades = fields.Integer('Facades') | ||
garage = fields.Boolean('Garage') | ||
garden = fields.Boolean('Garden') | ||
garden_area = fields.Integer('Garden Area (sqm)') | ||
garden_orientation = fields.Selection( | ||
string='Garden Orientation', | ||
selection=[('north', 'North'), ('west', 'West'), ('south', 'South'), ('east', 'East')], | ||
help="The selection of the garden orientation.") | ||
|
||
# company_currency_id = fields.Many2one('res.currency', compute='_compute_company_currency_id') | ||
# expected_price = fields.Monetary('Expected Price', currency_field='company_currency_id') | ||
|
||
|
||
_sql_constraints = [ | ||
('check_selling_price', 'CHECK(selling_price >= 0)', 'The price can\'t be negative.'), | ||
] | ||
|
||
@api.depends_context('company') | ||
def _compute_company_currency_id(self): | ||
self.company_currency_id = self.env.company.currency_id |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
All good but most of the field display names are not required.
If not set, Odoo will basically deduct the display name of the field based on the field name. It'll separate it on the underscore and capitalize every word. (In case of a Many2One, Many2Many or One2Many behaviour will be slightly different but we'll see that when you'll have some). For example:
description -> Description
expected_price -> Expected Price
Basically, except
name
,living_area
andgarden_area
none of them are required to be explicitly mentioned. Not a big issue but helps code look cleaner.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.
Ok thank you that's good to know :)