diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-03-29 15:31:55 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-03-29 16:00:31 +0200 |
| commit | 04f896b135f3054496b0badc2b07afd2e8f03c19 (patch) | |
| tree | ab47fce283dd651fa43d5484dccb01ca18a40e0d /addons/warning/warning.py | |
| parent | 11d3aaf8485ea25dcb45716c18df75fb13d0ba7e (diff) | |
[FIX] warning: onchange_partner_id
When the warning module is installed, `onchange_picking_type` is not
called anymore.
When the method `onchange_picking_type` was introduced, it was not taken
into account that the warning module would change the onchange property
on the `partner_id` field thanks to the method `onchange_partner_id`.
opw-672091
Fixes #11342
Diffstat (limited to 'addons/warning/warning.py')
| -rw-r--r-- | addons/warning/warning.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/addons/warning/warning.py b/addons/warning/warning.py index 23fb8e9f9c1..0c971a2a82e 100644 --- a/addons/warning/warning.py +++ b/addons/warning/warning.py @@ -142,7 +142,7 @@ class account_invoice(osv.osv): class stock_picking(osv.osv): _inherit = 'stock.picking' - def onchange_partner_id(self, cr, uid, ids, partner_id=None, context=None): + def onchange_picking_type(self, cr, uid, ids, picking_type_id, partner_id, context=None): if not partner_id: return {} partner = self.pool.get('res.partner').browse(cr, uid, partner_id, context=context) @@ -167,12 +167,20 @@ class stock_picking(osv.osv): if partner.picking_warn == 'block': return {'value': {'partner_id': False}, 'warning': warning} - result = {'value': {}} + result = super(stock_picking, self).onchange_picking_type(cr, uid, ids, picking_type_id, partner_id, context=context) + if result.get('warning', False): + warning['title'] = title and title + ' & '+ result['warning']['title'] or result['warning']['title'] + warning['message'] = message and message + ' ' + result['warning']['message'] or result['warning']['message'] if warning: result['warning'] = warning return result + # FORWARD-PORT UP TO SAAS-10, REMOVE THIS METHOD IN MASTER + def onchange_partner_id(self, cr, uid, ids, partner_id=None, context=None): + return self.onchange_picking_type(cr, uid, ids, False, partner_id, context=context) + + class product_product(osv.osv): _inherit = 'product.template' _columns = { |
