odoo/odoo — pull request #1314 by vaab (2014-07-22 16:26:07+00:00)
Title: [FIX] search view wouldn't resolve 'appendTo' promise when ``headless``.

This would lead to various issues depending on which object would wait
for this resolution. For instance, button calling a wizard would wait
for wizard resolving to set themselves to re-enabled state.

Inclusion of the new searchview drawer has remaining bugs. A visual bug would be around buttons that pops up dialog boxes with search-view in headless mode. They will stay disabled after closing the dialog box.

***Impacted versions:***

- 8.0

***Steps to reproduce:***

reproduced on runbot and empty database
1. make sure to have accounting installed, go to an invoice, validate it.
2. click on "Register Payment" button
3. Cancel the wizard.

***Current behavior:***

- Result: the button "Register Payment" is disabled.

***Expected behavior:***

- Result: the button "Register Payment" should be enabled.

***Analysis:***

This is VERY unrelated and quite tedious to debug. The button awaits the action's resolving to go back to "enabled" state. In turn, the action will wait for various other promises. At the very end of a very long chain of promises there is the searchbox from the dialogbox view. This searchbox itself will wait for it's drawer widget to resolve it's own 'appendTo', but the latter will wait for the new "fields_view_get" deferred in the searchview to resolve. This one will never resolve because in the ``start()`` of the searchview a condition will avoid resolving it when it detects it is ``headless``.

I have no idea if my fix has any consequence. Please review thoroughly.