[FIX] rma: Do not set 'Destination Package' if RMA package comes from 'Customers' location

This commit is contained in:
BernatPForgeFlow
2023-10-25 11:17:12 +02:00
committed by PauBForgeFlow
parent 73b104175a
commit e43156e027
3 changed files with 18 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
# Copyright (C) 2023 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import models
class QuantPackage(models.Model):
_inherit = "stock.quant.package"
def _allowed_to_move_between_transfers(self):
res = super(QuantPackage, self)._allowed_to_move_between_transfers()
return res and self.location_id != self.env.ref(
"stock.stock_location_customers"
)