diff --git a/stock_usability/stock.py b/stock_usability/stock.py index e488d83..ea2f3cb 100644 --- a/stock_usability/stock.py +++ b/stock_usability/stock.py @@ -3,8 +3,7 @@ # @author Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api -import odoo.addons.decimal_precision as dp +from odoo import models, fields, api, _ import logging logger = logging.getLogger(__name__) @@ -25,6 +24,13 @@ class StockPicking(models.Model): picking_type_id = fields.Many2one(track_visibility='onchange') move_type = fields.Selection(track_visibility='onchange') + @api.multi + def force_assign(self): + res = super(StockPicking, self).force_assign() + for pick in self: + pick.message_post(_("Using Force Availability!")) + return res + class StockLocation(models.Model): _inherit = 'stock.location' @@ -58,7 +64,6 @@ class StockWarehouseOrderpoint(models.Model): # good value, not the default stock location of the first WH of the company @api.model def default_get(self, fields): - res = {} if self._context.get('default_location_id'): location = self.env['stock.location'].browse( self._context['default_location_id'])