Attribute error on opening invoice from invoices list

Bug #393840 reported by Freerk Kalsbeek (Mindswitch BV)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Jay Vora (Serpent Consulting Services)

Bug Description

When accessing an invoice through the following sequence:
-> Financial Admin -> Invoices
and than clicking one of the invoices I get the following error:

[2009-06-30 14:21:22,477] ERROR:web-services:[01]: Traceback (most recent call last):
[2009-06-30 14:21:22,477] ERROR:web-services:[02]: File "/home/freerk/openerp/server/bin/osv/osv.py", line 59, in wrapper
[2009-06-30 14:21:22,478] ERROR:web-services:[03]: return f(self, dbname, *args, **kwargs)
[2009-06-30 14:21:22,478] ERROR:web-services:[04]: File "/home/freerk/openerp/server/bin/osv/osv.py", line 119, in execute
[2009-06-30 14:21:22,478] ERROR:web-services:[05]: res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-06-30 14:21:22,478] ERROR:web-services:[06]: File "/home/freerk/openerp/server/bin/osv/osv.py", line 111, in execute_cr
[2009-06-30 14:21:22,478] ERROR:web-services:[07]: return getattr(object, method)(cr, uid, *args, **kw)
[2009-06-30 14:21:22,478] ERROR:web-services:[08]: File "/home/freerk/openerp/server/bin/osv/orm.py", line 1091, in fields_view_get
[2009-06-30 14:21:22,478] ERROR:web-services:[09]: result['arch'] = _inherit_apply_rec(result['arch'], sql_res[3])
[2009-06-30 14:21:22,479] ERROR:web-services:[10]: File "/home/freerk/openerp/server/bin/osv/orm.py", line 1087, in _inherit_apply_rec
[2009-06-30 14:21:22,479] ERROR:web-services:[11]: result = _inherit_apply(result, inherit)
[2009-06-30 14:21:22,479] ERROR:web-services:[12]: File "/home/freerk/openerp/server/bin/osv/orm.py", line 1047, in _inherit_apply
[2009-06-30 14:21:22,479] ERROR:web-services:[13]: raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag)
[2009-06-30 14:21:22,479] ERROR:web-services:[14]: AttributeError: Couldn't find tag '<field widget="one2many_list" colspan="4" nolabel="1" name="invoice_line">' in parent view !

Happens on both Webclient and GTK client.

Already performed an update=all on the database, but that didn't help.
A backup of the database is available for analysis.

description: updated
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello,

You must be trying with account_tax_include module installed.This module uses the mentioned line, but we dont get such a problem.

I guess you have done any changes, and these affects.

Thanks.

Changed in openobject-addons:
status: New → Invalid
Revision history for this message
Freerk Kalsbeek (Mindswitch BV) (f-kalsbeek) wrote : RE: [Bug 393840] Re: Attribute error on opening invoice from invoices list
Download full text (3.2 KiB)

Hi,

The account_tax_incluce module is installed, but we have not made any changes.

Do you have idea's on how to pinpoint the problem? Is there a way to get more detailed output on what exactly is going wrong?

Met vriendelijke groet,

Freerk Kalsbeek

Mindswitch BV
Bronsweg 7

8211 AL  Lelystad

http://www.mindswitch.nl/

+31 320 412 832
+31 655 306 811

-----Oorspronkelijk bericht-----
Van: Jay (Open ERP) <email address hidden>
Verzonden: di 30-06-2009 17:00
Aan: Freerk Kalsbeek <email address hidden>;
Onderwerp: [Bug 393840] Re: Attribute error on opening invoice from invoices list

Hello,

You must be trying with account_tax_include module installed.This module
uses the mentioned line, but we dont get such a problem.

I guess you have done any changes, and these affects.

Thanks.

** Changed in: openobject-addons
      Status: New => Invalid

--
Attribute error on opening invoice from invoices list
https://bugs.launchpad.net/bugs/393840
You received this bug notification because you are a direct subscriber
of the bug.

Status in OpenObject Addons Modules: Invalid

Bug description:
When accessing an invoice through the following sequence:
-> Financial Admin -> Invoices
and than clicking one of the invoices I get the following error:

[2009-06-30 14:21:22,477] ERROR:web-services:[01]: Traceback (most recent call last):
[2009-06-30 14:21:22,477] ERROR:web-services:[02]:   File "/home/freerk/openerp/server/bin/osv/osv.py", line 59, in wrapper
[2009-06-30 14:21:22,478] ERROR:web-services:[03]:     return f(self, dbname, *args, **kwargs)
[2009-06-30 14:21:22,478] ERROR:web-services:[04]:   File "/home/freerk/openerp/server/bin/osv/osv.py", line 119, in execute
[2009-06-30 14:21:22,478] ERROR:web-services:[05]:     res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
[2009-06-30 14:21:22,478] ERROR:web-services:[06]:   File "/home/freerk/openerp/server/bin/osv/osv.py", line 111, in execute_cr
[2009-06-30 14:21:22,478] ERROR:web-services:[07]:     return getattr(object, method)(cr, uid, *args, **kw)
[2009-06-30 14:21:22,478] ERROR:web-services:[08]:   File "/home/freerk/openerp/server/bin/osv/orm.py", line 1091, in fields_view_get
[2009-06-30 14:21:22,478] ERROR:web-services:[09]:     result['arch'] = _inherit_apply_rec(result['arch'], sql_res[3])
[2009-06-30 14:21:22,479] ERROR:web-services:[10]:   File "/home/freerk/openerp/server/bin/osv/orm.py", line 1087, in _inherit_apply_rec
[2009-06-30 14:21:22,479] ERROR:web-services:[11]:     result = _inherit_apply(result, inherit)
[2009-06-30 14:21:22,479] ERROR:web-services:[12]:   File "/home/freerk/openerp/server/bin/osv/orm.py", line 1047, in _inherit_apply
[2009-06-30 14:21:22,479] ERROR:web-services:[13]:     raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag)
[2009-06-30 14:21:22,479] ERROR:web-services:[14]: AttributeError: Couldn't find tag '<field widget="one2many_list" colspan="4" nolabel="1" name="invoice_line">' in parent view !

Happens on both Webclient and GTK client.

Already performed an update=all on the database, but that didn't help.
A backup o...

Read more...

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi Freerk,

Can you please go to account_tax_include/invoice_tax_incl.xml ?

Or better to go at Administration/Customization/User Interface/Views.
Search for the view named account.invoice.vat.exlcuded.view.form.

Make any change to the field tag with name='invoice_line'. e.g. colspan="5".
GO and check again for the error.

if you are in file ,Look at the <record id="account_invoice_view_price". and change accordingly. you need to update the module.

I guess,This xml record is causing problems for you.

I still request you to make sure you are using latest code for addons.

Thank You.

Revision history for this message
Freerk Kalsbeek (Mindswitch BV) (f-kalsbeek) wrote :
Download full text (11.0 KiB)

Hi Jay,

I've tried it, but did not help.

Instead of colspan=4 it gives me the same error with colspan=5.

At least I'm sure that's the one, but it didn't solve it.

What I did is I made a change in orm.py

@@ -1044,7 +1045,7 @@
                         if attr != 'position'
                     ])
                     tag = "<%s%s>" % (node2.localName, attrs)
-                    raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag)
+                    raise AttributeError(_("Couldn't find tag '%s' in parent view %s !") % (tag, src))
             return doc_src.toxml(encoding="utf-8").replace('\t', '')

         result = {'type': view_type, 'model': self._name}

So it shows me the context

Result is:

Traceback (most recent call last):
  File "/home/freerk/openerp/server/bin/netsvc.py", line 235, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/freerk/openerp/server/bin/netsvc.py", line 74, in __call__
    return getattr(self, method)(*params)
  File "/home/freerk/openerp/server/bin/service/web_services.py", line 549, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/home/freerk/openerp/server/bin/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/freerk/openerp/server/bin/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/freerk/openerp/server/bin/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/freerk/openerp/server/bin/osv/orm.py", line 1092, in fields_view_get
    result['arch'] = _inherit_apply_rec(result['arch'], sql_res[3])
  File "/home/freerk/openerp/server/bin/osv/orm.py", line 1088, in _inherit_apply_rec
    result = _inherit_apply(result, inherit)
  File "/home/freerk/openerp/server/bin/osv/orm.py", line 1048, in _inherit_apply
    raise AttributeError(_("Couldn't find tag '%s' in parent view %s !") % (tag, src))
AttributeError: Couldn't find tag '<field widget="one2many_list" colspan="5" nolabel="1" name="invoice_line">' in parent view <?xml version="1.0" encoding="utf-8"?>
<form string="Invoice">
                    <group col="6" colspan="4">
                        <field groups="base.group_user" name="journal_id" select="2"/>
                        <field name="type" readonly="1" select="2"/>
                        <field name="number" select="1"/>
                        <field groups="base.group_user" name="partner_id" on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term)" select="1"/>
                        <field domain="[('partner_id','=',partner_id)]" name="address_invoice_id"/>
                        <field name="currency_id" on_change="onchange_currency_id(currency_id)" select="2"/>
                        <field name="date_invoice" select="1"/>
                        <field groups="base.group_user" name="period_id"/>
                        <group col="1" colspan="2" groups="base.group_user">
                            <label align="0.0" string="(keep empty to use the current period...

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Freerk,

I see that you have installed account_invoice_layout too.
this module replaces invoice_lines by abstract_line_ids.

So is the cause of the error.

you can change the errornes xml record for abstract_line_ids for your own sake of simplicity.

I note this error, and many thanks for this issue.

We will sooner fix this.

Thanks.

Changed in openobject-addons:
assignee: nobody → Jay (Open ERP) (jvo-openerp)
status: Invalid → Confirmed
Revision history for this message
Freerk Kalsbeek (Mindswitch BV) (f-kalsbeek) wrote :
Download full text (13.9 KiB)

Hi Jay,

Thanx, I have de-installed the account_tax_include module and the issue is now solved.

I will monitor this issue so we can test using the module again when the bug is fixed

Met vriendelijke groet,

Freerk Kalsbeek

Mindswitch BV
Bronsweg 7

8211 AL  Lelystad

http://www.mindswitch.nl/

+31 320 412 832
+31 655 306 811

-----Oorspronkelijk bericht-----
Van: Freerk Kalsbeek (Mindswitch BV) <email address hidden>
Verzonden: wo 01-07-2009 13:15
Aan: Freerk Kalsbeek <email address hidden>;
Onderwerp: RE: [Bug 393840] Re: Attribute error on opening invoice from invoices list

Hi Jay,

I've tried it, but did not help.

Instead of colspan=4 it gives me the same error with colspan=5.

At least I'm sure that's the one, but it didn't solve it.

What I did is I made a change in orm.py

@@ -1044,7 +1045,7 @@
                         if attr != 'position'
                     ])
                     tag = "<%s%s>" % (node2.localName, attrs)
-                    raise AttributeError(_("Couldn't find tag '%s' in parent view !") % tag)
+                    raise AttributeError(_("Couldn't find tag '%s' in parent view %s !") % (tag, src))
             return doc_src.toxml(encoding="utf-8").replace('\t', '')

         result = {'type': view_type, 'model': self._name}

So it shows me the context

Result is:

Traceback (most recent call last):
  File "/home/freerk/openerp/server/bin/netsvc.py", line 235, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/home/freerk/openerp/server/bin/netsvc.py", line 74, in __call__
    return getattr(self, method)(*params)
  File "/home/freerk/openerp/server/bin/service/web_services.py", line 549, in execute
    res = service.execute(db, uid, object, method, *args)
  File "/home/freerk/openerp/server/bin/osv/osv.py", line 59, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/freerk/openerp/server/bin/osv/osv.py", line 119, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/freerk/openerp/server/bin/osv/osv.py", line 111, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/freerk/openerp/server/bin/osv/orm.py", line 1092, in fields_view_get
    result['arch'] = _inherit_apply_rec(result['arch'], sql_res[3])
  File "/home/freerk/openerp/server/bin/osv/orm.py", line 1088, in _inherit_apply_rec
    result = _inherit_apply(result, inherit)
  File "/home/freerk/openerp/server/bin/osv/orm.py", line 1048, in _inherit_apply
    raise AttributeError(_("Couldn't find tag '%s' in parent view %s !") % (tag, src))
AttributeError: Couldn't find tag '<field widget="one2many_list" colspan="5" nolabel="1" name="invoice_line">' in parent view <?xml version="1.0" encoding="utf-8"?>
<form string="Invoice">
                    <group col="6" colspan="4">
                        <field groups="base.group_user" name="journal_id" select="2"/>
                        <field name="type" readonly="1" select="2"/>
                        <field name="number" select="1"/>
                        <field groups="b...

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Fixed in revision 2340.
Thank you for reporting.

Please check and notify us.

Changed in openobject-addons:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.