[FIX] sale_stock: payment_term in supplier invoice
When invoicing a supplier, this is the supplier payment term which has to be taken into account. opw:656307
This commit is contained in:
parent
cf82f0fffc
commit
e3b90ba1d4
|
@ -480,7 +480,7 @@ class stock_picking(osv.osv):
|
||||||
def _get_invoice_vals(self, cr, uid, key, inv_type, journal_id, move, context=None):
|
def _get_invoice_vals(self, cr, uid, key, inv_type, journal_id, move, context=None):
|
||||||
inv_vals = super(stock_picking, self)._get_invoice_vals(cr, uid, key, inv_type, journal_id, move, context=context)
|
inv_vals = super(stock_picking, self)._get_invoice_vals(cr, uid, key, inv_type, journal_id, move, context=context)
|
||||||
sale = move.picking_id.sale_id
|
sale = move.picking_id.sale_id
|
||||||
if sale:
|
if sale and inv_type in ('out_invoice', 'out_refund'):
|
||||||
inv_vals.update({
|
inv_vals.update({
|
||||||
'fiscal_position': sale.fiscal_position.id,
|
'fiscal_position': sale.fiscal_position.id,
|
||||||
'payment_term': sale.payment_term.id,
|
'payment_term': sale.payment_term.id,
|
||||||
|
|
Loading…
Reference in New Issue