diff options
| author | Thibault Delavallée <tde@openerp.com> | 2014-08-07 14:43:21 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2014-08-07 16:47:59 +0200 |
| commit | 2e5412fc1d63516c8b4aefcb0bacd79d85b2d498 (patch) | |
| tree | 4862ee257362f0f2f3ee6dcb54a4eb04dd3c936a /addons/mail/mail_thread.py | |
| parent | e9f9bb5802e3db6a0dfe545f25d775eb15063f5c (diff) | |
[FIX] mail, BaseModel, portal_sale: fixes and improvements in the URL
management to access documents in notification emails, as well as for the
'view quotation' link in portal_sale module.
models: added a get_access_action method: basically, returns the action to
access a document. It uses the get_formview_action by default (form view
of the document). However for some documents we want to directly go to the
website, leading to an act_url action for some documents. This method allows
this behavior.
portal_sale: get_signup_url now uses the mail.action_mail_redirect method
instead of directly redirecting towards a portal menu. This allows to fall
back on a standard behavior.
portal_sale: get_formview_action updated, to match actions tailored for
portal users.
website_quote: get_access_action of sale order updated. If the sale order
has a template defined, the returned action is an act_url (website view
of the quotation), not the form action anymore.
mail: fixed signature + company signature in notification emails. Even without
user signature, the company signature + access link should be correct.
portal: signup url in notification emali was not using the mail redirection
as action. It is now the case.
Diffstat (limited to 'addons/mail/mail_thread.py')
| -rw-r--r-- | addons/mail/mail_thread.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 9125b775e49..0eb4d35c22d 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -627,7 +627,7 @@ class mail_thread(osv.AbstractModel): if params: msg_id = params.get('message_id') model = params.get('model') - res_id = params.get('res_id') + res_id = params.get('res_id', params.get('id')) # signup automatically generated id instead of res_id if not msg_id and not (model and res_id): return action if msg_id and not (model and res_id): @@ -641,7 +641,7 @@ class mail_thread(osv.AbstractModel): if model_obj.check_access_rights(cr, uid, 'read', raise_exception=False): try: model_obj.check_access_rule(cr, uid, [res_id], 'read', context=context) - action = model_obj.get_formview_action(cr, uid, res_id, context=context) + action = model_obj.get_access_action(cr, uid, res_id, context=context) except (osv.except_osv, orm.except_orm): pass action.update({ |
