This error occurs during advanced automatic matching when the document type (i.e., kind) for the issued advance payment ADVANCE is not set in the company settings (Company -> Settings -> Modules -> Sales -> Document types for automatic generation -> Issued advances).
Also check whether the original settings (which may apply to certain documents) are being respected in the company settings, and whether an incorrect document type (or no type at all) is specified there.
