[SECURITY] -pos box cash in pos box cash out access for non accountant
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 21 Sep 2016 10:19:16 +0000 (12:19 +0200)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 21 Sep 2016 10:19:16 +0000 (12:19 +0200)
or non pos manager users

__openerp__.py
view/point_of_sale.xml
wizard/pos_box.xml [new file with mode: 0644]

index 8cdcc02..478c45e 100644 (file)
@@ -42,6 +42,7 @@ It installs the profile for bike co-ops to manage some features like:
         'view/point_of_sale.xml',
         'security/velosenville.xml',
         'security/ir.model.access.csv',
+        'wizard/pos_box.xml',
     ],
     'installable': True,
     'auto_install': False,
index a298887..872e4af 100644 (file)
                 </xpath>
             </field>
         </record>
+        <record id="view_pos_session_form" model="ir.ui.view">
+            <field name="name">pos.session.form</field>
+            <field name="model">pos.session</field>
+            <field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
+            <field name="priority" eval="8"/>
+            <field name="arch" type="xml">
+            <xpath expr="//button[@name='%(point_of_sale.action_pos_box_in)d']" position="attributes">
+                <attribute name="groups">account.group_account_user,account.group_account_manager,point_of_sale.group_pos_manager</attribute>
+            </xpath>
+            <xpath expr="//button[@name='%(point_of_sale.action_pos_box_out)d']" position="attributes">
+                <attribute name="groups">account.group_account_user,account.group_account_manager,point_of_sale.group_pos_manager</attribute>
+            </xpath>
+            </field>
+        </record>
     </data>
 </openerp>
diff --git a/wizard/pos_box.xml b/wizard/pos_box.xml
new file mode 100644 (file)
index 0000000..81417dc
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="point_of_sale.action_pos_box_in" model="ir.actions.act_window">
+            <field name="groups_id"  eval="[(4, ref('account.group_account_user')), (4, ref('account.group_account_manager')), (4, ref('point_of_sale.group_pos_manager'))]"/>
+        </record>
+        <record id="point_of_sale.action_pos_box_out" model="ir.actions.act_window">
+            <field name="groups_id"  eval="[(4, ref('account.group_account_user')), (4, ref('account.group_account_manager')), (4, ref('point_of_sale.group_pos_manager'))]"/>
+        </record>
+    </data>
+</openerp>