Merge lp:~juan-pimentel/bank-management/juan-pimentel_bank-management_bug921161 into lp:bank-management/trunk

Proposed by Juan José Pimentel (Digisolution)
Status: Merged
Merged at revision: 39
Proposed branch: lp:~juan-pimentel/bank-management/juan-pimentel_bank-management_bug921161
Merge into: lp:bank-management/trunk
Diff against target: 48 lines (+23/-8)
1 file modified
bank_management/check/check_book.py (+23/-8)
To merge this branch: bzr merge lp:~juan-pimentel/bank-management/juan-pimentel_bank-management_bug921161
Reviewer Review Type Date Requested Status
Javier Duran (community) Approve
Review via email: mp+90116@code.launchpad.net

Description of the change

Is corrected generation of numbers in checks

To post a comment you must log in.
Revision history for this message
Javier Duran (javieredm) wrote :

Unido a la rama principal:

revno: 39 [merge]
revision-id: javier@squezee-vir-20120126213827-7hxpi0aeci0c0ini

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bank_management/check/check_book.py'
2--- bank_management/check/check_book.py 2012-01-24 20:27:38 +0000
3+++ bank_management/check/check_book.py 2012-01-26 21:01:28 +0000
4@@ -277,13 +277,26 @@
5 values['prefix'] = str(book.prefix).rjust(4,'0')
6 else:#si no es constante
7 values['prefix']=''
8- for suffix in range(book.from_suffix,book.to_suffix + 1):
9- values.update({
10- 'suffix': str(suffix).rjust(4,'0'),
11- 'check_book_id': book.id,
12- })
13- self.pool.get('check.note').create(cr, uid, values)
14-
15+ if book.to_suffix<book.from_suffix:
16+ for suffix in range(book.from_suffix,10000):
17+ values.update({
18+ 'suffix': str(suffix).rjust(4,'0'),
19+ 'check_book_id':book.id,
20+ })
21+ self.pool.get('check.note').create(cr, uid, values)
22+ for suffix in range(book.to_suffix+1):
23+ values.update({
24+ 'suffix': str(suffix).rjust(4,'0'),
25+ 'check_book_id':book.id,
26+ })
27+ self.pool.get('check.note').create(cr, uid, values)
28+ else:
29+ for suffix in range(book.from_suffix,book.to_suffix+1):
30+ values.update({
31+ 'suffix': str(suffix).rjust(4,'0'),
32+ 'check_book_id':bbok.id,
33+ })
34+ self.pool.get('check.note').create(cr, uid, values)
35 return True
36
37 def _get_name_check(self, cr, uid, ids, context):
38@@ -313,7 +326,9 @@
39 #se calcula el to_suffix hasta
40 books = self.browse(cr,uid,ids)
41 for book in books:
42- de_sufijo=book.from_suffix+int(book.qty_check)-1
43+ de_sufijo=book.from_suffix+int(book.qty_check)-1
44+ if de_sufijo>=9999:
45+ de_sufijo-=10000
46 self.write(cr,uid,book.id,{'to_suffix' : de_sufijo})
47 #se cargan los cheques
48 self.load_check(cr, uid, ids, context)

Subscribers

People subscribed via source and target branches