1
# -*- coding: utf-8 -*-
2
#########################################################################
5
#########################################################################
7
# crm_claim_rma for OpenERP #
8
# Copyright (C) 2009-2012 Akretion, Emmanuel Samyn, #
9
# Benoît GUILLOT <benoit.guillot@akretion.com> #
10
#This program is free software: you can redistribute it and/or modify #
11
#it under the terms of the GNU General Public License as published by #
12
#the Free Software Foundation, either version 3 of the License, or #
13
#(at your option) any later version. #
15
#This program is distributed in the hope that it will be useful, #
16
#but WITHOUT ANY WARRANTY; without even the implied warranty of #
17
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
18
#GNU General Public License for more details. #
20
#You should have received a copy of the GNU General Public License #
21
#along with this program. If not, see <http://www.gnu.org/licenses/>. #
22
#########################################################################
23
from openerp.osv import fields, orm, osv
24
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
25
from openerp import netsvc
26
from openerp.tools.translate import _
30
class claim_make_picking(orm.TransientModel):
32
_inherit = 'claim_make_picking.wizard'
34
# Get default destination location
35
def _get_dest_loc(self, cr, uid, context):
36
res = super(claim_make_picking, self)._get_dest_loc(cr, uid,
38
if context is None: context = {}
39
warehouse_obj = self.pool.get('stock.warehouse')
40
warehouse_id = context.get('warehouse_id')
41
if context.get('picking_type') == 'in':
42
loc_id = warehouse_obj.read(cr, uid,
45
context=context)['lot_rma_id'][0]
46
elif context.get('picking_type') == 'loss':
47
loc_id = warehouse_obj.read(cr, uid,
49
['lot_carrier_loss_id'],
50
context=context)['lot_carrier_loss_id'][0]
54
'claim_line_dest_location': _get_dest_loc,