Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.69 KB | None | 0 0
  1.  
  2.                 if x == 1: month = "January"
  3.                 elif x == 2: month = "February"
  4.                 elif x == 3: month = "March"
  5.                 elif x == 4: month = "April"
  6.                 elif x == 5: month = "May"
  7.                 elif x == 6: month = "June"
  8.                 elif x == 7: month = "July"
  9.                 elif x == 8: month = "August"
  10.                 elif x == 9: month = "September"
  11.                 elif x == 10: month = "October"
  12.                 elif x == 11: month = "November"
  13.                 elif x == 12: month = "December"                                            
  14.                 for tiket in tiket_obj.browse(self.cr, self.uid, tiket_ids):
  15.                    
  16.                     ticket_date = datetime.strptime(tiket.create_date, '%Y-%m-%d %H:%M:%S')
  17.                    
  18.                     if int(ticket_date.month) == int(x):
  19.                         amount += tiket.price
  20.                                                                                                                                                                                                                                                                
  21.                 result = {
  22.                           'period': month,                                                            
  23.                           'amount': amount,                                                                    
  24.                           }                                                                                                                                                                                                    
  25.                                
  26.                 data.append(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement