How do I go about creating a button that sets the state of purchase order to done?
I have in my purchase.py file
def action_done(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state': 'done'}, context=context)
return True
I then added the line action_done in xml. When I click the button, it says no attribute for purchase order. I've already updated the modules, and also rebooted the server. The action is defined in the purchase.py file
you most have in the xml view, for example, in the form view a button <button name="action_done" type="workflow" string="Done" />