Skip to Content
Menu
This question has been flagged
2 Replies
2213 Views

Hello good day and thank you very much for your support and help.


I need to hide all the money fields from [Sales Orders] to a created group.


I have nothing
I do not know how to start


please help step by step i'm new


I use openerp Versión 7.0-20140221-003045

Avatar
Discard
Author Best Answer

I made this
 first create the user group [base.group_hide_monto_b]


after this

hideymas_view.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
   <data>  
 <!-- Ocultamos los campos de dinero de Pedidos de venta -->
    <record id="hideymas_PedidoVenta_montos_id" model="ir.ui.view">
      <field name="name">hideymas.PedidoVent.inherit</field>
      <field name="model">sale.order</field>
            <field name="type">form</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
              <field name="arch" type="xml"> 
                <!-- Oculta los campos -->
                  <field name="amount_tax" position="replace" >
                     <field name="amount_tax" attrs="{'invisible': True }" groups="base.group_hide_monto_b" /> 
                  </field>      
              </field>
      </record>
     </data>
</openerp>

ir.model.access.csv
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_order,sale.order,model_sale_order,base.group_hide_monto_b,0,0,0,0

it doesn't work because it conceals the fields for everyone


thank you very much for your help

Avatar
Discard
Best Answer

Hi,

You can create a new user group either from the UI or from the code, then you can take the external id of the created group from the View MetaData option in the debug mode(as per v8 and above). Then you have to add groups to the fields to you need to show only to this group of users like this,

<field name="price_reduce" groups="external_id_of_group"/>


For creating the group from the code, you can refer this, but not in v7: How To Create New User Groups In Odoo

If you are creating the groups from UI, the records will not have external ID, so this to understand how to generate the External ID for the records created from UI: Generate External ID for the Records Created From UI

Thanks

Avatar
Discard