Fix _rebuild_tree to take in account inactive records

issue3509
review2401002
Validate only modified and dependant fields on model write

issue3445
review1371002