On Thursday, 3 October 2013 00:57:32 UTC+8, Guillem Barba wrote: > > 2013/10/2 Josias Pérez <jep...@gmail.com <javascript:>> > >> Hi, >> >> I'm working for a POS module on tryton. >> >> At the moment, have 2 question: >> >> 1. We create a group called Team Sales, that can access to Sales and >> Sales Lines, but we want that they can't view some fields (specially >> related to cost_price). We can hide on fields permission, but at the same >> time, they need to create stock moves, that requiere to read cost_price. >> The question is how to hide the field (cost_price) only in the view, but >> still can read for create the stock moves. They can't see the stock moves, >> only create that. >> > > define an 'states' attribute that set 'invisible' the field if user is not > in the required fields: > field_name = fields.XXX(..., states={ > 'invisible': Not(Eval('groups', []).contains(Id('MODULE', > 'GROUP_XML_ID'))), > }) > > > 2. How to give access permission to buttons that call wizards? They aren't >> listed neither on button neither in wizard permission access. >> > > I supose the button get permissions from wizard (if user has permissions > over wizard can see the button). It make sense. > May I know how to give the permission over wizard?
I created an a group called "group_cashier". The main purpose is to create invoice and pay invoice. I could find how to give the permission for "Pay" button which attached to the wizard "wizard_pay". Trying to give permission to the wizard as below script, but the pay button still disable. <record model="ir.model.access" id="access_account_invoice_pay_ask"> <field name="model" search="[('model', '=', 'account.invoice.pay.ask')]"/> <field name="group" ref="group_cashier"/> <field name="perm_read" eval="True"/> <field name="perm_write" eval="True"/> <field name="perm_create" eval="True"/> <field name="perm_delete" eval="True"/> </record> <record model="ir.model.access" id="access_account_invoice_pay_start"> <field name="model" search="[('model', '=', 'account.invoice.pay.start')]"/> <field name="group" ref="group_cashier"/> <field name="perm_read" eval="True"/> <field name="perm_write" eval="True"/> <field name="perm_create" eval="True"/> <field name="perm_delete" eval="True"/> </record> > > -- > Guillem Barba > http://www.guillem.alcarrer.net >