Merge pull request #16 from akretion/8.0-purchase-hide-report-print-menu

add purchase_hide_report_print_menu
This commit is contained in:
beau sebastien
2016-05-30 15:17:47 +02:00
5 changed files with 110 additions and 0 deletions

View File

@@ -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
<https://github.com/akretion/odoo-usability/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
<https://github.com/akretion/
odoo-usability/issues/new?body=module:%20
purchase_hide_report_print_menu%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
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.

View File

@@ -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

View File

@@ -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',
]
}

View File

@@ -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

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record model="ir.actions.act_window" id="purchase.purchase_form_action">
<field name="context">{'purchase_order': True}</field>
</record>
</data>
</openerp>