Commit 55017d2c authored by santi's avatar santi
Browse files

Only show the own invoices to users

Hide "To send" button to users
parent f0cf4a8a
......@@ -15,7 +15,7 @@
<button name="%(account.action_account_state_open)d" type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_user"/>
<button name="invoice_open" states="to_send,proforma2" string="Approve" icon="terp-camera_test"/>
<button name="invoice_to_valid" states="draft" string="To Validation" icon="terp-camera_test"/>
<button name="invoice_to_send" states="to_valid" string="Invoice to send" icon="terp-camera_test"/>
<button name="invoice_to_send" states="to_valid" string="Invoice to send" icon="terp-camera_test" groups="account.group_account_user"/>
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,paid" statusbar_colors='{"proforma":"blue","proforma2":"blue"}'/>
</header>
</xpath>
......@@ -31,7 +31,7 @@
<header>
<button name="invoice_cancel" states="to_send,to_valid,draft,proforma2,sale,open" string="Cancel" icon="gtk-cancel"/>
<button name="action_cancel_draft" states="cancel" string="Reset to Draft" type="object" icon="terp-stock_effects-object-colorize"/>
<button name="invoice_to_send" states="to_valid" string="Invoice To Send" icon="gtk-go-forward"/>
<button name="invoice_to_send" states="to_valid" string="Invoice To Send" icon="gtk-go-forward" groups="account.group_account_user"/>
<button name="invoice_to_valid" states="draft" string="To Validation" icon="terp-gtk-media-pause"/>
<button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
<button name='%(account.action_account_state_open)d' type='action' string='Re-Open' states='paid' icon="gtk-convert" groups="account.group_account_user"/>
......
......@@ -34,5 +34,27 @@
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="invoice_only_read_own">
<field name="name">Invoices only read own</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="global" eval="False"/>
<field name="domain_force">['|',('user_id','=',user.id),('user_id','=',False)]</field>
<field name="groups" eval="[(4,[ref('account.group_account_invoice')])]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
<record model="ir.rule" id="invoice_read_all_accountant">
<field name="name">Invoices read all accountant</field>
<field name="model_id" ref="account.model_account_invoice"/>
<field name="global" eval="False"/>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,[ref('account.group_account_user')])]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="True"/>
<field name="perm_unlink" eval="True"/>
<field name="perm_create" eval="True"/>
</record>
</data>
</openerp>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment