Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions addons/product/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ def _compute_product_price(self):

def _set_product_price(self):
for product in self:
if self._context.get('uom'):
if (
self._context.get('uom')
and 'default_description_sale' not in self._context
):
value = self.env['uom.uom'].browse(self._context['uom'])._compute_price(product.price, product.uom_id)
else:
value = product.price
Expand All @@ -270,7 +273,10 @@ def _set_product_price(self):

def _set_product_lst_price(self):
for product in self:
if self._context.get('uom'):
if (
self._context.get('uom')
and 'default_description_sale' not in self._context
):
value = self.env['uom.uom'].browse(self._context['uom'])._compute_price(product.lst_price, product.uom_id)
else:
value = product.lst_price
Expand All @@ -285,7 +291,10 @@ def _compute_product_price_extra(self):
@api.depends_context('uom')
def _compute_product_lst_price(self):
to_uom = None
if 'uom' in self._context:
if (
'uom' in self._context
and 'default_description_sale' not in self._context
):
to_uom = self.env['uom.uom'].browse(self._context['uom'])

for product in self:
Expand Down