<commit_before># -*- coding: utf-8 -*-
from openerp import fields, models, api


class sale_order_line(models.Model):
    _inherit = 'sale.order.line'

    @api.one
    def _get_pricelist_discount(self):
        discount = 0.0
        if self.product_id.list_price:
            list_price = self.with_context(
                currency_id=self.order_id.pricelist_id.currency_id.id
            ).product_id.price_get()[self.product_id.id]
            discount = (list_price - self.price_unit) * 100.0 / list_price

        total_discount = discount + self.discount - (
            discount * self.discount or 0.0)
        self.pricelist_discount = discount
        self.total_discount = total_discount

    pricelist_discount = fields.Float(
        compute='_get_pricelist_discount',
        string='Pricelist Discount')

    total_discount = fields.Float(
        compute='_get_pricelist_discount',
        string='Total Discount')<commit_msg>IMP sale pricelist discount<commit_after># -*- coding: utf-8 -*-
from openerp import fields, models, api


class sale_order_line(models.Model):
    _inherit = 'sale.order.line'

    @api.one
    def _get_pricelist_discount(self):
        discount = 0.0
        if self.product_id.list_price:
            list_price = self.with_context(
                currency_id=self.order_id.pricelist_id.currency_id.id
            ).product_id.price_get()[self.product_id.id]
            discount = (list_price - self.price_unit) * 100.0 / list_price

        total_discount = discount + self.discount - (
            discount * self.discount or 0.0) / 100.0
        self.pricelist_discount = discount
        self.total_discount = total_discount

    pricelist_discount = fields.Float(
        compute='_get_pricelist_discount',
        string='Pricelist Discount')

    total_discount = fields.Float(
        compute='_get_pricelist_discount',
        string='Total Discount')
{'fraction_non_alphanumeric': 0.09853249475890985, 'fraction_numerical': 0.011530398322851153, 'mean_word_length': 2.588345864661654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4137583', 'n_tokens_mistral': 638, 'n_tokens_neox': 586, 'n_words': 103}