2
#-*- encoding:utf-8 -*-
3
##############################################################################
5
# OpenERP, Open Source Management Solution
6
# Copyright (C) 2011 TeMPO Consulting, MSF. All Rights Reserved
9
# This program is free software: you can redistribute it and/or modify
10
# it under the terms of the GNU Affero General Public License as
11
# published by the Free Software Foundation, either version 3 of the
12
# License, or (at your option) any later version.
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU Affero General Public License for more details.
19
# You should have received a copy of the GNU Affero General Public License
20
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22
##############################################################################
25
from osv import fields
26
from tools.translate import _
28
class stock_picking(osv.osv):
29
_inherit = 'stock.picking'
30
_name = 'stock.picking'
32
def _hook_log_picking_modify_message(self, cr, uid, ids, context=None, message='', pick=False):
34
Possibility to change the message: we want to have only Picking report in the right panel
36
context.update({'picking_screen': True, 'from_so':True})
37
return super(stock_picking, self)._hook_log_picking_modify_message(cr, uid, ids, context=context, message=message, pick=pick)
39
# I delete the method below because the mecanism was already done by PMA
40
# def allow_cancel(self, cr, uid, ids, context=None):
41
# res = super(stock_picking, self).allow_cancel(cr, uid, ids, context=context)
42
# for pick in self.browse(cr, uid, ids, context=context):
43
# if not pick.sale_id:
46
# raise osv.except_osv(_('Error'), _('You cannot cancel picking because it comes from a Field Order !'))
49
def _vals_get_bool(self, cr, uid, ids, fields, arg, context=None):
54
for obj in self.browse(cr, uid, ids, context=context):
55
result[obj.id] = False
61
'from_so_ok': fields.function(_vals_get_bool, method=True, type='boolean', string='Comes from a Field Order', store=False),