Add missing on delete CASCADE on template - lot type

issue3893
review8311002