Skip to content

Commit

Permalink
[ADD] business_requirement_deliverable_sale: New module in 11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Martin committed Jun 27, 2019
1 parent 297e98e commit 71381f6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions business_requirement_deliverable_sale/models/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,12 @@ class BusinessRequirement(models.Model):
def product_id_change(self):
"""Get the right pricelist for product"""
uom_id = False
sale_price_unit = 0
product = self.product_id

if product:
sale_price_unit = False
# Get base sale_price_unit from product
if self.product_id:
uom_id = product.uom_id.id
sale_price_unit = product.list_price

sale_price_unit = self.product_id.list_price

# If pricelist for customer then calculate
if self.pricelist_id:
product = self.product_id.with_context(
lang=self.partner_id.lang,
Expand All @@ -55,7 +52,7 @@ def product_id_change(self):
uom=self.uom_id.id,
)
sale_price_unit = product.price

# Default values from product when onchange product
if uom_id:
self.uom_id = uom_id
self.sale_price_unit = sale_price_unit
Expand Down

0 comments on commit 71381f6

Please sign in to comment.