diff --git a/trytond/ir/cron.py b/trytond/ir/cron.py
index 5fce54ef0a..407a70d5b1 100644
--- a/trytond/ir/cron.py
+++ b/trytond/ir/cron.py
@@ -23,7 +23,7 @@ class Cron(DeactivableMixin, ModelSQL, ModelView):
('days', 'Days'),
('weeks', 'Weeks'),
('months', 'Months'),
- ], "Interval Type", required=True)
+ ], "Interval Type", sort=False, required=True)
minute = fields.Integer("Minute",
states={
'invisible': Eval('interval_type').in_(['minutes']),
@@ -80,6 +80,14 @@ class Cron(DeactivableMixin, ModelSQL, ModelView):
def check_xml_record(crons, values):
return True
+ @classmethod
+ def view_attributes(cls):
+ return [
+ ('//label[@id="time_label"]', 'states', {
+ 'invisible': Eval('interval_type') == 'minutes',
+ }),
+ ]
+
def compute_next_call(self, now):
return (now
+ relativedelta(**{self.interval_type: self.interval_number})
diff --git a/trytond/ir/view/cron_form.xml b/trytond/ir/view/cron_form.xml
index 42a8881b17..97d51e88a8 100644
--- a/trytond/ir/view/cron_form.xml
+++ b/trytond/ir/view/cron_form.xml
@@ -13,14 +13,14 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
-
-
-
+
+
+
+
+
+