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
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2014-01-31 00:52:02 +0000
+++ addons/web/static/src/js/view_form.js 2014-02-19 10:14:51 +0000
@@ -5547,9 +5547,9 @@
5547 this._super(field_manager, node);5547 this._super(field_manager, node);
5548 this.options.clickable = this.options.clickable || (this.node.attrs || {}).clickable || false;5548 this.options.clickable = this.options.clickable || (this.node.attrs || {}).clickable || false;
5549 this.options.visible = this.options.visible || (this.node.attrs || {}).statusbar_visible || false;5549 this.options.visible = this.options.visible || (this.node.attrs || {}).statusbar_visible || false;
5550 this.selection = [];
5550 this.set({value: false});5551 this.set({value: false});
5551 this.selection = {'unfolded': [], 'folded': []};5552 this.set("selection", []);
5552 this.set("selection", {'unfolded': [], 'folded': []});
5553 this.selection_dm = new instance.web.DropMisordered();5553 this.selection_dm = new instance.web.DropMisordered();
5554 this.dataset = new instance.web.DataSetStatic(this, this.field.relation, this.build_context());5554 this.dataset = new instance.web.DataSetStatic(this, this.field.relation, this.build_context());
5555 },5555 },
@@ -5579,10 +5579,7 @@
5579 },5579 },
5580 render_value: function() {5580 render_value: function() {
5581 var self = this;5581 var self = this;
5582 var content = QWeb.render("FieldStatus.content", {5582 var content = QWeb.render("FieldStatus.content", { 'widget': self });
5583 'widget': self,
5584 'value_folded': _.find(self.selection.folded, function(i){return i[0] === self.get('value');})
5585 });
5586 self.$el.html(content);5583 self.$el.html(content);
5587 },5584 },
5588 calc_domain: function() {5585 calc_domain: function() {
@@ -5604,8 +5601,7 @@
5604 */5601 */
5605 get_selection: function() {5602 get_selection: function() {
5606 var self = this;5603 var self = this;
5607 var selection_unfolded = [];5604 var selection = [];
5608 var selection_folded = [];
5609 var fold_field = this.options.fold_field;5605 var fold_field = this.options.fold_field;
56105606
5611 var calculation = _.bind(function() {5607 var calculation = _.bind(function() {
@@ -5617,11 +5613,7 @@
5617 return self.dataset.name_get(ids).then(function (records_name) {5613 return self.dataset.name_get(ids).then(function (records_name) {
5618 _.each(records, function (record) {5614 _.each(records, function (record) {
5619 var name = _.find(records_name, function (val) {return val[0] == record.id;})[1];5615 var name = _.find(records_name, function (val) {return val[0] == record.id;})[1];
5620 if (fold_field && record[fold_field] && record.id != self.get('value')) {5616 selection.push([record[fold_field], record.id, name]);
5621 selection_folded.push([record.id, name]);
5622 } else {
5623 selection_unfolded.push([record.id, name]);
5624 }
5625 });5617 });
5626 });5618 });
5627 });5619 });
@@ -5634,14 +5626,14 @@
5634 for(var i=0; i < select.length; i++) {5626 for(var i=0; i < select.length; i++) {
5635 var key = select[i][0];5627 var key = select[i][0];
5636 if(key == this.get('value') || !this.options.visible || this.options.visible.indexOf(key) != -1) {5628 if(key == this.get('value') || !this.options.visible || this.options.visible.indexOf(key) != -1) {
5637 selection_unfolded.push(select[i]);5629 select[i].unshift(false);
5630 selection.push(select[i]);
5638 }5631 }
5639 }5632 }
5640 return $.when();5633 return $.when();
5641 }5634 }
5642 }, this);5635 }, this);
5643 this.selection_dm.add(calculation()).then(function () {5636 this.selection_dm.add(calculation()).then(function () {
5644 var selection = {'unfolded': selection_unfolded, 'folded': selection_folded};
5645 if (! _.isEqual(selection, self.get("selection"))) {5637 if (! _.isEqual(selection, self.get("selection"))) {
5646 self.set("selection", selection);5638 self.set("selection", selection);
5647 }5639 }
56485640
=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml 2014-01-14 13:39:53 +0000
+++ addons/web/static/src/xml/base.xml 2014-02-19 10:14:51 +0000
@@ -1183,25 +1183,12 @@
1183 <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"/>1183 <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"/>
1184</t>1184</t>
1185<t t-name="FieldStatus.content">1185<t t-name="FieldStatus.content">
1186 <t t-foreach="widget.selection.unfolded" t-as="i">1186 <t t-foreach="widget.selection" t-as="i">
1187 <li t-att-class="i[0] === widget.get('value') ? 'oe_active' : ''" t-att-data-id="i[0]">1187 <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' : ''">
1188 <span class="label"><t t-esc="i[1]"/></span>1188 <span class="label"><t t-esc="i[0] ? '...' : i[2]"/></span>
1189 <!-- are you mit ? -->
1190 <span class="arrow"><span></span></span>1189 <span class="arrow"><span></span></span>
1191 </li>1190 </li>
1192 </t>1191 </t>
1193 <t t-if="widget.selection.folded.length">
1194 <li>
1195 <span class="label oe_dropdown_toggle oe_dropdown_arrow">More</span>
1196 <ul class="oe_dropdown_menu">
1197 <t t-foreach="widget.selection.folded" t-as="i">
1198 <li t-att-class="i[0] === widget.get('value') ? 'oe_active' : ''" t-att-data-id="i[0]">
1199 <span class="label"><t t-esc="i[1]"/></span>
1200 </li>
1201 </t>
1202 </ul>
1203 </li>
1204 </t>
1205</t>1192</t>
1206<t t-name="FieldBinaryImage">1193<t t-name="FieldBinaryImage">
1207 <span class="oe_form_field oe_form_field_image" t-att-style="widget.node.attrs.style">1194 <span class="oe_form_field oe_form_field_image" t-att-style="widget.node.attrs.style">
12081195
=== modified file 'addons/web_kanban/static/src/css/kanban.css'
--- addons/web_kanban/static/src/css/kanban.css 2014-01-27 17:24:14 +0000
+++ addons/web_kanban/static/src/css/kanban.css 2014-02-19 10:14:51 +0000
@@ -10,6 +10,7 @@
10 position: relative;10 position: relative;
11 max-width: none;11 max-width: none;
12 height: 100%;12 height: 100%;
13 top: 8%;
13}14}
14.openerp .oe_kanban_view .oe_view_nocontent .oe_view_nocontent_content {15.openerp .oe_kanban_view .oe_view_nocontent .oe_view_nocontent_content {
15 margin-left: 90px;16 margin-left: 90px;
1617
=== modified file 'addons/web_kanban/static/src/css/kanban.sass'
--- addons/web_kanban/static/src/css/kanban.sass 2014-01-27 17:24:14 +0000
+++ addons/web_kanban/static/src/css/kanban.sass 2014-02-19 10:14:51 +0000
@@ -57,6 +57,7 @@
57 position: relative57 position: relative
58 max-width: none58 max-width: none
59 height: 100%59 height: 100%
60 top: 8%
60 .oe_view_nocontent_content61 .oe_view_nocontent_content
61 margin-left: 90px62 margin-left: 90px
62 margin-top: 5px63 margin-top: 5px