Professional Documents
Culture Documents
2017
EXPERIENCE
1 Introduction
2 Overview: JS Framework
3 New Views
5 Documentation/Guidelines
6 The Future
2 / 63
10/17/2017 The Odoo JS Framework
1 Introduction
3 / 63
10/17/2017 The Odoo JS Framework
Odoo JS in 2017:
4 / 63
10/17/2017 The Odoo JS Framework
Odoo JS in 2017:
5 / 63
10/17/2017 The Odoo JS Framework
”
6 / 63
10/17/2017 The Odoo JS Framework
v10 v11
LOC 33.8k 32.8k
Comments 3.0k 12.5k
Tests LOC 3.9k 29.8k
Assets size (gzipped) 1042kb 909kb
7 / 63
10/17/2017 The Odoo JS Framework
8 / 63
10/17/2017 The Odoo JS Framework
return this._rpc({
model: 'res.partner',
method: 'create',
args: [data],
context: context,
});
9 / 63
10/17/2017 The Odoo JS Framework
and also
► more reusable widgets
► simpler code
► better communication between components
► more documentation
► coding guidelines
► ...
10 / 63
10/17/2017 The Odoo JS Framework
2 Odoo JS Framework
11 / 63
10/17/2017 The Odoo JS Framework
Actions Views
Business
Data
MenuItems Templates
Web UI
12 / 63
10/17/2017 The Odoo JS Framework
Component Tree
webClient
viewManager viewManager
formRenderer formModel
fieldWidgets
13 / 63
10/17/2017 The Odoo JS Framework
crashManager ...
14 / 63
10/17/2017 The Odoo JS Framework
Component Communication
Before:
main bus + reference hunting
15 / 63
10/17/2017 The Odoo JS Framework
Component Communication
Before:
main bus + reference hunting
16 / 63
10/17/2017 The Odoo JS Framework
Communication
components
call events
methods bubble up
on children
this.trigger_up('display_notification', {
title: 'Move Zig',
message: 'All your bases are belong to us',
});
17 / 63
10/17/2017 The Odoo JS Framework
3 New JS Views
18 / 63
10/17/2017 The Odoo JS Framework
”
my manager
performance appraisal, 2016
19 / 63
10/17/2017 The Odoo JS Framework
New JS views
Full rewrite of JS views + 30k loc of unit tests
20 / 63
10/17/2017 The Odoo JS Framework
New JS views
Full rewrite of JS views + 30k loc of unit tests
21 / 63
10/17/2017 The Odoo JS Framework
Controller
View
Renderer Model
Field Widgets
22 / 63
10/17/2017 The Odoo JS Framework
Class Hierarchy
AbstractView
23 / 63
10/17/2017 The Odoo JS Framework
24 / 63
10/17/2017 The Odoo JS Framework
Here is a demo
GED + BasicModel =
25 / 63
10/17/2017 The Odoo JS Framework
FormRenderer BasicModel
FieldChar
26 / 63
10/17/2017 The Odoo JS Framework
FormRenderer BasicModel
FieldChar
26 / 63
10/17/2017 The Odoo JS Framework
FieldChar
26 / 63
10/17/2017 The Odoo JS Framework
FieldChar Server
26 / 63
10/17/2017 The Odoo JS Framework
26 / 63
10/17/2017 The Odoo JS Framework
26 / 63
10/17/2017 The Odoo JS Framework
27 / 63
10/17/2017 The Odoo JS Framework
28 / 63
10/17/2017 The Odoo JS Framework
29 / 63
10/17/2017 The Odoo JS Framework
New Testing
4 Framework
30 / 63
10/17/2017 The Odoo JS Framework
”
someone above me...
31 / 63
10/17/2017 The Odoo JS Framework
32 / 63
10/17/2017 The Odoo JS Framework
33 / 63
10/17/2017 The Odoo JS Framework
Benefits
► Executable specification
► much easier to accept PR
► much easier to refactor
34 / 63
10/17/2017 The Odoo JS Framework
FormController
FormRenderer BasicModel
FieldChar MockServer
35 / 63
10/17/2017 The Odoo JS Framework
form.$('input')
.val('<script>throw Error();</script>')
.trigger('input');
form.$buttons.find('.o_form_button_save').click();
assert.strictEqual(
form.$('.o_field_widget').text(),
'<script>throw Error();</script>',
'the value should have been properly escaped'
);
form.destroy();
});
36 / 63
10/17/2017 The Odoo JS Framework
Documentation and
5 Guidelines
37 / 63
10/17/2017 The Odoo JS Framework
Documentation and
Guidelines
Bad news
38 / 63
10/17/2017 The Odoo JS Framework
Documentation and
Guidelines
Bad news
Good news
39 / 63
10/17/2017 The Odoo JS Framework
40 / 63
10/17/2017 The Odoo JS Framework
Coding Guidelines
41 / 63
10/17/2017 The Odoo JS Framework
6 The Future
42 / 63
10/17/2017 The Odoo JS Framework
Current State
actionManager/viewManager/webClient/...
43 / 63
10/17/2017 The Odoo JS Framework
Current State
actionManager/viewManager/webClient/...
44 / 63
10/17/2017 The Odoo JS Framework
Current State
actionManager/viewManager/webClient/...
45 / 63
10/17/2017 The Odoo JS Framework
Current State
actionManager/viewManager/webClient/...
46 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
47 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
48 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
49 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
50 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
51 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
52 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
53 / 63
10/17/2017 The Odoo JS Framework
High priority
► massive simplification of top layer
► high quality developer documentation (JS)
Medium priority
► add didMount and willUnmount to Widget (remove do_show)
► ...
54 / 63
10/17/2017 The Odoo JS Framework
55 / 63
10/17/2017 The Odoo JS Framework
expressivity
56 / 63
10/17/2017 The Odoo JS Framework
expressivity
easy to understand
57 / 63
10/17/2017 The Odoo JS Framework
expressivity
easy to understand
58 / 63
10/17/2017 The Odoo JS Framework
API stability
expressivity
easy to understand
59 / 63
10/17/2017 The Odoo JS Framework
API stability
expressivity
consistency
easy to understand
60 / 63
10/17/2017 The Odoo JS Framework
API stability
expressivity
consistency
easy to understand
62 / 63
10/17/2017 The Odoo JS Framework
Views: challenges/unsolved
problems
► Field widget which needs to integrate with BasicModel
► Bad API when using field widgets standalone
► Optimizing RPCs/commands
63 / 63