Add link from picking to PO

This commit is contained in:
Alexis de Lattre
2017-03-03 09:29:41 +01:00
parent dc90787030
commit 9aa723bf06
2 changed files with 13 additions and 21 deletions

View File

@@ -1,24 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Purchase Usability module for OpenERP
# Copyright (C) 2014 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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
{
@@ -40,6 +22,7 @@ Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for
'depends': ['purchase'],
'data': [
'purchase_view.xml',
'stock_view.xml',
],
'active': False,
}

View File

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