addons14/contract/models/abstract_contract_line.py
def _compute_price_unit(self):
        """Get the specific price if no auto-price, and the price obtained
        from the pricelist otherwise.
        """
        for line in self:
            if line.automatic_price:
                pricelist = (
                    line.contract_id.pricelist_id
                    or line.contract_id.partner_id.with_company(
                        line.contract_id.company_id
                    ).property_product_pricelist
                )
                product = line.product_id.with_context(
                    quantity=line.env.context.get(
                        "contract_line_qty",
                        line.quantity,
                    ),
                    pricelist=pricelist.id,
                    partner=line.contract_id.partner_id.id,
                    date=line.env.context.get(
                        "old_date", fields.Date.context_today(line)
                    ),
                )
                line.price_unit = product.price
            else:
                line.price_unit = line.specific_price
Get the specific price if no auto-price, and the price obtained
        from the pricelist otherwise.
        
Get the specific price if no auto-price, and the price obtained
from the pricelist otherwise.
Get the specific price if no auto - price and the price obtained from the pricelist otherwise .
def _compute_price_unit(self):
        for line in self:
            if line.automatic_price:
                pricelist = (
                    line.contract_id.pricelist_id
                    or line.contract_id.partner_id.with_company(
                        line.contract_id.company_id
                    ).property_product_pricelist
                )
                product = line.product_id.with_context(
                    quantity=line.env.context.get(
                        "contract_line_qty",
                        line.quantity,
                    ),
                    pricelist=pricelist.id,
                    partner=line.contract_id.partner_id.id,
                    date=line.env.context.get(
                        "old_date", fields.Date.context_today(line)
                    ),
                )
                line.price_unit = product.price
            else:
                line.price_unit = line.specific_price
def _compute_price_unit ( self ) : for line in self : if line . automatic_price : pricelist = ( line . contract_id . pricelist_id or line . contract_id . partner_id . with_company ( line . contract_id . company_id ) . property_product_pricelist ) product = line . product_id . with_context ( quantity = line . env . context . get ( "contract_line_qty" , line . quantity , ) , pricelist = pricelist . id , partner = line . contract_id . partner_id . id , date = line . env . context . get ( "old_date" , fields . Date . context_today ( line ) ) , ) line . price_unit = product . price else : line . price_unit = line . specific_price
Get the specific price if no auto-price, and the price obtained
from the pricelist otherwise.
Get the specific price if no auto - price and the price obtained from the pricelist otherwise .
"""Get the specific price if no auto-price, and the price obtained
        from the pricelist otherwise.
        """
self