diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
| commit | 18e22be138f4d273ce8f63c0ff2c8a437cf6ce5d (patch) | |
| tree | 63bd658de7b6fa0e91d521ca19322dd68bdc1492 /addons/warning/warning.py | |
| parent | f6e5bf847b1a7107c09b009a757823b0f9514fa4 (diff) | |
| parent | 0aab81cd3ac6881b2b64ccedb901b55badd421d4 (diff) | |
[MERGE] forward port of branch 8.0 up to 0aab81c
Diffstat (limited to 'addons/warning/warning.py')
| -rw-r--r-- | addons/warning/warning.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/addons/warning/warning.py b/addons/warning/warning.py index 81bac3cdff5..954b0e96e95 100644 --- a/addons/warning/warning.py +++ b/addons/warning/warning.py @@ -76,7 +76,9 @@ class sale_order(osv.osv): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message'] - return {'value': result.get('value',{}), 'warning':warning} + if warning: + result['warning'] = warning + return result class purchase_order(osv.osv): @@ -104,7 +106,9 @@ class purchase_order(osv.osv): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message'] - return {'value': result.get('value',{}), 'warning':warning} + if warning: + result['warning'] = warning + return result @@ -143,7 +147,9 @@ class account_invoice(osv.osv): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message'] - return {'value': result.get('value',{}), 'warning':warning} + if warning: + result['warning'] = warning + return result class stock_picking(osv.osv): @@ -171,8 +177,9 @@ class stock_picking(osv.osv): warning['title'] = title and title +' & '+ result['warning']['title'] or result['warning']['title'] warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message'] - return {'value': result.get('value',{}), 'warning':warning} - + if warning: + result['warning'] = warning + return result class product_product(osv.osv): _inherit = 'product.template' @@ -221,7 +228,9 @@ class sale_order_line(osv.osv): warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title'] warning['message'] = message and message +'\n\n'+result['warning']['message'] or result['warning']['message'] - return {'value': result.get('value',{}), 'warning':warning} + if warning: + result['warning'] = warning + return result class purchase_order_line(osv.osv): @@ -252,4 +261,6 @@ class purchase_order_line(osv.osv): warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title'] warning['message'] = message and message +'\n\n'+result['warning']['message'] or result['warning']['message'] - return {'value': result.get('value',{}), 'warning':warning} + if warning: + result['warning'] = warning + return result |
