mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
19 lines
507 B
Python
19 lines
507 B
Python
# Copyright 2021 Akretion (https://www.akretion.com).
|
|
# @author Pierrick Brun <pierrick.brun@akretion.com>
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import models
|
|
|
|
|
|
class StockLocation(models.Model):
|
|
_inherit = "stock.location"
|
|
|
|
def _is_child(self, location):
|
|
self.ensure_one()
|
|
if self == location:
|
|
return True
|
|
elif self.location_id:
|
|
return self.location_id._is_child(location)
|
|
else:
|
|
return False
|