Merge lp:~openerp-dev/openobject-addons/6.0-opw-16423-ira into lp:openobject-addons/6.0

Proposed by Ila Rana(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-16423-ira
Merge into: lp:openobject-addons/6.0
Diff against target: 23 lines (+2/-4)
1 file modified
crm_profiling/crm_profiling.py (+2/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-16423-ira
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) (community) Needs Fixing
Review via email: mp+69654@code.launchpad.net

Description of the change

Hello,

crm_profiling: Improvement in Unique key contraints.

Regards,
Ila Rana.

To post a comment you must log in.
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Ila,

I disagree with the treatment. You opted to remove(-) the records rather than stopping them to be added(+).

On a positive note, code should like this:
if x[0] not in temp:
    temp.append(x[0])

Hope this helps.

Thanks.

review: Needs Fixing

Unmerged revisions

4736. By Ila Rana(Open ERP)

[FIX]:crm_profiling:improvement in unique key constraint(case:16423)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm_profiling/crm_profiling.py'
2--- crm_profiling/crm_profiling.py 2011-01-14 00:11:01 +0000
3+++ crm_profiling/crm_profiling.py 2011-07-28 13:51:35 +0000
4@@ -226,8 +226,9 @@
5 query = "select answer from partner_question_rel where partner=%s"
6 cr.execute(query, (data['id'],))
7 for x in cr.fetchall():
8+ if x[0] in temp:
9+ temp.remove(x[0])
10 temp.append(x[0])
11-
12 self.write(cr, uid, [data['id']], {'answers_ids':[[6, 0, temp]]}, context=context)
13 return {}
14
15@@ -310,9 +311,6 @@
16 for pid in to_remove_list:
17 partners.remove(pid)
18
19- for partner_id in partners:
20- cr.execute('insert into res_partner_category_rel (category_id,partner_id) values (%s,%s)', (categ['categ_id'][0],partner_id))
21-
22 self.write(cr, uid, [id], {'state':'not running', 'partner_id':0})
23 return True
24