Comment 2 for bug 675417

Revision history for this message
sinoj (sinojsebastian) wrote :

Hello JMA,
   Thank you for your time and effort to trace the problem.

To recreate the issue,

1) on account_voucher module set a default button.
Index: /home/mjk/workspace/npg_jonco/openerp-trunk-server/bin/addons/account_voucher/voucher_payment_receipt_view.xml
===================================================================
--- /home/mjk/workspace/npg_jonco/openerp-trunk-server/bin/addons/account_voucher/voucher_payment_receipt_view.xml (revision 4392)
+++ /home/mjk/workspace/npg_jonco/openerp-trunk-server/bin/addons/account_voucher/voucher_payment_receipt_view.xml (working copy)
@@ -324,7 +324,7 @@
                         <field name="state"/>
                         <button name="cancel_voucher" string="Cancel" states="draft,proforma" icon="gtk-cancel"/>
                         <button name="cancel_voucher" string="Unreconcile" type="object" states="posted" icon="terp-stock_effects-object-colorize" confirm="Are you sure to unreconcile this record ?"/>
- <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward"/>
+ <button name="proforma_voucher" string="Validate" states="draft" icon="gtk-go-forward" default_focus="1"/>
                         <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" icon="terp-stock_effects-object-colorize"/>
                     </group>
                 </form>

2) Install/update the account_voucher module

3) create a new invoice and try to use the payment button.
   This will not open the payment form which is expected.
On the client log, I have an error message. But no error message visible to the user

========================
Traceback (most recent call last):
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/widget/view/form_gtk/parser.py", line 121, in button_clicked
    model.get_button_action(self.form.screen, id, self.attrs)
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/widget/model/record.py", line 376, in get_button_action
    obj._exec_action(result, {}, context=context)
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/modules/action/main.py", line 141, in _exec_action
    limit=datas['limit'], auto_refresh=datas['auto_refresh'], auto_search = datas['auto_search'], search_view = datas['search_view'])
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/modules/gui/window/__init__.py", line 49, in create
    auto_refresh=auto_refresh, auto_search=auto_search, search_view=search_view)
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/modules/gui/window/form.py", line 73, in __init__
    show_search=True, window=self.window, limit=limit, readonly=bool(auto_refresh), auto_search=auto_search, search_view=search_view)
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/widget/screen/screen.py", line 128, in __init__
    self.display()
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/widget/screen/screen.py", line 785, in display
    self.current_view.display()
  File "/home/mjk/workspace/npg_jonco/openobject-client/bin/widget/view/form.py", line 507, in display
    self.screen.window.set_default(button_focus.widget)
AttributeError: 'NoneType' object has no attribute 'set_default'
=================================

Hope you now have enough information to recreate the issue.
Waiting for your response
Sinoj