Sergi Almacellas Abellana pushed to branch branch/default at Tryton / Tryton


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

Closes #12289
- - - - -


1 changed file:

- modules/stock/location.py


Changes:

=====================================
modules/stock/location.py
=====================================
@@ -406,7 +406,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()
 
@@ -494,7 +494,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/7909707c00f7eaf784ff64243b38b007532655d0

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


Reply via email to