1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# Account Payment Sale Stock module for OpenERP
5
# Copyright (C) 2014 Akretion (http://www.akretion.com)
6
# @author Alexis de Lattre <alexis.delattre@akretion.com>
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 openerp.osv import orm
26
class stock_picking(orm.Model):
27
_inherit = "stock.picking"
30
self, cr, uid, picking, partner, inv_type, journal_id,
32
"""Copy payment mode from sale order to invoice"""
33
invoice_vals = super(stock_picking, self)._prepare_invoice(
34
cr, uid, picking, partner, inv_type, journal_id, context=context)
38
picking.sale_id.payment_mode_id and
39
picking.sale_id.payment_mode_id.bank_id.id or False,
41
picking.sale_id.payment_mode_id.id or False,