diff options
| author | Jérome Maes <jem@openerp.com> | 2015-09-07 14:09:17 +0200 |
|---|---|---|
| committer | Jérome Maes <jem@openerp.com> | 2015-09-08 09:37:53 +0200 |
| commit | 1addd02390f8aaa540acfcb698e7b4e9151ccf4e (patch) | |
| tree | bc99c377ab8b09131627bf9351f58c166f8705d3 /addons | |
| parent | 22b2c02bf3a4286aa8d1bfd7f79a223fc2c1b276 (diff) | |
[FIX] lunch : do not display empty alert on form view
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/lunch/models/lunch.py | 2 | ||||
| -rw-r--r-- | addons/lunch/views/lunch_views.xml | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/addons/lunch/models/lunch.py b/addons/lunch/models/lunch.py index eb5b803065b..85059464886 100644 --- a/addons/lunch/models/lunch.py +++ b/addons/lunch/models/lunch.py @@ -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): diff --git a/addons/lunch/views/lunch_views.xml b/addons/lunch/views/lunch_views.xml index 26cb255fcfb..d772141149b 100644 --- a/addons/lunch/views/lunch_views.xml +++ b/addons/lunch/views/lunch_views.xml @@ -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'> |
