Merge lp:~openerp-dev/openerp-web/trunk-folded-stage-aja into lp:openerp-web

Proposed by ajay javiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/trunk-folded-stage-aja
Merge into: lp:openerp-web
Diff against target: 124 lines (+12/-31)
4 files modified
addons/web/static/src/js/view_form.js (+7/-15)
addons/web/static/src/xml/base.xml (+3/-16)
addons/web_kanban/static/src/css/kanban.css (+1/-0)
addons/web_kanban/static/src/css/kanban.sass (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-folded-stage-aja
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+199801@code.launchpad.net

This proposal supersedes a proposal from 2013-12-20.

Description of the change

Hello,
IMP:
 > In stages, if check box "folded by default" is true, add "..." in form.
FIX:
> In the empty kanban list , quick create doesn't work
Thank You

To post a comment you must log in.
3908. By ajay javiya (OpenERP)

[MERGE]: with trunk

3909. By Amit Vora(OpenERP)

[IMP] improve code

3910. By Jaydeep Barot(OpenERP)

[MERGE] merge with trunk

Unmerged revisions

3910. By Jaydeep Barot(OpenERP)

[MERGE] merge with trunk

3909. By Amit Vora(OpenERP)

[IMP] improve code

3908. By ajay javiya (OpenERP)

[MERGE]: with trunk

3907. By ajay javiya (OpenERP)

[FIX]: Empty kanban should allow to add quick create

3906. By ajay javiya (OpenERP)

[IMP]:In form view folded stage should folded as kanban

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2014-01-31 00:52:02 +0000
3+++ addons/web/static/src/js/view_form.js 2014-02-19 10:14:51 +0000
4@@ -5547,9 +5547,9 @@
5 this._super(field_manager, node);
6 this.options.clickable = this.options.clickable || (this.node.attrs || {}).clickable || false;
7 this.options.visible = this.options.visible || (this.node.attrs || {}).statusbar_visible || false;
8+ this.selection = [];
9 this.set({value: false});
10- this.selection = {'unfolded': [], 'folded': []};
11- this.set("selection", {'unfolded': [], 'folded': []});
12+ this.set("selection", []);
13 this.selection_dm = new instance.web.DropMisordered();
14 this.dataset = new instance.web.DataSetStatic(this, this.field.relation, this.build_context());
15 },
16@@ -5579,10 +5579,7 @@
17 },
18 render_value: function() {
19 var self = this;
20- var content = QWeb.render("FieldStatus.content", {
21- 'widget': self,
22- 'value_folded': _.find(self.selection.folded, function(i){return i[0] === self.get('value');})
23- });
24+ var content = QWeb.render("FieldStatus.content", { 'widget': self });
25 self.$el.html(content);
26 },
27 calc_domain: function() {
28@@ -5604,8 +5601,7 @@
29 */
30 get_selection: function() {
31 var self = this;
32- var selection_unfolded = [];
33- var selection_folded = [];
34+ var selection = [];
35 var fold_field = this.options.fold_field;
36
37 var calculation = _.bind(function() {
38@@ -5617,11 +5613,7 @@
39 return self.dataset.name_get(ids).then(function (records_name) {
40 _.each(records, function (record) {
41 var name = _.find(records_name, function (val) {return val[0] == record.id;})[1];
42- if (fold_field && record[fold_field] && record.id != self.get('value')) {
43- selection_folded.push([record.id, name]);
44- } else {
45- selection_unfolded.push([record.id, name]);
46- }
47+ selection.push([record[fold_field], record.id, name]);
48 });
49 });
50 });
51@@ -5634,14 +5626,14 @@
52 for(var i=0; i < select.length; i++) {
53 var key = select[i][0];
54 if(key == this.get('value') || !this.options.visible || this.options.visible.indexOf(key) != -1) {
55- selection_unfolded.push(select[i]);
56+ select[i].unshift(false);
57+ selection.push(select[i]);
58 }
59 }
60 return $.when();
61 }
62 }, this);
63 this.selection_dm.add(calculation()).then(function () {
64- var selection = {'unfolded': selection_unfolded, 'folded': selection_folded};
65 if (! _.isEqual(selection, self.get("selection"))) {
66 self.set("selection", selection);
67 }
68
69=== modified file 'addons/web/static/src/xml/base.xml'
70--- addons/web/static/src/xml/base.xml 2014-01-14 13:39:53 +0000
71+++ addons/web/static/src/xml/base.xml 2014-02-19 10:14:51 +0000
72@@ -1183,25 +1183,12 @@
73 <ul t-att-class="'oe_form_field_status ' + (widget.options.clickable ? 'oe_form_status_clickable' : 'oe_form_status')" t-att-style="widget.node.attrs.style"/>
74 </t>
75 <t t-name="FieldStatus.content">
76- <t t-foreach="widget.selection.unfolded" t-as="i">
77- <li t-att-class="i[0] === widget.get('value') ? 'oe_active' : ''" t-att-data-id="i[0]">
78- <span class="label"><t t-esc="i[1]"/></span>
79- <!-- are you mit ? -->
80+ <t t-foreach="widget.selection" t-as="i">
81+ <li t-att-class="i[1] === widget.get('value') ? 'oe_active' : ''" t-att-data-id="i[1]" t-att-style="i[0] ? 'pointer-events:none' : ''">
82+ <span class="label"><t t-esc="i[0] ? '...' : i[2]"/></span>
83 <span class="arrow"><span></span></span>
84 </li>
85 </t>
86- <t t-if="widget.selection.folded.length">
87- <li>
88- <span class="label oe_dropdown_toggle oe_dropdown_arrow">More</span>
89- <ul class="oe_dropdown_menu">
90- <t t-foreach="widget.selection.folded" t-as="i">
91- <li t-att-class="i[0] === widget.get('value') ? 'oe_active' : ''" t-att-data-id="i[0]">
92- <span class="label"><t t-esc="i[1]"/></span>
93- </li>
94- </t>
95- </ul>
96- </li>
97- </t>
98 </t>
99 <t t-name="FieldBinaryImage">
100 <span class="oe_form_field oe_form_field_image" t-att-style="widget.node.attrs.style">
101
102=== modified file 'addons/web_kanban/static/src/css/kanban.css'
103--- addons/web_kanban/static/src/css/kanban.css 2014-01-27 17:24:14 +0000
104+++ addons/web_kanban/static/src/css/kanban.css 2014-02-19 10:14:51 +0000
105@@ -10,6 +10,7 @@
106 position: relative;
107 max-width: none;
108 height: 100%;
109+ top: 8%;
110 }
111 .openerp .oe_kanban_view .oe_view_nocontent .oe_view_nocontent_content {
112 margin-left: 90px;
113
114=== modified file 'addons/web_kanban/static/src/css/kanban.sass'
115--- addons/web_kanban/static/src/css/kanban.sass 2014-01-27 17:24:14 +0000
116+++ addons/web_kanban/static/src/css/kanban.sass 2014-02-19 10:14:51 +0000
117@@ -57,6 +57,7 @@
118 position: relative
119 max-width: none
120 height: 100%
121+ top: 8%
122 .oe_view_nocontent_content
123 margin-left: 90px
124 margin-top: 5px