Merge lp:~numerigraphe/openobject-client/6.x-o2m-focus-reset into lp:openobject-client/6.0

Proposed by Numérigraphe
Status: Needs review
Proposed branch: lp:~numerigraphe/openobject-client/6.x-o2m-focus-reset
Merge into: lp:openobject-client/6.0
Diff against target: 68 lines (+19/-3)
4 files modified
bin/widget/model/record.py (+1/-1)
bin/widget/screen/screen.py (+2/-2)
bin/widget/view/form_gtk/one2many_list.py (+1/-0)
bin/widget/view/list.py (+15/-0)
To merge this branch: bzr merge lp:~numerigraphe/openobject-client/6.x-o2m-focus-reset
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+138150@code.launchpad.net

Description of the change

Same proposal as https://code.launchpad.net/~numerigraphe/openobject-client/6.x-o2m-focus-reset/+merge/138148
I propose to include as a bugfix in 6.0.
Lionel Sausin

To post a comment you must log in.

Unmerged revisions

1792. By Chris Biersbach (OpenERP)

[FIX] Fix latest improvement in cases where the o2m field has more lines than can be displayed at once

1791. By Chris Biersbach (OpenERP)

[IMP] Keep the current selection in o2m tree views when parent record is reloaded

1790. By Chris Biersbach (OpenERP)

[IMP] Keep the current selection in o2m forms when parent record is reloaded

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/model/record.py'
2--- bin/widget/model/record.py 2012-02-28 09:14:57 +0000
3+++ bin/widget/model/record.py 2012-12-05 13:44:30 +0000
4@@ -397,7 +397,7 @@
5 else:
6 raise Exception, 'Unallowed button type'
7 if screen.current_model and screen.current_view.view_type != 'tree':
8- screen.reload()
9+ screen.reload(res_id=id)
10
11 del screen
12
13
14=== modified file 'bin/widget/screen/screen.py'
15--- bin/widget/screen/screen.py 2012-01-24 10:31:18 +0000
16+++ bin/widget/screen/screen.py 2012-12-05 13:44:30 +0000
17@@ -731,11 +731,11 @@
18 return True
19 return False
20
21- def reload(self):
22+ def reload(self, res_id=None):
23 self.current_model.reload()
24 if self.parent:
25 self.parent.reload()
26- self.display()
27+ self.display(res_id=res_id)
28
29 def remove(self, unlink = False):
30 id = False
31
32=== modified file 'bin/widget/view/form_gtk/one2many_list.py'
33--- bin/widget/view/form_gtk/one2many_list.py 2012-09-28 12:12:59 +0000
34+++ bin/widget/view/form_gtk/one2many_list.py 2012-12-05 13:44:30 +0000
35@@ -424,6 +424,7 @@
36 name = str(signal_data[0] + 1)
37 line = '(%s/%s of %s)' % (name, signal_data[1], signal_data[2])
38 self.label.set_text(line)
39+ self.pager.set_sensitivity()
40
41 def _sig_refresh(self, *args):
42 pass
43
44=== modified file 'bin/widget/view/list.py'
45--- bin/widget/view/list.py 2011-09-20 13:29:15 +0000
46+++ bin/widget/view/list.py 2012-12-05 13:44:30 +0000
47@@ -583,6 +583,21 @@
48 if self.screen.parent and isinstance(self.screen.parent, ModelRecord):
49 self.screen.parent.reload()
50 current_active_model.reload()
51+ # we force setting current_model here to avoid tree view blinking
52+ # (cause by view selecting the 1st record, then re-displaying itself,
53+ # then selecting real active record)
54+ self.screen.current_model = current_active_model
55+ if selection.get_mode() == gtk.SELECTION_MULTIPLE:
56+ path_active_model = self.store.on_get_path(current_active_model)
57+ if path_active_model not in paths:
58+ # clicked row is not in active selection,
59+ # select only the current row
60+ selection.select_path(path_active_model)
61+ else:
62+ # keep current rows selected
63+ for path in paths:
64+ selection.select_path(path)
65+ self.widget_tree.scroll_to_cell(path_active_model)
66
67 else:
68 # Here it goes for right click