refund by default on return picking

This commit is contained in:
Alexis de Lattre
2017-07-10 19:11:15 +02:00
parent 91d4a8c767
commit 0a8e3c4452
3 changed files with 22 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from . import sale_stock
from . import wizard

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import stock_return_picking

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api
class StockReturnPicking(models.TransientModel):
_inherit = 'stock.return.picking'
@api.model
def default_get(self, fields):
res = super(StockReturnPicking, self).default_get(fields)
if res.get('product_return_moves'):
for line in res['product_return_moves']:
if len(line) == 3:
line[2]['to_refund_so'] = True
return res