1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
5
# Copyright (c) 2012 Zikzakmedia S.L. (http://zikzakmedia.com)
7
# Jordi Esteve <jesteve@zikzakmedia.com>
8
# Jesús Martín <jmartin@zikzakmedia.com>
11
# This program is free software: you can redistribute it and/or modify
12
# it under the terms of the GNU Affero General Public License as published by
13
# the Free Software Foundation, either version 3 of the License, or
14
# (at your option) any later version.
16
# This program is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
# GNU Affero General Public License for more details.
21
# You should have received a copy of the GNU Affero General Public License
22
# along with this program. If not, see <http://www.gnu.org/licenses/>.
24
##############################################################################
28
class stock_partial_picking(osv.osv_memory):
29
_inherit = "stock.partial.picking"
31
def get_picking_type(self, cr, uid, picking, context=None):
32
picking_type = picking.type
33
return_picking = picking.name and '-return' in picking.name or False
34
for move in picking.move_lines:
35
if picking.type == 'in' and move.product_id.cost_method == \
36
'average' and not return_picking:
39
elif picking.type == 'out' and move.product_id.cost_method == \
40
'average' and return_picking:
47
stock_partial_picking()