Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Whats the correct ir.model.access.csv rule for a report in v7

By
Sascha Pfeiffer
on 1/7/15, 8:17 AM 675 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

noone?

Sascha Pfeiffer
on 1/9/15, 2:21 AM

I think I need more detail about it.

Hardikgiri Goswami
on 1/9/15, 2:53 AM

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.

Sascha Pfeiffer
on 1/9/15, 3:14 AM

Im still looking for help :/

Sascha Pfeiffer
on 1/12/15, 3:58 AM
0
Sascha Pfeiffer
On 1/22/15, 3:59 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/7/15, 8:17 AM
Seen: 675 times
Last updated: 3/16/15, 8:10 AM