Prevent exception if doesn't exist any payment_term.

issue3237
review917002
(transplanted from 64a62ed35a409e44326b9b7f93d0658ffedcb913)

--HG--
extra : transplant_source : d%A6.%D3Z%40%9ED2k%9B%7F%93%D0e%8F%FE%DC%B9%13