Browse Source

Fixes

pull/405/head
Iván Todorovich 8 years ago
parent
commit
d96d8f4542
  1. 2
      web_dashboard_tile/README.rst
  2. 9
      web_dashboard_tile/models/tile_tile.py
  3. 2
      web_dashboard_tile/static/src/css/tile.css

2
web_dashboard_tile/README.rst

@ -34,6 +34,7 @@ possible future improvments
=========================== ===========================
* add icons; * add icons;
* support client side action (like inbox); * support client side action (like inbox);
* restore original Domain + Filter when an action is set.
Bug Tracker Bug Tracker
=========== ===========
@ -52,6 +53,7 @@ Contributors
* Markus Schneider <markus.schneider at initos.com> * Markus Schneider <markus.schneider at initos.com>
* Sylvain Le Gal (https://twitter.com/legalsylvain) * Sylvain Le Gal (https://twitter.com/legalsylvain)
* Iván Todorovich <ivan.todorovich@gmail.com>
Maintainer Maintainer
---------- ----------

9
web_dashboard_tile/models/tile_tile.py

@ -35,7 +35,7 @@ class TileTile(models.Model):
'datetime': datetime, 'datetime': datetime,
'relativedelta': relativedelta, 'relativedelta': relativedelta,
'context_today': _context_today, 'context_today': _context_today,
'current_date': time.strftime('%Y-%m-%d'),
'current_date': fields.Date.today(),
}) })
return context return context
@ -111,13 +111,13 @@ class TileTile(models.Model):
def _check_model_id_field_id(self): def _check_model_id_field_id(self):
if self.field_id and self.field_id.model_id.id != self.model_id.id: if self.field_id and self.field_id.model_id.id != self.model_id.id:
raise ValidationError( raise ValidationError(
_("Please select a field of the selected model."))
_("Please select a field from the selected model."))
@api.one @api.one
@api.constrains('field_id', 'field_function') @api.constrains('field_id', 'field_function')
def _check_field_id_field_function(self): def _check_field_id_field_function(self):
if self.field_id and not self.field_function or\
self.field_function and not self.field_id:
validations = self.field_id, self.field_function
if any(validations) and not all(validations):
raise ValidationError( raise ValidationError(
_("Please set both: 'Field' and 'Function'.")) _("Please set both: 'Field' and 'Function'."))
@ -139,7 +139,6 @@ class TileTile(models.Model):
if self.action_id: if self.action_id:
res.update(self.action_id.read( res.update(self.action_id.read(
['view_type', 'view_mode', 'type'])[0]) ['view_type', 'view_mode', 'type'])[0])
# FIXME: restore original Domain + Filter would be better
return res return res
@api.model @api.model

2
web_dashboard_tile/static/src/css/tile.css

@ -49,4 +49,4 @@
.openerp .oe_searchview_drawer .oe_opened .oe_dashboard_tile_form { .openerp .oe_searchview_drawer .oe_opened .oe_dashboard_tile_form {
display: block; display: block;
}
}
Loading…
Cancel
Save