Visibility of the reports (the section Reports - right side of the screen) on a company

Asked by Viorica Ibasfalean

Hello,

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

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?

<?xml version="1.0"?>
<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>

2. Another question is how can I make a report (the kind of report described at point 1) visible only for Internal Moves (Warehouse->Warehouse Management->Internal Moves) and invisible for the othes options in Warehosue Management.

3. The last question is about Accounting ->Cash and Bank->Cash Registers.
    A Cash register is opened, on line of a Cash Transactions I have a button that I need to hide for some companies.

   The button is on the object "account.bank.statement.line", if I use the next code , the button is hidden for a Cash transaction with field "Communication"=2.

  <?xml version="1.0" ?>
<openerp>
  <data>
    <!--
      changes to 'account.bank.statement.tree/form' views
      -->
     <record id="view_cash_statement_tree_voucher" model="ir.ui.view">
            <field name="name">account.cash.statement.voucher.tree.inherit</field>
            <field name="model">account.bank.statement</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="account.view_bank_statement_form2"/>
            <field name="arch" type="xml">
                <xpath expr="/form/notebook/page/field[@name='line_ids']/tree/field[@name='date']" position="before">
                    <button name="action_report" string="Report" type="object" icon="gtk-execute" attrs="{'invisible':[('name','=','2')]}"/>
                </xpath>
            </field>
        </record>

  </data>
</openerp>

If I use something like this attrs="{'invisible':[('company_id','=','5')]}", I have an error that tells me that the object "account.bank.statement.line"field has no field "company_id" .
So, how can I use for this case a field which is not member the object "account.bank.statement.line" ? I need to use the field "company_id" from the object "account.bank.statement".

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

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Viorica Ibasfalean (vibasfalean) said :
#1

Hello Stefan Rijnhart!

Sorry for disturbing you, but, can you help me with above questions?

Thank you very much!
Viorica

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) said :
#2

If you sollicit my personal help, I do not think that you understood well enough that answers are provided by members of the OpenERP community on a voluntary basis. Also, for questions such as the above you may be better off at the new Help site: http://help.openerp.com

Note that it is not considered cooperative to ask 2 or 3 different questions in the same posting.

Revision history for this message
Viorica Ibasfalean (vibasfalean) said :
#3

Thank you very much for answer.
Sorry for misunderstanding, I thought you are a OpenERP support team member.
My intention was not to disturb you or upset you.
I asked this question over more than 2 weeks ago and I have no answer.

Thank you very much for the link and for all your advices.
Viorica

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Viorica Ibasfalean (vibasfalean) said :
#5

Please reactivate it.
Thanks!

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Viorica Ibasfalean (vibasfalean) said :
#7

Please reactivate it.
Thanks!

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) said :
#8

Viorica,

Tweaking fields_view_get() and an accurate understanding of record rules will help you solve your queries here.

Thanks.

Can you help with this problem?

Provide an answer of your own, or ask Viorica Ibasfalean for more information if necessary.

To post a message you must log in.