Set planned date of backorder move to today

issue6700
review42581002
This commit is contained in:
Cédric Krier
2017-09-03 11:21:16 +02:00
parent fdf9fe590d
commit 6e4a06c8d0
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Plan backorder moves to today
* Add cron task to process confirmed sale
* Add report_address property on sale
+6 -1
View File
@@ -1450,6 +1450,7 @@ class SaleLine(sequence_ordered(), ModelSQL, ModelView):
'''
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
if self.type != 'line':
return
@@ -1483,7 +1484,11 @@ class SaleLine(sequence_ordered(), ModelSQL, ModelView):
move.company = self.sale.company
move.unit_price = self.unit_price
move.currency = self.sale.currency
move.planned_date = self.shipping_date
if self.moves:
# backorder can not be planned
move.planned_date = Date.today()
else:
move.planned_date = self.shipping_date
move.invoice_lines = self._get_move_invoice_lines(shipment_type)
move.origin = self
return move