Add module purchase_line_product_required
This commit is contained in:
1
purchase_line_product_required/__init__.py
Normal file
1
purchase_line_product_required/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
43
purchase_line_product_required/__openerp__.py
Normal file
43
purchase_line_product_required/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
##############################################################################
|
||||||
|
#
|
||||||
|
# Purchase Line Product Required module for Odoo
|
||||||
|
# Copyright (C) 2016 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': 'Purchase Order Line Product Required',
|
||||||
|
'version': '0.1',
|
||||||
|
'category': 'Purchase Management',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'Product becomes a required field on purchase order lines',
|
||||||
|
'description': """
|
||||||
|
Purchase Order Line Product Required
|
||||||
|
====================================
|
||||||
|
|
||||||
|
Product becomes a required field on purchase order lines.
|
||||||
|
|
||||||
|
This module has been written by Alexis de Lattre from Akretion
|
||||||
|
<alexis.delattre@akretion.com>.
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['purchase'],
|
||||||
|
'data': ['purchase_view.xml'],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
36
purchase_line_product_required/purchase_view.xml
Normal file
36
purchase_line_product_required/purchase_view.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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>
|
||||||
|
|
||||||
|
<record id="purchase_order_form" model="ir.ui.view">
|
||||||
|
<field name="name">purchase.order.product.required.form</field>
|
||||||
|
<field name="model">purchase.order</field>
|
||||||
|
<field name="inherit_id" ref="purchase.purchase_order_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='order_line']/tree/field[@name='product_id']" position="attributes">
|
||||||
|
<attribute name="required">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="purchase_order_line_form" model="ir.ui.view">
|
||||||
|
<field name="name">purchase.order.line.product.required.form</field>
|
||||||
|
<field name="model">purchase.order.line</field>
|
||||||
|
<field name="inherit_id" ref="purchase.purchase_order_line_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="product_id" position="attributes">
|
||||||
|
<attribute name="required">1</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</openerp>
|
||||||
Reference in New Issue
Block a user