summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorSylvain GARANCHER <sylvain.garancher@syleam.fr>2017-05-04 13:55:12 +0200
committerNicolas Martinelli <nim@odoo.com>2017-05-17 13:10:43 +0200
commit57b3894ca0bd0bde55cb2796c674cd9e8bbdbf0b (patch)
tree24f754602f6dad44a14c8e1ffbbe69a351db55b2 /addons
parentf17bc70fbc7f3bb8ea2ec397200796bfef45cf9e (diff)
[IMP] stock: allow to define `from_date`
The context key `from_date` can be retrived from `self.env.context, while the context key `to_date` can be defined for each procurement group. We extend the code so that `from_date` can also be defined for each procurement group. Closes #16803 opw-743013
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/models/procurement.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/stock/models/procurement.py b/addons/stock/models/procurement.py
index 89cdde0c064..2ad0b3812ab 100644
--- a/addons/stock/models/procurement.py
+++ b/addons/stock/models/procurement.py
@@ -322,6 +322,8 @@ class ProcurementOrder(models.Model):
substract_quantity = location_orderpoints.subtract_procurements_from_orderpoints()
for group in location_data['groups']:
+ if group.get('from_date'):
+ product_context['from_date'] = group['from_date'].strftime(DEFAULT_SERVER_DATETIME_FORMAT)
if group['to_date']:
product_context['to_date'] = group['to_date'].strftime(DEFAULT_SERVER_DATETIME_FORMAT)
product_quantity = location_data['products'].with_context(product_context)._product_available()