This field is originally defined in the class stock.picking. The delivery order is based on the class stock.picking.out which inherits from stock.picking
The field definition is :
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
To make this field editable while the order is delivered, i.e. state is 'done', you have to remove the 'done' key from the states dictionary. I inherited the stock.picking class and overrode this field then nothing changed in the delivery order screen. I then inherited the stock.picking.out class and added to the _columns dictionary the following key:
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={cancel':[('readonly',True)]}),
, restarted the server and upgraded my custom module which includes the inherited class and went to the delivery order screen and found that the field 'done_date' is editable.
I hope this replies your question.
Curious why you want to do this. The reason fields are read-only to users is so that Odoo can use them. This field gets set by Odoo, and on if you ever need to process a delivery and set the date back, you should be using 'Date of Transfer' on the Additional Information tab. You should know that your changes to this date field may not be preserved as Odoo may edit this field after you.
Generally, I agree with you. But for our case I checked and found that the 'Date of Transfer' you mentioned is the 'date_done' Kevin cited above. This field is editable in all states except 'cancel' and 'done' states. This field has the attribute "required=False", and when the user didn't enter a date in this field the system fills it automatically with the system date. My opinion is that why don't give the user a chance to add the delivery date after the delivery in case he forgot to add it. What do you think?
Thanks for the message Ray,
The reason is that sometimes we’ll raise the invoice a few days before delivery is physically made so we would sometimes like to amend the date.
I could add another field to the object and use on the delivery note but thought it might be easier to edit the existing field?
Thanks and regards,
Kevin
From: Ray Carnes [mailto:rcarnes-ursainfosystems-com@mail.odoo.com]
Sent: 31 July 2015 18:54
To: Kevin Starkey <kevin@atg-equip.com>
Subject: Re: Make a field editable
Curious why you want to do this. The reason fields are read-only to users is so that Odoo can use them. This field gets set by Odoo, and on if you ever need to process a delivery and set the date back, you should be using 'Date of Transfer' on the Additional Information tab. You should know that your changes to this date field may not be preserved as Odoo may edit this field after you.
--
Ray Carnes
Sent by Odoo Inc. using Odoo about Forum Post Make a field editable