Merge lp:~unifield-team/unifield-web/us_439 into lp:unifield-web

Proposed by jftempo on 2015-08-28
Status: Merged
Merge reported by: jftempo
Merged at revision: not available
Proposed branch: lp:~unifield-team/unifield-web/us_439
Merge into: lp:unifield-web
Diff against target: 84 lines (+9/-3)
5 files modified
addons/openerp/controllers/form.py (+1/-1)
addons/openerp/controllers/templates/form.mako (+1/-1)
addons/openerp/widgets/form/_form.py (+1/-0)
addons/openerp/widgets/listgrid.py (+5/-1)
addons/openerp/widgets/screen.py (+1/-0)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/us_439
Reviewer Review Type Date Requested Status
UniField Reviewer Team 2015-08-28 Pending
Review via email: mp+269513@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/form.py'
2--- addons/openerp/controllers/form.py 2015-07-30 07:16:05 +0000
3+++ addons/openerp/controllers/form.py 2015-08-28 14:39:42 +0000
4@@ -219,7 +219,7 @@
5 buttons = TinyDict() # toolbar
6 buttons.new = (not editable or mode == 'tree') and mode != 'diagram' and form.screen.button_new
7 buttons.edit = not editable and (mode == 'form' or mode == 'diagram') and form.screen.button_edit
8- buttons.save = editable and mode == 'form'
9+ buttons.save = editable and mode == 'form' and form.screen.button_save
10 buttons.duplicate = form.screen.button_duplicate
11 buttons.cancel = editable and mode == 'form'
12 buttons.delete = not editable and mode == 'form' and form.screen.button_delete
13
14=== modified file 'addons/openerp/controllers/templates/form.mako'
15--- addons/openerp/controllers/templates/form.mako 2014-08-27 15:03:43 +0000
16+++ addons/openerp/controllers/templates/form.mako 2015-08-28 14:39:42 +0000
17@@ -123,7 +123,7 @@
18 <a href="javascript: void(0);" onclick="editRecord(${form.screen.id or 'null'})" class="button-a">${_("Edit")}</a>
19 </li>
20 % endif
21- % if buttons.save:
22+ % if buttons.save and not form.screen.widget.hide_button_edit:
23 <li title="${_('Save this resource')}">
24 <a href="javascript: void(0);" onclick="submit_form('save')" class="button-a">${_("Save")}</a>
25 </li>
26
27=== modified file 'addons/openerp/widgets/form/_form.py'
28--- addons/openerp/widgets/form/_form.py 2014-10-07 12:31:45 +0000
29+++ addons/openerp/widgets/form/_form.py 2015-08-28 14:39:42 +0000
30@@ -759,6 +759,7 @@
31 self.hide_button_new = attrs.get('hide_new_button', False)
32 self.hide_button_delete = attrs.get('hide_delete_button', False)
33 self.hide_button_edit = attrs.get('hide_edit_button', False)
34+ self.hide_button_save = attrs.get('hide_save_button', False)
35 self.link = attrs.get('link', nolinks)
36 self.model = model
37 self.id = None
38
39=== modified file 'addons/openerp/widgets/listgrid.py'
40--- addons/openerp/widgets/listgrid.py 2015-08-07 12:38:06 +0000
41+++ addons/openerp/widgets/listgrid.py 2015-08-28 14:39:42 +0000
42@@ -41,7 +41,8 @@
43 template = "/openerp/widgets/templates/listgrid/listgrid.mako"
44 params = ['name', 'data', 'columns', 'headers', 'model', 'selectable', 'editable', 'noteditable', 'resequencable',
45 'pageable', 'selector', 'source', 'offset', 'limit', 'show_links', 'editors', 'view_mode',
46- 'hiddens', 'edit_inline', 'field_total', 'field_real_total', 'link', 'checkbox_name', 'm2m', 'min_rows', 'string', 'o2m', 'dashboard', 'impex', 'hide_new_button', 'hide_delete_button', 'hide_edit_button', 'notselectable']
47+ 'hiddens', 'edit_inline', 'field_total', 'field_real_total', 'link', 'checkbox_name', 'm2m', 'min_rows', 'string', 'o2m', 'dashboard', 'impex',
48+ 'hide_new_button', 'hide_delete_button', 'hide_edit_button', 'hive_save_button', 'notselectable']
49
50 member_widgets = ['pager', 'buttons', 'editors', 'concurrency_info']
51
52@@ -69,6 +70,7 @@
53 hide_new_button = False
54 hide_delete_button = False
55 hide_edit_button = False
56+ hide_save_button = False
57
58 def __init__(self, name, model, view, ids=[], domain=[], context={}, **kw):
59
60@@ -129,10 +131,12 @@
61 self.hide_new_button = False
62 self.hide_delete_button = False
63 self.hide_edit_button = False
64+ self.hide_save_button = False
65 try:
66 self.hide_new_button = expr_eval(attrs.get('hide_new_button', False), {'context': context})
67 self.hide_delete_button = expr_eval(attrs.get('hide_delete_button', False), {'context': context})
68 self.hide_edit_button = expr_eval(attrs.get('hide_edit_button', False), {'context': context})
69+ self.hide_save_button = expr_eval(attrs.get('hide_save_button', False), {'context': context})
70 except:
71 pass
72
73
74=== modified file 'addons/openerp/widgets/screen.py'
75--- addons/openerp/widgets/screen.py 2015-08-06 14:35:56 +0000
76+++ addons/openerp/widgets/screen.py 2015-08-28 14:39:42 +0000
77@@ -148,6 +148,7 @@
78 self.button_new = (self.widget or False) and view_type == 'form' and not self.widget.hide_button_new
79 self.button_delete = (self.widget or False) and view_type == 'form' and not self.widget.hide_button_delete
80 self.button_edit = (self.widget or False) and view_type == 'form' and not self.widget.hide_button_edit
81+ self.button_save = (self.widget or False) and view_type == 'form' and not self.widget.hide_button_save
82
83 toolbar = {}
84 for item, value in view.get('toolbar', {}).items():

Subscribers

People subscribed via source and target branches

to all changes: