Files
odoo_source/addons/mrp/models
Simon Lejeune e05333f8f5 [FIX] mrp: layout issue in workorder messages
The alert box was flickering if empty: at each click on the status
button, the box was appearing and disappearing quickly. This is probably
due to a bug in the form view that do not wait for the evaluation of the
attrs. This bug is fixed in the new views, but only if the attrs is
fixed. Indeed, as the attrs condition is

    attrs="{'invisible': [('production_messages', '=', False)]}"

the field was never set to False. This is because the compute method was
doing

    workorder.production_messages = "<br/>".join(messages)

So, even if `messages` was empty, production_messages will be set to ''.

In [1]: 'aaa'.join([])
Out[1]: ''

So we fix the condition to set False to the field if the string is
empty.

In [6]: 'aaa'.join([]) or False
Out[6]: False
2017-03-29 10:08:20 +02:00
..
2017-03-27 08:31:51 +02:00