Add module sale_purchase_no_product_template_menu
This commit is contained in:
committed by
David Beal
parent
f07d416034
commit
31c67cb923
1
sale_purchase_no_product_template_menu/__init__.py
Normal file
1
sale_purchase_no_product_template_menu/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
45
sale_purchase_no_product_template_menu/__openerp__.py
Normal file
45
sale_purchase_no_product_template_menu/__openerp__.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Sale Purchase No Product Template Menu module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Sale Purchase No Product Template Menu',
|
||||
'version': '0.1',
|
||||
'category': 'Sale and Purchase',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Use only if you don't use variants of products",
|
||||
'description': """
|
||||
Sale Purchase No Product Template
|
||||
=================================
|
||||
|
||||
You may use this module only if you don't use product variants i.e. you don't have (and don't plan to have in the future) several product.product attached to one product.template.
|
||||
|
||||
This module replaces the menu entries for product.template by menu entries for product.product in the *Sales*, *Purchases* and *Warehouse* menu entry.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['purchase', 'sale'],
|
||||
'data': ['view.xml'],
|
||||
'installable': True,
|
||||
}
|
||||
47
sale_purchase_no_product_template_menu/view.xml
Normal file
47
sale_purchase_no_product_template_menu/view.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- PURCHASE -->
|
||||
<record id="product_product_action_puchased" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
<field name="res_model">product.product</field>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
<field name="context">{"search_default_filter_to_purchase":1}</field>
|
||||
<field name="search_view_id" eval="False"/> <!-- Force empty -->
|
||||
<field name="view_id" eval="False"/> <!-- Force empty -->
|
||||
</record>
|
||||
|
||||
<record id="purchase.menu_procurement_partner_contact_form" model="ir.ui.menu">
|
||||
<field name="action" ref="product_product_action_puchased"/>
|
||||
</record>
|
||||
|
||||
<!-- STOCK -->
|
||||
<record id="stock.menu_stock_products_menu" model="ir.ui.menu">
|
||||
<field name="action" ref="product.product_normal_action"/>
|
||||
</record>
|
||||
|
||||
<!-- Rename from 'Product Variants' to 'Products' -->
|
||||
<record id="product.product_normal_action" model="ir.actions.act_window">
|
||||
<field name="name">Products</field>
|
||||
</record>
|
||||
|
||||
<!-- SALE -->
|
||||
<record id="product.menu_product_template_action" model="ir.ui.menu">
|
||||
<field name="action" ref="product.product_normal_action_sell"/>
|
||||
<field name="view_mode">tree,form,kanban</field>
|
||||
</record>
|
||||
|
||||
<!-- Hide the native 'Product Variants' menu entry for regular users -->
|
||||
<record id="product.menu_products" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6, 0, [ref('base.group_system')])]"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user