Salve a tutti!
Ho creato un modulo che mi permetta di stampare alcuni report PDF (usando Qweb).
Tutto funziona correttamente, ma non riesco a creare un apposito paperformat customizzato.
Ho creato la struttura nel file "data/report_paperformat.xml"
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="paperformat_new" model="report.paperformat">
<field name="name">NEW</field>
<field name="format">custom</field>
<field name="page_height">105</field>
<field name="page_width">210</field>
<field name="orientation">Portrait</field>
<field name="margin_top">6</field>
<field name="margin_bottom">6</field>
<field name="margin_left">6</field>
<field name="margin_right">6</field>
<field name="header_line" eval="False" />
<field name="header_spacing">0</field>
<field name="dpi">90</field>
</record>
</data>
</openerp>
E ho inserito il record relativo nel file "report_view.xml"
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_report" model="ir.actions.report.xml">
<field name="paperformat_id" ref="print_report.paperformat_new"/>
</record>
</data>
</openerp>
Il problema è che installando il tutto ho un errore
ParseError: "null value in column "name" violates not-null constraint
DETAIL: Failing row contains (513, 1, 2015-10-05 08:24:15.738903, null, 1, 2015-10-05 08:24:15.738903, null, ir.actions.report.xml, null, null, t, null, t, pdf, null, f, null, null, null, null, null, null, null, f, null, f, null, f).
" while parsing /opt/bitnami/apps/odoo/lib/openerp-8.0_83bd9ee-py2.7.egg/openerp/addons/print_report/report_view.xml:14, near
<record id="action_report" model="ir.actions.report.xml">
<field name="paperformat_id" ref="print_report.paperformat_new"/>
</record>
Avete suggerimenti?
PS Per creare la struttura mi sono basato su
questo modulo trovato in rete.