Advertisement
Guest User

Untitled

a guest
May 5th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. @api.one
  2.     @api.depends('listing_type')
  3.     def _return_listing_duration(self):
  4.         if not self.listing_type:
  5.             return
  6.         if self.listing_type == 'Chinese':
  7.             self.listing_duration = [
  8.                 ('Days_1', '1 days'),
  9.                 ('Days_3', '3 days'),
  10.                 ('Days_5', '5 days'),
  11.                 ('Days_7', '7 days'),
  12.                 ('Days_10', '10 days')
  13.             ]
  14.         elif self.listing_type == 'FixedPriceItem':
  15.             self.listing_duration = [
  16.                 ('Days_3', '3 days'),
  17.                 ('Days_5', '5 days'),
  18.                 ('Days_7', '7 days'),
  19.                 ('Days_10', '10 days'),
  20.                 ('Days_30', '30 days'),
  21.                 ('GTC', 'GTC')
  22.             ]
  23.  
  24.  
  25.  
  26.  
  27.  
  28. raise ValueError("Wrong value for %s: %r" % (self, value))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement