2
# -*- coding: utf-8 -*-
3
##############################################################################
5
# OpenERP, Open Source Management Solution
6
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
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 fields, osv
24
from tools.translate import _
27
class stock_partial_picking(osv.osv_memory):
31
_inherit = "stock.partial.picking"
33
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
40
result = super(stock_partial_picking, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu)
42
pick_obj = self.pool.get('stock.picking')
43
picking_ids = context.get('active_ids', False)
44
message_in = '<label string="You receive %s products, please refer to the appropriate procedure." colspan="4" />'
45
message_out = '<label string="You ship %s products, please refer to the appropriate procedure and ensure that the mean of transport is appropriate." colspan="4" />'
48
# not called through an action (e.g. buildbot), return the default.
55
for pick in pick_obj.browse(cr, uid, picking_ids, context=context):
57
for m in pick.move_lines:
58
if m.product_id.heat_sensitive_item:
60
if m.product_id.dangerous_goods:
63
if contains_kc and contains_dg:
64
fill = 'heat sensitive and dangerous goods'
66
fill = 'heat sensitive'
68
fill = 'dangerous goods'
77
message = message%fill
83
l = arch.split('<field name="date" invisible="1"/>')
84
arch = l[0] + '<field name="date" invisible="1"/>' + message + l[1]
89
stock_partial_picking()