Child DocType does not trigger validate

I created Child DocType. When adding child doctype record. validate function is not trigger. What is the function that will be trigger if a child doctype is save?

share your script

@ccfiel controllers don’t work on child doctypes

This is my script

from __future__ import unicode_literals
import frappe
from frappe.model.document import Document

class Student(Document):

    def validate(self):
        if not self.middle_name:
            middle = ''
            middle = self.middle_name.strip()

        self.full_name = self.last_name.strip() + ', ' + self.first_name.strip() + ' ' + middle

and Student is a Child Table. It is under a Class Doctype. When you add a student in the Class DocType validate is not triggered.

@rmehta oh i see :slight_smile: so I will do it to its master table. Thanks!

1 Like