details:   https://code.tryton.org/tryton/commit/3bddb1b8f1e5
branch:    default
user:      Sergi Almacellas Abellana <[email protected]>
date:      Fri Nov 21 10:57:32 2025 +0100
description:
        Use default warehouse when creating new product locations
diffstat:

 modules/stock_product_location/location.py |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 3cc36340fe31 -r 3bddb1b8f1e5 modules/stock_product_location/location.py
--- a/modules/stock_product_location/location.py        Tue Nov 18 00:05:02 
2025 +0100
+++ b/modules/stock_product_location/location.py        Fri Nov 21 10:57:32 
2025 +0100
@@ -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 @@
         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'

Reply via email to