How to do it...

To update a book's date_updated field, you can write a new method called change_update_date(), which is defined as follows:

@api.multi
def change_update_date(self):
self.ensure_one()
self.date_updated = fields.Datetime.now()

Then, you can add a button in the book's <form> view in xml, as follows:

<button name="change_update_date" string="Update Date" type="object"/>

Restart the server and update the my_library module to see the changes. Upon clicking the Update Date button, update_date will be changed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset