2
# -*- encoding: utf-8 -*-
3
##############################################################################
5
# OpenERP, Open Source Management Solution
6
# Copyright (C) 2011 TeMPO Consulting, MSF
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
23
from osv import osv, fields
26
class stock_picking(osv.osv):
27
_name = 'stock.picking'
28
_inherit = 'stock.picking'
31
# @@@override stock>stock.py>stock_picking>do_partial
32
def do_partial(self, cr, uid, ids, partial_datas, context=None):
34
Write the shipment date on accoding order
36
res = super(stock_picking, self).do_partial(cr, uid, ids, partial_datas, context=context)
38
po_obj = self.pool.get('purchase.order')
39
so_obj = self.pool.get('sale.order')
41
for picking in self.browse(cr, uid, ids, context=context):
42
if picking.purchase_id:
43
po_obj.write(cr, uid, [picking.purchase_id.id], {'shipment_date': picking.date_done})
45
so_obj.write(cr, uid, [picking.sale_id.id], {'shipment_date': picking.date_done})
52
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: