← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/fix_training_course_wizard into lp:~openobject-training/openobject-addons/training

 

gpa(Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/fix_training_course_wizard into lp:~openobject-training/openobject-addons/training.

Requested reviews:
  Bhumika (OpenERP) (sbh-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/fix_training_course_wizard/+merge/56543

Improvement in training module wizard validate courses and create standalone course
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/fix_training_course_wizard/+merge/56543
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/fix_training_course_wizard.
=== modified file 'training/wizard/training_create_offer.py'
--- training/wizard/training_create_offer.py	2011-03-21 12:26:03 +0000
+++ training/wizard/training_create_offer.py	2011-04-06 10:44:28 +0000
@@ -20,11 +20,15 @@
 ##############################################################################
 
 from osv import osv
+from osv import fields
 from tools.translate import _
 import netsvc
 
 class training_create_offer(osv.osv_memory):
     _name = 'training.create.offer'
+    _columns ={
+        'name': fields.char('Name', size=64),
+    }
 
     def default_get(self, cr, uid, fields, context=None):
         if context is None:

=== modified file 'training/wizard/training_validate_course.py'
--- training/wizard/training_validate_course.py	2011-03-21 12:26:03 +0000
+++ training/wizard/training_validate_course.py	2011-04-06 10:44:28 +0000
@@ -21,10 +21,26 @@
 ##############################################################################
 
 from osv import osv
+from osv import fields
 import netsvc
+from tools.translate import _
 
 class validate_courses(osv.osv_memory):
     _name = 'validate.courses'
+    _columns ={
+        'name': fields.char('Name', size=64),
+    }
+
+    def default_get(self, cr, uid, fields, context=None):
+        if context is None:
+            context = {}
+
+        if context.get('active_id',False):
+            course = self.pool.get('training.course').browse(cr, uid, context['active_id'], context=context)
+            if course.state_course == 'validated':
+                raise osv.except_osv(_('Warning'),_("You are not allow to validate the course which are already validate !"))
+
+        return {}
 
     def validate_courses(self, cr, uid, ids, context=None):
         if context is None:


Follow ups