[REM] stock: remove stock_picking_responsible.py
As the responsible can be assigned directly in the list view, the assign responsible wizard is now useless. The Country will not forget what you did for us wizard, thank you. closes odoo/odoo#38365 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -14,4 +14,3 @@ from . import stock_warn_insufficient_qty
|
||||
from . import product_replenish
|
||||
from . import stock_track_confirmation
|
||||
from . import stock_package_destination
|
||||
from . import stock_picking_responsible # TODO: Remove this import in 13.1
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import _, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
# TODO: REMOVE THIS FILE IN 13.1 !
|
||||
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
class StockPickingResponsible(models.TransientModel):
|
||||
_name = 'stock.picking.responsible'
|
||||
_description = 'Assign Responsible'
|
||||
|
||||
user_id = fields.Many2one(
|
||||
'res.users', 'Responsible',
|
||||
domain=lambda self: [('groups_id', 'in', self.env.ref('stock.group_stock_user').id)],
|
||||
default=lambda self: self.env.user)
|
||||
|
||||
def assign_responsible(self):
|
||||
self.ensure_one()
|
||||
pickings = self.env['stock.picking'].browse(self.env.context.get('active_ids'))
|
||||
restricted_companies = pickings.company_id - self.user_id.company_ids
|
||||
if restricted_companies:
|
||||
raise UserError(_('%s has a restricted access to %s') % (self.user_id.name, restricted_companies.mapped('name')))
|
||||
pickings.write({'user_id': self.user_id.id})
|
||||
Reference in New Issue
Block a user