[IMP] doc/howtos/backend: improve views, fix workflow
[odoo/odoo.git] / doc / howtos / backend / exercise-translations
1 Index: addons/openacademy/models.py
2 ===================================================================
3 --- addons.orig/openacademy/models.py   2014-08-26 17:26:19.919783076 +0200
4 +++ addons/openacademy/models.py        2014-08-26 17:26:19.915783076 +0200
5 @@ -1,7 +1,7 @@
6  # -*- coding: utf-8 -*-
7  
8  from datetime import timedelta
9 -from openerp import models, fields, api, exceptions
10 +from openerp import models, fields, api, exceptions, _
11  
12  class Course(models.Model):
13      _name = 'openacademy.course'
14 @@ -97,15 +97,15 @@
15          if self.seats < 0:
16              return {
17                  'warning': {
18 -                    'title': "Incorrect 'seats' value",
19 -                    'message': "The number of available seats may not be negative",
20 +                    'title': _("Incorrect 'seats' value"),
21 +                    'message': _("The number of available seats may not be negative"),
22                  },
23              }
24          if self.seats < len(self.attendee_ids):
25              return {
26                  'warning': {
27 -                    'title': "Too many attendees",
28 -                    'message': "Increase seats or remove excess attendees",
29 +                    'title': _("Too many attendees"),
30 +                    'message': _("Increase seats or remove excess attendees"),
31                  },
32              }
33  
34 @@ -147,4 +147,4 @@
35      @api.constrains('instructor_id', 'attendee_ids')
36      def _check_instructor_not_in_attendees(self):
37          if self.instructor_id and self.instructor_id in self.attendee_ids:
38 -            raise exceptions.ValidationError("A session's instructor can't be an attendee")
39 +            raise exceptions.ValidationError(_("A session's instructor can't be an attendee"))