The first time Odoo calls the button, the action context is a list holding the button context attribute as a string:
Array [ "{'default_title':title, 'default_qty':qty}" ]
The next time it is called (without refreshing the page), the context is evaluated as a compound context and the evaluation context is wrong because it uses the values of the first record and this is why the default values did not change.
If you alter the evaluation context in the handle_button, Odoo should load the correct default values
Example:
if (action.context && action.context.__contexts) {
action.context.__eval_context = this.records.get(id).toContext();
}
Solution
Instead of using the button context to set the default values, you can use directly the action context
Example:
@api.multi
def open_details(self):
self.ensure_one()
return {
'name': "Details",
'view_type': 'form',
'view_mode': 'form',
'view_id': False,
'res_model': 'accommodation.details',
'type': 'ir.actions.act_window',
'target': 'new',
'context': {'default_title': self.title, 'default_qty': self.qty}
}