• Jérome Perrin's avatar
    hal_json_style: Tolerate documents with non-utf8 properties · 49908326
    Jérome Perrin authored
    HAL JSON uses JSON, which uses UTF-8, but properties of ERP5 documents
    does not enforce any specific encoding, so if we happen to have
    documents with string properties that are not UTF-8 compatible, they
    could not be queried with HAL JSON (json.dumps was raising UnicodeError)
    
    This pre-process field default properties and document title to make
    sure they can be serialized as json. This assumes that configuration
    (form definition, actions, ...) will be valid UTF-8, but just does extra
    effort to make sure "broken" data can be displayed without error.
    
    /reviewed-on !928
    49908326
test.erp5.testHalJsonStyle.py 142 KB