Apply xTuple patches for #2096355 #2104341 #2096361.
Merge pull request #2 from bendiy/master

Apply xTuple patches for #2096355 #2104341 #2096361.