Creation of a subcontracting portal to let the subcontractor register himself all the components that were used for the production. The portal is reusing the backend view of the stock picking where components were registered before. closes odoo/odoo#83465 Task: 2645298 Community-pr: https://github.com/odoo/odoo/pull/83465 Enterprise-pr: https://github.com/odoo/enterprise/pull/24647 Related: odoo/upgrade#3402 Related: odoo/enterprise#24647 Signed-off-by: Arnold Moyaux <arm@odoo.com>
16 lines
429 B
Python
16 lines
429 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import models
|
|
|
|
|
|
class StockLocation(models.Model):
|
|
_inherit = 'stock.location'
|
|
|
|
def _check_access_putaway(self):
|
|
""" Use sudo mode for subcontractor """
|
|
if self.env.user.partner_id.is_subcontractor:
|
|
return self.sudo()
|
|
else:
|
|
return super()._check_access_putaway()
|