Advertisement
Guest User

Untitled

a guest
Jan 2nd, 2012
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from decimal import Decimal
  2.  
  3. class PriceList(ModelSQL, ModelView):
  4. _name = 'product.price_list'
  5.  
  6. def _get_context_price_list_line(self, party, product, unit_price,
  7. , dealer_price, quantity, uom):
  8. '''
  9. Get price list context for unit price
  10.  
  11. :param party: the BrowseRecord of the party.party
  12. :param product: the BrowseRecord of the product.product
  13. :param unit_price: a Decimal for the default unit price in the
  14. company's currency and default uom of the product
  15. :param quantity: the quantity of product
  16. :param uom: the BrowseRecord of the product.uom
  17. :return: a dictionary
  18. '''
  19. context = super(PriceList, self)._get_context_price_list_line(
  20. party, product, unit_price, quantity, uom)
  21. if product:
  22. context['dealer_price'] = product.dealer_price
  23. else:
  24. context['dealer_price'] = Decimal('0')
  25. return context
  26.  
  27. Pricelist()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement