Cédric Krier pushed to branch branch/5.0 at Tryton / Tryton


Commits:
67ec9d61 by Sergi Almacellas Abellana at 2023-05-25T15:55:40+02:00
Manage empty stock end date values on location quantities

Closes #12289
(grafted from 7909707c00f7eaf784ff64243b38b007532655d0)
- - - - -


1 changed file:

- modules/stock/location.py


Changes:

=====================================
modules/stock/location.py
=====================================
@@ -314,7 +314,7 @@
 
         context = {}
         if (name == 'quantity'
-                and (trans_context.get('stock_date_end', datetime.date.max)
+                and ((trans_context.get('stock_date_end') or datetime.date.max)
                     > Date_.today())):
             context['stock_date_end'] = Date_.today()
 
@@ -385,7 +385,7 @@
                 return Template(trans_context['product_template'])
 
         context = {}
-        if 'stock_date_end' in trans_context:
+        if trans_context.get('stock_date_end') is not None:
             # Use the last cost_price of the day
             context['_datetime'] = datetime.datetime.combine(
                 trans_context['stock_date_end'], datetime.time.max)



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/67ec9d6170cd3011982cf448dd5243839f5229a2

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/67ec9d6170cd3011982cf448dd5243839f5229a2
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to