diff --git a/purchase_hide_report_print_menu/README.rst b/purchase_hide_report_print_menu/README.rst new file mode 100644 index 0000000..268d072 --- /dev/null +++ b/purchase_hide_report_print_menu/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================================ +Purchase Hide Report Print Menu +================================ + +This module hide print report 'Request for Quotation' in purchase order menu. + +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/142/8.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. + +Credits +======= + +Contributors +------------ + +* Chafique Delli chafique.delli@akretion.com + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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 https://odoo-community.org. \ No newline at end of file diff --git a/purchase_hide_report_print_menu/__init__.py b/purchase_hide_report_print_menu/__init__.py new file mode 100644 index 0000000..c5367c0 --- /dev/null +++ b/purchase_hide_report_print_menu/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import purchase diff --git a/purchase_hide_report_print_menu/__openerp__.py b/purchase_hide_report_print_menu/__openerp__.py new file mode 100644 index 0000000..50d408c --- /dev/null +++ b/purchase_hide_report_print_menu/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Purchase Hide Report Print Menu', + 'summary': "Hide print report 'Request for Quotation' " + "in purchase order menu", + 'version': '8.0.1.0.0', + 'category': 'Purchase Management', + 'website': 'http://akretion.com', + 'author': 'Akretion, Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'application': False, + 'installable': True, + 'depends': [ + 'purchase', + ], + 'data': [ + 'purchase_view.xml', + ] +} diff --git a/purchase_hide_report_print_menu/purchase.py b/purchase_hide_report_print_menu/purchase.py new file mode 100644 index 0000000..1cce52e --- /dev/null +++ b/purchase_hide_report_print_menu/purchase.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# © 2016 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, api + + +class PurchaseOrder(models.Model): + _inherit = 'purchase.order' + + @api.model + def fields_view_get(self, view_id=None, view_type='form', toolbar=False, + submenu=False): + res = super(PurchaseOrder, self).fields_view_get( + view_id=view_id, view_type=view_type, toolbar=toolbar, + submenu=submenu) + if self._context.get('purchase_order', False): + report_purchase_quotation = self.env.ref( + 'purchase.report_purchase_quotation') + for print_submenu in res.get('toolbar', {}).get('print', []): + if print_submenu['id'] == report_purchase_quotation.id: + res['toolbar']['print'].remove(print_submenu) + return res diff --git a/purchase_hide_report_print_menu/purchase_view.xml b/purchase_hide_report_print_menu/purchase_view.xml new file mode 100644 index 0000000..5ddc13a --- /dev/null +++ b/purchase_hide_report_print_menu/purchase_view.xml @@ -0,0 +1,11 @@ + + + + + + + {'purchase_order': True} + + + +