View difference between Paste ID: AF3Ji5E7 and YkcqKt4U
SHOW: | | - or go back to the newest paste.
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['dealer_price'] = product.dealer_price
19+
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()