diff --git a/purchase_usability/__manifest__.py b/purchase_usability/__manifest__.py index 3852328..d807ec5 100644 --- a/purchase_usability/__manifest__.py +++ b/purchase_usability/__manifest__.py @@ -1,24 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Purchase Usability module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## +# -*- coding: utf-8 -*- +# Copyright (C) 2014-2017 Akretion (http://www.akretion.com) +# @author Alexis de Lattre { @@ -40,6 +22,7 @@ Please contact Alexis de Lattre from Akretion for 'depends': ['purchase'], 'data': [ 'purchase_view.xml', + 'stock_view.xml', ], 'active': False, } diff --git a/purchase_usability/purchase.py b/purchase_usability/purchase.py index b443169..a7bb59f 100644 --- a/purchase_usability/purchase.py +++ b/purchase_usability/purchase.py @@ -34,6 +34,15 @@ class PurchaseOrder(models.Model): o.delivery_partner_id = delivery_partner_id +class StockPicking(models.Model): + _inherit = 'stock.picking' + + # Field added to have a clickable link from picking to PO + purchase_id = fields.Many2one( + related='move_lines.purchase_line_id.order_id', readonly=True, + string='Purchase Order') + + class ResPartner(models.Model): _inherit = 'res.partner'