Add demo CSV report on res.users

This commit is contained in:
Alexis de Lattre
2017-01-01 08:20:32 +01:00
committed by Daniel Reis
parent 584d9433b6
commit 862441a656
4 changed files with 26 additions and 1 deletions

View File

@@ -16,7 +16,9 @@ To add a text report, you should develop an Odoo module that contains:
* a Qweb template,
* a Qweb report definition with *report_type = qweb-txt*.
The module *purchase_dilicom_csv* available on the `dilicom Github repository <https://github.com/akretion/dilicom>`_ (branch *10.0*) is a good example: it adds a report *Dilicom CSV Order* on purchase orders. This report is a CSV file with one line per order line and 2 columns: EAN13 and order quantity.
This module provides a small demo report on *Users* called *CSV List*.
The module *purchase_dilicom_csv* available on the `dilicom Github repository <https://github.com/akretion/dilicom>`_ (branch *10.0*) is a better example: it adds a report *Dilicom CSV Order* on purchase orders. This report is a CSV file with one line per order line and 2 columns: EAN13 and order quantity.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot

View File

@@ -11,5 +11,6 @@
'author': 'Akretion,Odoo Community Association (OCA)',
'website': 'http://www.akretion.com',
'depends': ['report'],
'demo': ['demo/report.xml', 'demo/res_users_report.xml'],
'installable': True,
}

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report id="res_users_csv"
model="res.users"
name="report_qweb_txt.report_res_users_csv"
string="CSV List"
report_type="qweb-txt"
file="report_qweb_txt.report_res_users_csv"
/>
</odoo>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_res_users_csv">name;login;last_login_date;lang
<t t-foreach="docs" t-as="o"><t t-esc="o.name"/>;<t t-esc="o.login"/>;<t t-esc="o.login_date"/>;<t t-esc="o.lang"/>
</t>
</template>
</odoo>