Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @api.one
- @api.depends('listing_type')
- def _return_listing_duration(self):
- if not self.listing_type:
- return
- if self.listing_type == 'Chinese':
- self.listing_duration = [
- ('Days_1', '1 days'),
- ('Days_3', '3 days'),
- ('Days_5', '5 days'),
- ('Days_7', '7 days'),
- ('Days_10', '10 days')
- ]
- elif self.listing_type == 'FixedPriceItem':
- self.listing_duration = [
- ('Days_3', '3 days'),
- ('Days_5', '5 days'),
- ('Days_7', '7 days'),
- ('Days_10', '10 days'),
- ('Days_30', '30 days'),
- ('GTC', 'GTC')
- ]
- raise ValueError("Wrong value for %s: %r" % (self, value))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement