I have a custom module and created a custom paperformat.
__openerp__.py
{
'name': " POS Template",
'author': "Ashiong",
'version': '1.0',
'description': """
- Test
""",
'depends': ['stock',
],
'data': [
'data/report_paperformat.xml',
'views/delivery_receipt_report.xml',
'views/picking_report.xml',
],
'auto_install': False,
}picking_report.xml
<report
id="action_report_delivery_receipt"
string="Delivery Receipt (Test POS)" model="stock.picking" report_type="qweb-pdf" name="my_module.test_delivery_receipt" file="my_module.test_delivery_receipt" />
<record id="action_report_test_delivery_receipt" model="ir.actions.report.xml"> <field name="paperformat_id" ref="my_module.test_pos_paperformat"/> </record>
report_paperformat.xml
<!-- POS -->
<record id="test_pos_paperformat" model="report.paperformat">
<field name="name">Test Paperformat</field>
<field name="default" eval="True" />
<field name="format">custom</field>
<field name="page_height">150</field>
<field name="page_width">60</field>
<field name="orientation">Portrait</field>
<field name="margin_top">3</field>
<field name="margin_bottom">3</field>
<field name="margin_left">3</field>
<field name="margin_right">3</field>
<field name="header_line" eval="False" />
<field name="header_spacing">3</field>
<field name="dpi">130</field>
</record>
Once I install my custom module, the system will return an error message:
ParseError: "null value in column "name" violates not-null constraint
DETAIL: Failing row contains (710, 1, 2017-08-10 10:18:05.557211, null, 1, 2017-08-10 10:18:05.557211, null, ir.actions.report.xml, null, null, t, pdf, null, null, null, null, t, null, f, null, null, null, f, null, 28, 80, null, 1, database, null, null, 1, off, utf_8, f, class Parser(report_sxw.rml_parse):
def __init__(self, cr, u..., static, f, default, default, null, t, f, null, oo-odt, null).
" while parsing /home/custom_addons/my_module/views/picking_report.xml:13, near
<record id="action_report_pos_delivery_receipt" model="ir.actions.report.xml">
<field name="paperformat_id" ref="my_module.test_pos_paperformat"/>
</record>