From bf6165076abcefc2141a6a9a97acaa0cd1077898 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 21 Nov 2025 10:57:32 +0100 Subject: [PATCH] Use default warehouse when creating new product locations --- modules/stock_product_location/location.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/stock_product_location/location.py b/modules/stock_product_location/location.py index fa08dcb58a..8976be7609 100644 --- a/modules/stock_product_location/location.py +++ b/modules/stock_product_location/location.py @@ -2,7 +2,7 @@ # this repository contains the full copyright notices and license terms. from trytond.model import ( MatchMixin, ModelSQL, ModelView, fields, sequence_ordered) -from trytond.pool import PoolMeta +from trytond.pool import Pool, PoolMeta from trytond.pyson import Bool, Eval, If @@ -39,6 +39,11 @@ class ProductLocation(sequence_ordered(), ModelSQL, ModelView, MatchMixin): if self.product: self.template = self.product.template + @classmethod + def default_warehouse(cls): + Location = Pool().get('stock.location') + return Location.get_default_warehouse() + class Move(metaclass=PoolMeta): __name__ = 'stock.move'