Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Defining the data model

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 132
    Comment on it

    If you want to make data model in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file:

    session_ids = fields.One2many(
            'openacademy.session', 'course_id', string="Sessions")
    
        @api.multi
        def copy(self, default=None):
            default = dict(default or {})
    
            copied_count = self.search_count(
                [('name', '=like', u"Copy of {}%".format(self.name))])
            if not copied_count:
                new_name = u"Copy of {}".format(self.name)
            else:
                new_name = u"Copy of {} ({})".format(self.name, copied_count)
    
            default['name'] = new_name
            return super(Course, self).copy(default)
    
        _sql_constraints = [
            ('name_description_check',
             'CHECK(name != description)',
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: