This question has been flagged
3566 Views

I need help for the next issue (We use the version 6.1 ):

I have developed a new type of invoice according with our needs, the invoice is visible on Accounting -> Customers/Suppliers -> Customer Invoices/ Supplier Invoices, click on an invoice, the section Reports (right side of screen- reports without wizard) The link of invoice is memored in the table "ir_values", and the report is memored in the table "ir_act_report_xml". The report is not memored on the database, so I don't have any object , I can not use the Access Rules for some rights. I need to hide the report (or the link of report) for some company. I tried to use the attribute invisible, for eg. attrs="{'invisible':[('company_id','=','2')]}", but is not working (for buttons is working).

How should I modify the next code to hide the report for a company with name "RO" or any other name?

<openerp> <data noupdate="1">

<record id="p5_internal_invoice_md_id" model="ir.actions.report.xml">
    <field name="name">P5 Internal Invoice MD</field>
    <field name="type">ir.actions.report.xml</field>
    <field name="model">account.invoice</field>
    <field name="report_name">p5_internal_invoice_md</field>
    <field name="groups">base.group_hr_user</field>
    <field name="report_type">aeroo</field>
    <field name="in_format">oo-ods</field>
    <field name="out_format">5</field>
    <field name="parser_loc">p5_report_internal_invoice_md/report/invoice_parser.py</field>
    <field name="report_rml">p5_report_internal_invoice_md/report/internal_invoice_md.ods</field>
    <field name="parser_state">loc</field>
    <field name="tml_source">file</field>
    <field name="groups">base.group_hr_user</field>
</record>

<ir_set>
    <field eval="'action'" name="key"/>
    <field eval="'client_print_multi'" name="key2"/>
    <field eval="['account.invoice']" name="models"/>
    <field name="name">Internal Invoice MD T11</field>
    <field eval="'ir.actions.report.xml,'+str(p5_internal_invoice_md_id)" name="value"/>
    <field eval="True" name="isobject"/>
    <field eval="True" name="replace"/>
    <field eval ="False" name="menu"/>
</ir_set>

</data> </openerp>

Thank you very, very much for your answers!!!

Avatar
Discard