Merge lp:~openerp-dev/openobject-addons/6.1-opw-585231-skh into lp:openobject-addons/6.1

Proposed by Somesh Khare
Status: Merged
Approved by: Xavier ALT
Approved revision: no longer in the source branch.
Merged at revision: 7168
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-585231-skh
Merge into: lp:openobject-addons/6.1
Diff against target: 16 lines (+5/-1)
1 file modified
edi/models/edi.py (+5/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-585231-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+150743@code.launchpad.net

Description of the change

Hello Sir,

[FIX]EDI: due to the less time interval where system wait for commit of parent transaction when confirming the invoice and sending emails, created email do not have reference number into the email message and attached invoice report have state draft.

Steps:
1. Configure outgoing emails server and set the schedule Action "Email Queue Manager" from "Settings > Configuration > Scheduler >Schedule Action" for interval unit -1.
2. Now create some customers invoice eg: 10 invoice for any one customer (set opt_out=False on partner form on Sales and Purchase tab).
3. Now Select all invoices and press "Confirm Draft Invoice" action Press Confirm Invoices button.
4. Go to Settings > Configuration > Email > Message, look at the email messages, some of the emails have 'n/a' as a reference (Not all). and the attachment in these email have "Draft Invoice" in place of Invoice Reference Number.

The problem is due to the time interval which did not finished the parent transaction as a result it goes into the exception and did not set invoice reference in the new email messages. I have increased the time interval from 3 to 60 seconds.

kindly review the branch and share your views on it.

Thanks,
Somesh Khare

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'edi/models/edi.py'
2--- edi/models/edi.py 2012-08-21 21:47:08 +0000
3+++ edi/models/edi.py 2013-02-28 15:18:24 +0000
4@@ -459,7 +459,11 @@
5 db = pooler.get_db(cr.dbname)
6 local_cr = None
7 try:
8- time.sleep(3) # lame workaround to wait for commit of parent transaction
9+ # lame workaround to wait for commit of parent transaction
10+ wait_try, wait_max_try = 0, 50
11+ while not cr._Cursor__closed and wait_try < wait_max_try:
12+ time.sleep(3)
13+ wait_try += 1
14 # grab a fresh browse_record on local cursor
15 local_cr = db.cursor()
16 web_root_url = self.pool.get('ir.config_parameter').get_param(local_cr, uid, 'web.base.url')