콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
6994 화면

I try create a paper format for a report template, I have this error message:


odoo.tools.convert.ParseError: "null value in column "name" violates not-null constraint

DETAIL:  Failing row contains (959, null, ir.actions.report, null, null, report, list,form, 1, 2021-03-12 17:35:13.849794, 1, 2021-03-12 17:35:13.849794, null, qweb-pdf, null, null, null, 77, null, null, null).


The code that I wrote is this:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="purchase_paper_format" model="report.paperformat">
<field name="name">Purchase Order</field>
<field name="default" eval="False"/>
<field name="format">custom</field>
<field name="page_height">297</field>
<field name="page_width">210</field>
<field name="orientation">Portrait</field>
<field name="margin_top">3</field>
<field name="margin_left">15</field>
<field name="margin_right">15</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">3</field>
<field name="dpi">120</field>
</record>

<record id="purchase_format" model="ir.actions.report">
<field name="paperformat_id" ref="report_purchase_order.purchase_paper_format"/>
</record>
</data>
</odoo>
아바타
취소
베스트 답변

To eliminate the error, replace the below-mentioned coding with the correct one.

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <data>

        <record id="purchase_paper_format" model="report.paperformat">

            <field name="name">Purchase Order</field>

            <field name="default" eval="False"/>

            <field name="format">custom</field>

            <field name="page_height">297</field>

            <field name="page_width">210</field>

            <field name="orientation">Portrait</field>

            <field name="margin_top">3</field>

            <field name="margin_left">15</field>

            <field name="margin_right">15</field>

            <field name="header_line" eval="False"/>

            <field name="header_spacing">3</field>

            <field name="dpi">120</field>

        </record>


Replace:

        <record id="purchase_format" model="ir.actions.report">

            <field name="paperformat_id" ref="report_purchase_order.purchase_paper_format"/>

        </record>

    </data>

</odoo>


With:

<record id="purchase.action_report_purchase_order" model="ir.actions.report"> <field name="paperformat_id" ref="report_purchase_order.purchase_paper_format"/> </record>

아바타
취소
베스트 답변

Hi,
Here the issue on ir.action.report. In this model, the name field is mandatory and you aren’t added. So if you create a report please add all the necessary information.
If you are trying to add paper format for an existing report. Please add the module name of the report was originally defined, before the record id as follows

<record id="module_name.purchase_format" model="ir.actions.report">
<field name="paperformat_id" ref="report_purchase_order.purchase_paper_format"/>
</record>

I think this may help you.
For more information about PDF reports in Odoo 14 refer the blog
https://www.cybrosys.com/blog/how-to-create-pdf-report-odoo-14

Hope it helps


아바타
취소
관련 게시물 답글 화면 활동
0
7월 22
40
1
3월 21
10127
3
5월 24
2848
1
9월 24
6597
0
1월 22
1863