Help

3

attachment_use doesn't work

Avatar
Toutou

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.

1 Comment
Avatar
Discard
Avatar
Houssine BAKKALI
-

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

3 Answers
1
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>

1 Comment
Avatar
Discard
Avatar
PY
-

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

0
Best Answer

Hi,

make it like this: attachment_use="True"

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

1 Comment
Avatar
Discard
Avatar
Toutou
-

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.

0
Avatar
PY
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