Update issue6039 (lead time required in production product)

This commit is contained in:
Raimon Esteve 2016-11-18 17:33:58 +01:00
parent 56b2487a64
commit 8b1b1c4885
1 changed files with 5 additions and 2 deletions

View File

@ -180,7 +180,7 @@ diff -r 8b7857967585 trytond/trytond/modules/production/production.py
@staticmethod
def default_state():
return 'draft'
@@ -219,6 +248,17 @@
@@ -219,6 +248,20 @@
def default_company():
return Transaction().context.get('company')
@ -192,7 +192,10 @@ diff -r 8b7857967585 trytond/trytond/modules/production/production.py
+ pattern.setdefault('bom', self.bom.id if self.bom else None)
+ for line in self.product.lead_times:
+ if line.match(pattern):
+ return self.planned_date - line.lead_time
+ if line.lead_time:
+ return self.planned_date - line.lead_time
+ else:
+ return self.planned_date
+ return self.planned_date
+
def _move(self, from_location, to_location, company, product, uom,