account_followup.stat in account_followup module getting records with same id and throwing error on opening Follow-ups Sent

Bug #798615 reported by Sinoj Sebastin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP Publisher's Warranty Team

Bug Description

We are not able to use "Accounting/Reporting/Generic Reporting/Partners/Follow-ups Sent". In the old database with many invoices and transactions I am getting the following error.
  File "/home/workspace/npg_jonco/openerp-trunk-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/workspace/npg_jonco/openerp-trunk-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/workspace/npg_jonco/openerp-trunk-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/workspace/npg_jonco/openerp-trunk-server/bin/addons/account_followup/report/account_followup_report.py", line 64, in read_group
    return super(account_followup_stat, self).read_group(cr, uid, domain, *args, **kwargs)
  File "/home/workspace/npg_jonco/openerp-trunk-server/bin/osv/orm.py", line 2228, in read_group
    d['__domain'] = [(groupby, '=', alldata[d['id']][groupby] or False)] + domain
KeyError: 'followup_id'

To check whether it is an issue with our module, we created new database and created some invoice with same partner and validate. Then go to "Accounting/Reporting/Generic Reporting/Partners/Follow-ups Sent" and open the list. It open without any issues with grouped by Followup Level. But when we clicked on Expand icon on "Follow ups" to see the list under the follow up, the client hangs. This hangs all computer taking lot of CPU. When I check the database, I can see account_followup_stat View having records with same ids. I think this is the issue. Please check and fix the issue.

Thankyou.

Tags: maintenance

Related branches

Changed in openobject-server:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Changed in openobject-server:
status: New → Confirmed
Changed in openobject-server:
status: Confirmed → In Progress
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Sinoj,

  I have investigated the issue and I agree with you that the problem is being caused only due to duplicate ids in the records. I have found a solution for the same.

  It has been fixed by revision 4668 <email address hidden> in the branch lp:~openerp-dev/openobject-addons/6.0-opw-6306-ach.

It will be merged soon in the stable v6.

Thanks for pointing out towards the issue.

Changed in openobject-server:
status: In Progress → Fix Committed
importance: Undecided → Medium
Revision history for this message
Sinoj Sebastin (ssebastian) wrote :

Hello Anup,
I checked the fix and try the change in code. It reduces the number of duplicates a lot, but still have some duplicate entries. Please try to make more than one invoices with different periods. It will create duplicate entries in account_followup_stat with same id and hang the computer when try to expand " Accounting/Reporting/Generic Reporting/Partners/Follow-ups Sent".

Revision history for this message
Sinoj Sebastin (ssebastian) wrote :

Hello Anup,
Please let us know if there is any progress in above issue.
Thank you.

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

Sinoj,

Thanks for being rapid on it.

Can you share some screenshot or video in order to make us see the new problem?

Thanks a lot.

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Sinoj,

   Yes you are right. It still crashes when you've different periods. So I have found a solution by which now we won't have similar ids.

   It has been fixed by revision 4688 <email address hidden> in the branch lp:~openerp-dev/openobject-addons/6.0-opw-6306-ach.

Thanks.

Changed in openobject-server:
status: In Progress → Fix Committed
Revision history for this message
Sinoj Sebastin (ssebastian) wrote :

Thank you Anup.

affects: openobject-server → openobject-addons
Revision history for this message
Sinoj Sebastin (ssebastian) wrote :

Hello,
Now there is new issue with followups send wizard. You have changed the id of account_followup_stat to (l.company_id*10000+l.partner_id*100+l.period_id). But in the wizard, it is using the partner id to browse 'account_followup.stat' (/account_followup/wizard/account_followup_print.py Line#:216). This throws the following error.

Environment Information :
System : Linux-2.6.35-22-generic-x86_64-with-Ubuntu-10.10-maverick
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick
Operating System Release : 2.6.35-22-generic
Operating System Version : #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010
Operating System Architecture : 64bit
Operating System Locale : en_US.UTF8
Python Version : 2.6.6
OpenERP-Client Version : 6.0.2
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/service/web_services.py", line 599, in dispatch
    res = fn(db, uid, *params)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/addons/audittrail/audittrail.py", line 511, in execute
    res = my_fct(db, uid, model, method, *args)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/addons/audittrail/audittrail.py", line 495, in my_fct
    return fct_src(db, uid, model, method, *args)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/addons/account_followup/wizard/account_followup_print.py", line 223, in do_mail
    partners.append(line.partner_id)
  File "/home/zbeanz/workspace/server/openerp-trunk-server/bin/osv/orm.py", line 294, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field partner_id not found in browse_record(account_followup.stat, 2345)'

Please check this.
Thank you.

Changed in openobject-addons:
status: Fix Committed → Incomplete
Changed in openobject-addons:
status: Incomplete → In Progress
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Sinoj,

   I totally agree with you. It was a regression Indeed. It has been fixed by revision 4698 <email address hidden> in the branch lp:~openerp-dev/openobject-addons/6.0-opw-6306-ach.

Kindly check it and notify us regarding the results.

Thanks a lot for notifying towards such a hidden issue.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Sinoj Sebastin (ssebastian) wrote :

Hello Anup,
Could you please try to send email after from "Accounting/Periodical Processing/Billing/Send followups". I have 33 followup records for customer in different date and different amount. Now when I send the mail, it is delivering 33 copy of followup mail for last record created. Please see the email body below. This is body for all 33 mails. Also it says "Please find in attachment..". But I cannot see any attachments.
============================Mail Body==================================================
Date : 2011-07-11

Dear Test Customer,

Please find in attachment a reminder of all your unpaid invoices, for a total amount due of:

334.38 USD

Thanks,
--
Administrator
Company Name
=======================================================================================
 Please fix and test all cases related to this.
Thank you.

Changed in openobject-addons:
status: Fix Committed → In Progress
Revision history for this message
Steven_M (stevenmoca) wrote :

Any updates on this one?

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Sinoj,

The issue has been resolved by revision 4729 <email address hidden> in the branch lp:~openerp-dev/openobject-addons/6.0-opw-6306-ach.

Thanks for pointing out towards the hidden issues,

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Sinoj Sebastin (ssebastian) wrote :

Hello Anup,
The multiple email issue is solved. But there is no attachment with the mail.

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Sinoj,

Yes, You are right the attachments are not being sent. I have also fixed that.

It has been fixed by revision 4732 <email address hidden>

Thanks.

Changed in openobject-addons:
status: Fix Committed → 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.