Merge lp:~unifield-team/unifield-web/uf_73-add_button_name_on_save into lp:unifield-web

Proposed by Quentin THEURET @Amaris
Status: Merged
Merged at revision: 4533
Proposed branch: lp:~unifield-team/unifield-web/uf_73-add_button_name_on_save
Merge into: lp:unifield-web
Diff against target: 23 lines (+4/-1)
1 file modified
addons/openerp/controllers/form.py (+4/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/uf_73-add_button_name_on_save
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+57826@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 2011-03-01 16:42:37 +0000
3+++ addons/openerp/controllers/form.py 2011-04-15 09:18:26 +0000
4@@ -395,15 +395,18 @@
5 # bypass save, for button action in non-editable view
6 if params.editable:
7 if not params.id:
8-
9 if params.default_o2m:
10 data.update(params.default_o2m)
11 ctx = dict((params.context or {}), **rpc.session.context)
12+ if params.button and params.button.name:
13+ ctx.update({'button': params.button.name})
14 params.id = int(Model.create(data, ctx))
15 params.ids = (params.ids or []) + [params.id]
16 params.count += 1
17 else:
18 ctx = utils.context_with_concurrency_info(params.context, params.concurrency_info)
19+ if params.button and params.button.name:
20+ ctx.update({'button': params.button.name})
21 Model.write([params.id], data, ctx)
22
23 tw.ConcurrencyInfo.update(

Subscribers

People subscribed via source and target branches

to all changes: