[FIX] warning: stock picking warnings

Warnings on pickings no longer worked, while it was possible
to set them in the partner form.

The problem comes from the fact onchange_partner_in no longer exists
on the picking form, by default. It was therefore never called,
on the warning never displayed.

opw-628956
This commit is contained in:
Denis Ledoux 2015-03-02 12:08:43 +01:00
parent 2bc75369dc
commit 19ce5932e2
2 changed files with 12 additions and 4 deletions

View File

@ -172,10 +172,7 @@ class stock_picking(osv.osv):
if partner.picking_warn == 'block':
return {'value': {'partner_id': False}, 'warning': warning}
result = super(stock_picking_in, self).onchange_partner_in(cr, uid, ids, partner_id, 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']
result = {'value': {}}
if warning:
result['warning'] = warning

View File

@ -60,5 +60,16 @@
</field>
</record>
<record id="view_picking_form" model="ir.ui.view">
<field name="name">stock.picking.form.warning</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<field name="partner_id" position="attributes">
<attribute name="on_change">onchange_partner_in(partner_id)</attribute>
</field>
</field>
</record>
</data>
</openerp>