mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[MIG] account_payment_sale: Migration to v9
This commit is contained in:
committed by
Atchuthan Ubendran
parent
c2f1a1377a
commit
bb45ede128
3
account_payment_sale/wizard/__init__.py
Normal file
3
account_payment_sale/wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import sale_make_invoice_advance
|
||||
24
account_payment_sale/wizard/sale_make_invoice_advance.py
Normal file
24
account_payment_sale/wizard/sale_make_invoice_advance.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, api
|
||||
|
||||
|
||||
class SaleAdvancePaymentInv(models.TransientModel):
|
||||
_inherit = 'sale.advance.payment.inv'
|
||||
|
||||
@api.multi
|
||||
def _create_invoice(self, order, so_line, amount):
|
||||
"""Copy payment mode from sale order to invoice"""
|
||||
inv = super(SaleAdvancePaymentInv, self)._create_invoice(
|
||||
order, so_line, amount)
|
||||
vals = {}
|
||||
if order.payment_mode_id:
|
||||
vals['payment_mode_id'] = order.payment_mode_id.id
|
||||
if order.payment_mode_id.bank_account_link == 'fixed':
|
||||
vals['partner_bank_id'] =\
|
||||
order.payment_mode_id.fixed_journal_id.bank_account_id.id
|
||||
if vals:
|
||||
inv.write(vals)
|
||||
return inv
|
||||
Reference in New Issue
Block a user