[FIX] lunch : do not display empty alert on form view

This commit is contained in:
Jérome Maes
2015-09-08 09:37:53 +02:00
parent 22b2c02bf3
commit 1addd02390
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ class LunchOrder(models.Model):
if alert.display]
if self.state == 'new':
self.alerts = '\n'.join(alert_msg)
self.alerts = alert_msg and '\n'.join(alert_msg) or False
@api.depends('state')
def _compute_get_previous_order_ids(self):
+3 -1
View File
@@ -394,7 +394,9 @@
</div>
</group>
</group>
<field name='alerts' attrs="{'invisible': ['|',('state','!=','new'),('alerts','=',False)]}" class="oe_inline alert alert-danger"/>
<div attrs="{'invisible': ['|',('state','!=','new'),('alerts','=',False)]}" class="oe_inline alert alert-danger">
<field name='alerts'/>
</div>
<field name='previous_order_ids' widget='previous_order'/>
<separator string='Select your order'/>
<field name='order_line_ids' nolabel='1'>