/usr/share/pyshared/trytond/modules/sale_price_list/product.py is in tryton-modules-sale-price-list 2.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #This file is part of Tryton. The COPYRIGHT file at the top level
#of this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
from trytond.transaction import Transaction
from trytond.pool import Pool
class Product(ModelSQL, ModelView):
_name = 'product.product'
def get_sale_price(self, ids, quantity=0):
price_list_obj = Pool().get('product.price_list')
res = super(Product, self).get_sale_price(ids, quantity=quantity)
if (Transaction().context.get('price_list')
and Transaction().context.get('customer')):
for product in self.browse(ids):
res[product.id] = price_list_obj.compute(
Transaction().context['price_list'],
Transaction().context['customer'],
product, res[product.id], quantity,
Transaction().context.get('uom', product.default_uom))
return res
Product()
|