Merge lp:~openerp-dev/openerp-web/trunk-kanban-column-avo into lp:openerp-web

Proposed by Amit Vora(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/trunk-kanban-column-avo
Merge into: lp:openerp-web
Diff against target: 76 lines (+8/-20)
2 files modified
addons/web/controllers/main.py (+1/-1)
addons/web_kanban/static/src/js/kanban.js (+7/-19)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-kanban-column-avo
Reviewer Review Type Date Requested Status
OpenERP R&D Web Team Pending
Review via email: mp+214031@code.launchpad.net

Description of the change

Hello,

I have fixed issue in project kanban view drag and drop the "Undefined" column somewhere => you will see all existing *projects* appear in the column.
Thanks
avo

To post a comment you must log in.
3911. By Amit Vora(OpenERP)

[MRG] merge with main branch

3912. By Amit Vora(OpenERP)

[MRG] merge with main barcnh

Unmerged revisions

3912. By Amit Vora(OpenERP)

[MRG] merge with main barcnh

3911. By Amit Vora(OpenERP)

[MRG] merge with main branch

3910. By Amit Vora(OpenERP)

[MERGE] merge with main branch

3909. By Chirag Dodiya(OpenERP)

[MRG]Merge with lp:openerp-web

3908. By Mahendra Barad(OpenERP)

[REV]unwanted changes

3907. By Mahendra Barad(OpenERP)

[Merge]with trunk

3906. By Mahendra Barad(OpenERP)

[IMP]pass context in resequence

3905. By Mahendra Barad(OpenERP)

[Merge]with trunk

3904. By Vidhin Mehta (OpenERP)

[MERGE]remove unwanted changes.

3903. By Vidhin Mehta (OpenERP)

[MREGE]Trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'addons/web/controllers/main.py'
--- addons/web/controllers/main.py 2014-05-06 16:34:22 +0000
+++ addons/web/controllers/main.py 2014-05-16 10:12:13 +0000
@@ -1076,7 +1076,7 @@
1076 return False1076 return False
1077 # python 2.6 has no start parameter1077 # python 2.6 has no start parameter
1078 for i, id in enumerate(ids):1078 for i, id in enumerate(ids):
1079 m.write(id, { field: i + offset })1079 m.write(id, { field: i + offset }, request.context)
1080 return True1080 return True
10811081
1082class View(http.Controller):1082class View(http.Controller):
10831083
=== modified file 'addons/web_kanban/static/src/js/kanban.js'
--- addons/web_kanban/static/src/js/kanban.js 2014-05-12 08:10:32 +0000
+++ addons/web_kanban/static/src/js/kanban.js 2014-05-16 10:12:13 +0000
@@ -208,22 +208,9 @@
208 form.on("on_button_cancel", am.dialog, function() { return am.dialog.$dialog_box.modal('hide'); });208 form.on("on_button_cancel", am.dialog, function() { return am.dialog.$dialog_box.modal('hide'); });
209 form.on('record_created', self, function(r) {209 form.on('record_created', self, function(r) {
210 (new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).done(function(new_record) {210 (new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).done(function(new_record) {
211 am.dialog.close();
212 self.do_reload();
211 am.dialog.$dialog_box.modal('hide');213 am.dialog.$dialog_box.modal('hide');
212 var domain = self.dataset.domain.slice(0);
213 domain.push([self.group_by, '=', new_record[0][0]]);
214 var dataset = new instance.web.DataSetSearch(self, self.dataset.model, self.dataset.get_context(), domain);
215 var datagroup = {
216 get: function(key) {
217 return this[key];
218 },
219 value: new_record[0],
220 length: 0,
221 aggregates: {},
222 };
223 var new_group = new instance.web_kanban.KanbanGroup(self, [], datagroup, dataset);
224 self.do_add_groups([new_group]).done(function() {
225 $(window).scrollTo(self.groups.slice(-1)[0].$el, { axis: 'x' });
226 });
227 });214 });
228 });215 });
229 },216 },
@@ -417,14 +404,14 @@
417 stop: function(event, ui) {404 stop: function(event, ui) {
418 var stop_index = ui.item.index();405 var stop_index = ui.item.index();
419 if (start_index !== stop_index) {406 if (start_index !== stop_index) {
420 var $start_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);407 var $start_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
421 var $stop_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);408 var $stop_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
422 var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter';409 var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter';
423 $start_column[method]($stop_column);410 $start_column[method]($stop_column);
424 var tmp_group = self.groups.splice(start_index, 1)[0];411 var tmp_group = self.groups.splice(start_index, 1)[0];
425 self.groups.splice(stop_index, 0, tmp_group);412 self.groups.splice(stop_index, 0, tmp_group);
426 var new_sequence = _.pluck(self.groups, 'value');413 var new_sequence = _.pluck(self.groups, 'value');
427 (new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).done(function(r) {414 (new instance.web.DataSet(self, self.group_by_field.relation, self.dataset.get_context())).resequence(new_sequence).done(function(r) {
428 if (r === false) {415 if (r === false) {
429 console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation);416 console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation);
430 }417 }
@@ -773,6 +760,7 @@
773 views: [[false, 'form']],760 views: [[false, 'form']],
774 type: 'ir.actions.act_window',761 type: 'ir.actions.act_window',
775 target: "new",762 target: "new",
763 context: self.dataset.get_context(),
776 flags: {764 flags: {
777 action_buttons: true,765 action_buttons: true,
778 }766 }
@@ -788,7 +776,7 @@
788 do_action_delete: function() {776 do_action_delete: function() {
789 var self = this;777 var self = this;
790 if (confirm(_t("Are you sure to remove this column ?"))) {778 if (confirm(_t("Are you sure to remove this column ?"))) {
791 (new instance.web.DataSet(self, self.view.group_by_field.relation)).unlink([self.value]).done(function(r) {779 (new instance.web.DataSet(self, self.view.group_by_field.relation, self.dataset.get_context())).unlink([self.value]).done(function(r) {
792 self.view.do_reload();780 self.view.do_reload();
793 });781 });
794 }782 }