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
=== modified file 'product_ean13_generator/wizard/generator_ean13.py'
--- product_ean13_generator/wizard/generator_ean13.py 2010-06-04 13:19:09 +0000
+++ product_ean13_generator/wizard/generator_ean13.py 2010-06-16 08:40:55 +0000
@@ -43,16 +43,6 @@
4343
44 for product in product_obj.browse(cr, uid, data['ids'], context=context):44 for product in product_obj.browse(cr, uid, data['ids'], context=context):
45 ref = sequence_obj.get(cr, uid, 'generator.ean13')45 ref = sequence_obj.get(cr, uid, 'generator.ean13')
46 sum=0
47 for i in range(12):
48 if is_pair(i):
49 sum += int(ref[i])
50 else:
51 sum += 3 * int(ref[i])
52 new_ean_cc = int(math.ceil(sum / 10.0) * 10 - sum)
53 new_ean = ref + str(new_ean_cc)
54 vals = {'ean13': new_ean}
55 product_obj.write(cr, uid, [product.id], vals)
56 for pack in product.packaging:46 for pack in product.packaging:
57 ref = sequence_obj.get(cr, uid, 'generator.ean13')47 ref = sequence_obj.get(cr, uid, 'generator.ean13')
58 sum=048 sum=0

Subscribers

People subscribed via source and target branches