This question has been flagged
1 Reply
2941 Views

Hi,

I made a small "hack" so I can print invoices directly, without downloading them (like explained here: https://www.odoo.com/forum/help-1/question/how-can-i-prevent-the-base-print-invoice-button-from-downloading-71352).

The problem right now is, that those two buttons for downloading and printing an invoices now only show for the admin user, so its obviously a missconfiguration of the access rules. How do those rules for the ir.model.access.csv need to look like, if I want the "normal" behaviour that the print button had before for both of my buttons. The records in my xml look similar to report_webkit's entries:

    <data>
        <report
            auto="False"
            id="account.account_invoices"
            model="account.invoice"
            name="account.invoice"
            file="partnerdetails/report/account_invoice.mako"
            string="Download Invoice"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
            attachment_use="1"
            multi="True"
            report_type="webkit"/>
    </data>
    <data noupdate="1">
        <record id="account.account_invoices" model="ir.actions.report.xml">
            <field name="webkit_header" ref="base_headers_webkit.base_reports_portrait_header"></field>
        </record>
    </data>
    <data>
        <report
            auto="False"
            id="account_invoices"
            model="account.invoice"
            name="account.invoice2"
            file="partnerdetails/report/account_invoice.mako"
            string="Print Invoice"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/',''))"
            attachment_use="1"
            multi="True"
            report_type="webkit"/>
    </data>
    <data noupdate="1">
        <record id="account_invoices" model="ir.actions.report.xml">
            <field name="webkit_header" ref="base_headers_webkit.base_reports_portrait_header"></field>
        </record>
    </data>

Thanks in advance

Avatar
Discard
Author

noone?

I think I need more detail about it.

Author

Hm not sure what more I can tell you. In general I added a second report and renamed the old report so it not called "Download Invoice" instead of "Invoice". The Print button on top of invoices looks now for the admin like this: http://fs2.directupload.net/images/141223/54den9n4.jpg but is completly invisible for other users.

Author

Im still looking for help :/

Author Best Answer

I "found" a solution for this by myself. I gave every user "printer operator" rights, which comes with base_report_to_printer addon.

Avatar
Discard