[10.0][MIG] payment killer migration (#480)

This commit is contained in:
Cristian Salamea
2018-06-22 12:56:04 -05:00
committed by Pedro M. Baeza
parent 9b761fdd8c
commit f5814eb3c2
6 changed files with 66 additions and 86 deletions

View File

@@ -1,31 +1,31 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Prevent the usage of voucher from invoices
==========================================
Prevent the usage of payments 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".
It also disables the payments-related menus entries such as
"Customer Payments", "Supplier Payments"
More precisely, this module adds a group "Use voucher in Invoices"
More precisely, this module adds a group "Payments for Invoices"
and only users in that group see these buttons and menus.
Installation
============
This module depends on :
* account_voucher
* account
This modules are parts of the OCA/bank-payment suite.
Configuration
=============
There is nothing to configure.
Use new group Payment for Invoices to allow make payments
Usage
=====
@@ -37,11 +37,6 @@ For further information, please visit:
* https://www.odoo.com/forum/help-1
Known issues / Roadmap
======================
* ...
Bug Tracker
===========
@@ -60,6 +55,7 @@ Contributors
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
* Anthony Muschang <anthony.muschang@acsone.eu>
* Yannick Vaucher
* Cristian Salamea <cs@prisehub.com>
Maintainer
----------
@@ -73,4 +69,3 @@ This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
To contribute to this module, please visit http://odoo-community.org.

View File

@@ -19,16 +19,16 @@
#
##############################################################################
{'name': 'Accounting voucher killer',
'version': '8.0.1.0.0',
{'name': 'Accounting Payment Access',
'version': '10.0.1.0.0',
'category': 'other',
'author': "Camptocamp,Odoo Community Association (OCA)",
'website': 'http://www.camptocamp.com',
'website': 'https://github.com/OCA/bank-payment',
'license': 'AGPL-3',
'depends': ['account_voucher'],
'data': ['invoice_data.xml',
'invoice_view.xml'],
'test': [],
'installable': False,
'active': False,
'depends': ['account'],
'data': [
'security/invoice_data.xml',
'view/invoice_view.xml'
],
'installable': True,
}

View File

@@ -1,7 +0,0 @@
<openerp>
<data>
<record id="invoice_voucher_user" model="res.groups">
<field name="name">Use voucher in Invoices</field>
</record>
</data>
</openerp>

View File

@@ -1,55 +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">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

@@ -0,0 +1,5 @@
<odoo>
<record id="invoice_payment_user" model="res.groups">
<field name="name">Payments for Invoices</field>
</record>
</odoo>

View File

@@ -0,0 +1,42 @@
<odoo>
<record id="invoice_payment_group_customer_invoice" model="ir.ui.view">
<field name="name">Hide payment in invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='%(account.action_account_invoice_payment)d']"
position="attributes">
<attribute name="groups">account_voucher_killer.invoice_payment_user</attribute>
</xpath>
<xpath expr="//button[@name='%(account.action_account_invoice_payment)d']"
position="attributes">
<attribute name="groups">account_voucher_killer.invoice_payment_user</attribute>
</xpath>
</field>
</record>
<record id="invoice_payment_group_supplier_invoice" model="ir.ui.view">
<field name="name">Hide Payment in supplier invoice</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_supplier_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='%(account.action_account_invoice_payment)d']"
position="attributes">
<attribute name="groups">account_voucher_killer.invoice_payment_user</attribute>
</xpath>
</field>
</record>
<record id="account.menu_action_account_payments_receivable" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_payment_user')])]"/>
</record>
<record id="account.menu_action_account_payments_payable" model="ir.ui.menu">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_payment_user')])]"/>
</record>
<record id="account.action_account_payment_from_invoices" model="ir.actions.act_window">
<field name="groups_id" eval="[(6,0,[ref('account_voucher_killer.invoice_payment_user')])]"/>
</record>
</odoo>