<commit_before># -*- coding: utf-8 -*-
# © 2016 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models


class BusinessRequirementResource(models.Model):
    _inherit = "business.requirement.resource"

    sale_price_unit = fields.Float(
        string='Sales Price',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_estimation',
    )
    sale_price_total = fields.Float(
        compute='_compute_sale_price_total',
        string='Total Revenue',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_estimation',
    )
    unit_price = fields.Float(
        string='Cost Price',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_cost_control',
    )
    price_total = fields.Float(
        store=False,
        compute='_compute_get_price_total',
        string='Total Cost',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_cost_control',
    )

    @api.multi
    @api.depends('unit_price', 'qty')
    def _compute_get_price_total(self):
        for resource in self:
            resource.price_total = resource.unit_price * resource.qty

    @api.multi
    @api.depends('sale_price_unit', 'qty')
    def _compute_sale_price_total(self):
        for resource in self:
            resource.sale_price_total = resource.sale_price_unit * resource.qty

    @api.multi
    def _get_partner(self):
        self.ensure_one()
        br_id = self.business_requirement_deliverable_id.\
            business_requirement_id.id
        if br_id and br_id.partner_id:
            return br_id.partner_id
        else:
            return False

    @api.multi
    def _get_pricelist(self):
        self.ensure_one()
        partner_id = self._get_partner()
        if partner_id:
            if partner_id.property_product_pricelist:<commit_msg>[FIX] business_requirement_deliverable_cost: Modify fucntion based on github reviewers comments. 	modified:   business_requirement_deliverable_cost/models/business.py<commit_after># -*- coding: utf-8 -*-
# © 2016 Elico Corp (https://www.elico-corp.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models


class BusinessRequirementResource(models.Model):
    _inherit = "business.requirement.resource"

    sale_price_unit = fields.Float(
        string='Sales Price',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_estimation',
    )
    sale_price_total = fields.Float(
        compute='_compute_sale_price_total',
        string='Total Revenue',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_estimation',
    )
    unit_price = fields.Float(
        string='Cost Price',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_cost_control',
    )
    price_total = fields.Float(
        store=False,
        compute='_compute_get_price_total',
        string='Total Cost',
        groups='business_requirement_deliverable_cost.'
        'group_business_requirement_cost_control',
    )

    @api.multi
    @api.depends('unit_price', 'qty')
    def _compute_get_price_total(self):
        for resource in self:
            resource.price_total = resource.unit_price * resource.qty

    @api.multi
    @api.depends('sale_price_unit', 'qty')
    def _compute_sale_price_total(self):
        for resource in self:
            resource.sale_price_total = resource.sale_price_unit * resource.qty

    @api.multi
    def _get_partner(self):
        self.ensure_one()
        partner_id = self.business_requirement_deliverable_id.\
            business_requirement_id.partner_id
        return partner_id

    @api.multi
    def _get_pricelist(self):
        self.ensure_one()
        partner_id = self._get_partner()
        if partner_id:
            if partner_id.property_product_pricelist:
{'fraction_non_alphanumeric': 0.09425625920471281, 'fraction_numerical': 0.003436426116838488, 'mean_word_length': 3.0147783251231526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '1083799', 'n_tokens_mistral': 1279, 'n_tokens_neox': 1230, 'n_words': 202}