Add message in the chatter of the picking when using force availability

PEP8 fixes
This commit is contained in:
Alexis de Lattre
2018-01-18 14:10:08 +01:00
parent fc2dcbc359
commit b9014e937d

View File

@@ -3,8 +3,7 @@
# @author Alexis de Lattre <alexis.delattre@akretion.com> # @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields, api from odoo import models, fields, api, _
import odoo.addons.decimal_precision as dp
import logging import logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -25,6 +24,13 @@ class StockPicking(models.Model):
picking_type_id = fields.Many2one(track_visibility='onchange') picking_type_id = fields.Many2one(track_visibility='onchange')
move_type = fields.Selection(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 <b>Force Availability</b>!"))
return res
class StockLocation(models.Model): class StockLocation(models.Model):
_inherit = 'stock.location' _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 # good value, not the default stock location of the first WH of the company
@api.model @api.model
def default_get(self, fields): def default_get(self, fields):
res = {}
if self._context.get('default_location_id'): if self._context.get('default_location_id'):
location = self.env['stock.location'].browse( location = self.env['stock.location'].browse(
self._context['default_location_id']) self._context['default_location_id'])