This question has been flagged
3 Replies
8118 Views

I use attachment_use in xml report, but it doesn't work, can anyone help me? I want to define attachment_use as False.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report
            auto="False"
            id="account.account_invoices"
            model="account.invoice"
            name="aa.account_invoice"
            rml="aa/report/account_print_invoice.rml"
            string="Invoices"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
            attachment_use="0"
            usage="default"
            multi="True"
            header="True"/>
    </data>
</openerp>

And then, I upgrade my modul aa, but attachment_use is always True.

Avatar
Discard

I got the same problem... any update about this?

Best Answer

Hi, Try  to rewrite your report.Works very well and successfully

<record id="account.account_invoices" model="ir.actions.report.xml">

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

</record>

Avatar
Discard

This does work really well, I will make a proper answer, for others who should ask.

Best Answer

Hi,

make it like this: attachment_use="True"

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

Avatar
Discard
Author

Thanks but sorry I didn't explain my question clearly. Now, attachment_use is True, but I want to define it as False. But it doesn't work.

Best Answer

Hi,

Like Juan Carlos Hernández Funes said, the <record id= form works really well. Here's my working code :

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="account.account_invoices" model="ir.actions.report.xml">
            <field name="auto" eval="False"/>
            <field name="model">account.invoice</field>
            <field name="report_name">custom.account.invoice</field><!-- name is called report_name in this form -->
            <field name="name">Invoices</field><!-- string is called name -->
            <field name="report_rml">account_payment_method/report/account_print_invoice.rml</field><!-- same here rml -> eport_rml -->
            <field name="attachment">"(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"</field>
            <field name="attachment_use" eval="False"/>
            <field name="usage">default</field>
        </record>
    </data>
</openerp>

If someone could accept this, that would help later openerp developpers :)

Avatar
Discard