Allow drop shipment's effective date to be defined

issue9787
review318701002
This commit is contained in:
Cédric Krier
2020-11-15 23:55:06 +01:00
parent 3d8fd7cd79
commit a7915f0ef7
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -1,3 +1,4 @@
* Allow drop shipment's effective date to be defined
* Add relate from party to drop shipments
Version 5.8.0 - 2020-11-02
+8 -2
View File
@@ -89,7 +89,13 @@ class ShipmentDrop(Workflow, ModelSQL, ModelView):
"Drop Shipment"
__name__ = 'stock.shipment.drop'
effective_date = fields.Date('Effective Date', readonly=True)
effective_date = fields.Date(
"Effective Date",
states={
'readonly': Eval('state').in_(['cancelled', 'done']),
},
depends=['state'],
help="When the stock was actually sent.")
planned_date = fields.Date('Planned Date', states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
@@ -556,7 +562,7 @@ class ShipmentDrop(Workflow, ModelSQL, ModelView):
Move = pool.get('stock.move')
Date = pool.get('ir.date')
Move.do([m for s in shipments for m in s.customer_moves])
cls.write(shipments, {
cls.write([s for s in shipments if not s.effective_date], {
'effective_date': Date.today(),
})