Last active
August 29, 2015 14:23
-
-
Save mrvdb/75b583c649c34bee02bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT xmlroot ( | |
xmlelement( | |
name "address-book", | |
xmlattributes ('ODOO addresses' as name), | |
xmlagg(person)), | |
version '1.0', | |
standalone YES) | |
FROM ( | |
SELECT xmlelement( | |
name person, | |
xmlattributes(id as uid, name as "nick-name", name as cn), | |
xmlelement( | |
name "address-list", | |
xmlelement( | |
name "address", | |
xmlattributes(id||'-1' as uid, email as email)) | |
)) as person | |
FROM res_partner | |
WHERE email IS NOT NULL AND | |
is_company = False AND | |
active = True ) as people |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment