diff options
| author | Thibault Delavallée <tde@odoo.com> | 2016-11-04 12:02:27 +0100 |
|---|---|---|
| committer | Thibault Delavallée <tde@odoo.com> | 2017-02-13 16:58:47 +0100 |
| commit | cf1df16aea5d23006184f51a20c18f5bf3dd6d8c (patch) | |
| tree | 481e809b62abc01224a3b5261922f3e082375b42 /addons/website_quote/controllers/main.py | |
| parent | 9363b63a5c636122e4c1502a7e944cef718e915c (diff) | |
[IMP] payment_*, website_quote: change callback_eval string to parameters
callback_eval is currently a code string that is evaluated directly
at payment confirmation. This commit changes it to have parameters
on the record and method to call on it. Moreover a hash done once at
transaction creation ensure that a modified transaction does not allow
to execute code on other records.
Diffstat (limited to 'addons/website_quote/controllers/main.py')
| -rw-r--r-- | addons/website_quote/controllers/main.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/website_quote/controllers/main.py b/addons/website_quote/controllers/main.py index 0fcb9485d76..1d151ee05a6 100644 --- a/addons/website_quote/controllers/main.py +++ b/addons/website_quote/controllers/main.py @@ -189,7 +189,9 @@ class sale_quote(http.Controller): 'partner_id': Order.partner_id.id, 'reference': PaymentTransaction.get_next_reference(Order.name), 'sale_order_id': Order.id, - 'callback_eval': "self.sale_order_id._confirm_online_quote(self)" + 'callback_model_id': request.env['ir.model'].sudo().search([('model', '=', Order._name)], limit=1).id, + 'callback_res_id': Order.id, + 'callback_method': '_confirm_online_quote', }) request.session['quote_%s_transaction_id' % Order.id] = Transaction.id |
