Merge pull request #2 from acsone/8.0-amu-imp-account-invoice-killer

Rename module "invoice_voucher_killer" and hide menus
This commit is contained in:
Stéphane Bidoul (ACSONE)
2014-12-03 10:55:32 +01:00
9 changed files with 67 additions and 40 deletions

View File

@@ -0,0 +1,11 @@
# Prevent the usage of voucher from invoices
This add-on disables the "Register Payment" button on
customer invoices and the "Pay" button on supplier invoices.
It also disables the voucher-related menus entries such as
"Sales Receipts", "Customer Payments", "Purchase Receipts",
"Supplier Payments" and "Journal Vouchers", "Sales Receipts Analysis".
More precisely, this module adds a group "Use voucher in Invoices"
and only users in that group see these buttons and menus.

View File

@@ -19,7 +19,7 @@
#
##############################################################################
{'name': 'Invoicing voucher killer',
{'name': 'Accounting voucher killer',
'version': '1.0.0',
'category': 'other',
'author': 'Camptocamp',

View File

@@ -0,0 +1,55 @@
<openerp>
<data>
<record id="invoice_voucher_group" model="ir.ui.view">
<field name="name">Hide voucher in invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_voucher.view_invoice_customer" />
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_pay_customer'][last()]"
position="attributes">
<attribute name="groups">account_voucher_killer.invoice_voucher_user</attribute>
</xpath>
<xpath expr="//button[@name='invoice_pay_customer'][1]"
position="attributes">
<attribute name="groups">account_voucher_killer.invoice_voucher_user</attribute>
</xpath>
</field>
</record>
<record id="invoice_voucher_group_supp_inv" model="ir.ui.view">
<field name="name">Hide voucher in supplier invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_voucher.view_invoice_supplier" />
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_pay_customer'][last()]"
position="attributes">
<attribute name="groups">account_voucher_killer.invoice_voucher_user</attribute>
</xpath>
</field>
</record>
<record id="account_voucher.menu_action_sale_receipt" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_voucher_user')])]"/>
</record>
<record id="account_voucher.menu_action_vendor_receipt" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_voucher_user')])]"/>
</record>
<record id="account_voucher.menu_action_purchase_receipt" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_voucher_user')])]"/>
</record>
<record id="account_voucher.menu_action_vendor_payment" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_voucher_user')])]"/>
</record>
<record id="account_voucher.menu_encode_entries_by_voucher" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_voucher_user')])]"/>
</record>
<record id="account_voucher.menu_action_sale_receipt_report_all" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_voucher_user')])]"/>
</record>
</data>
</openerp>

View File

@@ -1,7 +0,0 @@
# Prevent the usage of voucher from invoices
This add-on disables the "Register Payment" button on
customer invoices and the "Pay" button on supplier invoices.
More precisely, this module adds a group "Use voucher in Invoices"
and only users in that group see these buttons.

View File

@@ -1,32 +0,0 @@
<openerp>
<data>
<record id="invoice_voucher_group" model="ir.ui.view">
<field name="name">Hide voucher in invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_voucher.view_invoice_customer" />
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_pay_customer'][last()]"
position="attributes">
<attribute name="groups">invoicing_voucher_killer.invoice_voucher_user</attribute>
</xpath>
<xpath expr="//button[@name='invoice_pay_customer'][1]"
position="attributes">
<attribute name="groups">invoicing_voucher_killer.invoice_voucher_user</attribute>
</xpath>
</field>
</record>
<record id="invoice_voucher_group_supp_inv" model="ir.ui.view">
<field name="name">Hide voucher in supplier invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_voucher.view_invoice_supplier" />
<field name="arch" type="xml">
<xpath expr="//button[@name='invoice_pay_customer'][last()]"
position="attributes">
<attribute name="groups">invoicing_voucher_killer.invoice_voucher_user</attribute>
</xpath>
</field>
</record>
</data>
</openerp>