Merge lp:~openbig/bigconsulting/changes_product_ean_code into lp:bigconsulting

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 19
Proposed branch: lp:~openbig/bigconsulting/changes_product_ean_code
Merge into: lp:bigconsulting
Diff against target: 20 lines (+0/-10)
1 file modified
product_ean13_generator/wizard/generator_ean13.py (+0/-10)
To merge this branch: bzr merge lp:~openbig/bigconsulting/changes_product_ean_code
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+27688@code.launchpad.net

Description of the change

Now generate ean code only for packages lines not for ean13 field

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 'product_ean13_generator/wizard/generator_ean13.py'
2--- product_ean13_generator/wizard/generator_ean13.py 2010-06-04 13:19:09 +0000
3+++ product_ean13_generator/wizard/generator_ean13.py 2010-06-16 08:40:55 +0000
4@@ -43,16 +43,6 @@
5
6 for product in product_obj.browse(cr, uid, data['ids'], context=context):
7 ref = sequence_obj.get(cr, uid, 'generator.ean13')
8- sum=0
9- for i in range(12):
10- if is_pair(i):
11- sum += int(ref[i])
12- else:
13- sum += 3 * int(ref[i])
14- new_ean_cc = int(math.ceil(sum / 10.0) * 10 - sum)
15- new_ean = ref + str(new_ean_cc)
16- vals = {'ean13': new_ean}
17- product_obj.write(cr, uid, [product.id], vals)
18 for pack in product.packaging:
19 ref = sequence_obj.get(cr, uid, 'generator.ean13')
20 sum=0

Subscribers

People subscribed via source and target branches