Migrate stock_user_default_warehouse_base from 10.0
This commit is contained in:
committed by
Daniel Luque
parent
e96c3d72eb
commit
d1deeeac31
5
stock_user_default_warehouse_base/wizard/__init__.py
Normal file
5
stock_user_default_warehouse_base/wizard/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from . import stock_change_product_qty
|
||||
@@ -0,0 +1,17 @@
|
||||
# © 2017 Akretion (http://www.akretion.com)
|
||||
# @author 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 StockChangeProductQty(models.TransientModel):
|
||||
_inherit = 'stock.change.product.qty'
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super(StockChangeProductQty, self).default_get(fields_list)
|
||||
if self.env.user.context_default_warehouse_id:
|
||||
res['location_id'] = self.env.user.context_default_warehouse_id.\
|
||||
lot_stock_id.id
|
||||
return res
|
||||
Reference in New Issue
Block a user