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
1=== modified file 'addons/web/controllers/main.py'
2--- addons/web/controllers/main.py 2014-05-06 16:34:22 +0000
3+++ addons/web/controllers/main.py 2014-05-16 10:12:13 +0000
4@@ -1076,7 +1076,7 @@
5 return False
6 # python 2.6 has no start parameter
7 for i, id in enumerate(ids):
8- m.write(id, { field: i + offset })
9+ m.write(id, { field: i + offset }, request.context)
10 return True
11
12 class View(http.Controller):
13
14=== modified file 'addons/web_kanban/static/src/js/kanban.js'
15--- addons/web_kanban/static/src/js/kanban.js 2014-05-12 08:10:32 +0000
16+++ addons/web_kanban/static/src/js/kanban.js 2014-05-16 10:12:13 +0000
17@@ -208,22 +208,9 @@
18 form.on("on_button_cancel", am.dialog, function() { return am.dialog.$dialog_box.modal('hide'); });
19 form.on('record_created', self, function(r) {
20 (new instance.web.DataSet(self, self.group_by_field.relation)).name_get([r]).done(function(new_record) {
21+ am.dialog.close();
22+ self.do_reload();
23 am.dialog.$dialog_box.modal('hide');
24- var domain = self.dataset.domain.slice(0);
25- domain.push([self.group_by, '=', new_record[0][0]]);
26- var dataset = new instance.web.DataSetSearch(self, self.dataset.model, self.dataset.get_context(), domain);
27- var datagroup = {
28- get: function(key) {
29- return this[key];
30- },
31- value: new_record[0],
32- length: 0,
33- aggregates: {},
34- };
35- var new_group = new instance.web_kanban.KanbanGroup(self, [], datagroup, dataset);
36- self.do_add_groups([new_group]).done(function() {
37- $(window).scrollTo(self.groups.slice(-1)[0].$el, { axis: 'x' });
38- });
39 });
40 });
41 },
42@@ -417,14 +404,14 @@
43 stop: function(event, ui) {
44 var stop_index = ui.item.index();
45 if (start_index !== stop_index) {
46- var $start_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
47- var $stop_column = $('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
48+ var $start_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(start_index);
49+ var $stop_column = self.$('.oe_kanban_groups_records .oe_kanban_column').eq(stop_index);
50 var method = (start_index > stop_index) ? 'insertBefore' : 'insertAfter';
51 $start_column[method]($stop_column);
52 var tmp_group = self.groups.splice(start_index, 1)[0];
53 self.groups.splice(stop_index, 0, tmp_group);
54 var new_sequence = _.pluck(self.groups, 'value');
55- (new instance.web.DataSet(self, self.group_by_field.relation)).resequence(new_sequence).done(function(r) {
56+ (new instance.web.DataSet(self, self.group_by_field.relation, self.dataset.get_context())).resequence(new_sequence).done(function(r) {
57 if (r === false) {
58 console.error("Kanban: could not resequence model '%s'. Probably no 'sequence' field.", self.group_by_field.relation);
59 }
60@@ -773,6 +760,7 @@
61 views: [[false, 'form']],
62 type: 'ir.actions.act_window',
63 target: "new",
64+ context: self.dataset.get_context(),
65 flags: {
66 action_buttons: true,
67 }
68@@ -788,7 +776,7 @@
69 do_action_delete: function() {
70 var self = this;
71 if (confirm(_t("Are you sure to remove this column ?"))) {
72- (new instance.web.DataSet(self, self.view.group_by_field.relation)).unlink([self.value]).done(function(r) {
73+ (new instance.web.DataSet(self, self.view.group_by_field.relation, self.dataset.get_context())).unlink([self.value]).done(function(r) {
74 self.view.do_reload();
75 });
76 }