Skip to content

Commit

Permalink
[TMP FIX] not merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-zanotti committed May 30, 2023
1 parent 7d01c2f commit 086653b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions sale_stock_ux/models/sale_order_line.py
Expand Up @@ -5,7 +5,9 @@
from odoo import models, api, fields, _
from odoo.exceptions import UserError
from odoo.tools.float_utils import float_compare
import logging

_logger = logging.getLogger(__name__)

class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
Expand Down Expand Up @@ -163,8 +165,11 @@ def _compute_quantity_returned(self):
r.location_dest_id.usage != "customer" and
r.to_refund))
for move in return_moves:
quantity_returned += move.product_uom._compute_quantity(
move.product_uom_qty, order_line.product_uom)
try:
quantity_returned += move.product_uom._compute_quantity(
move.product_uom_qty, order_line.product_uom)
except Exception:
_logger.warning("Error trying to compute quantities in order: %s" % order_line.order_id.name)
bom_enable = 'bom_ids' in self.env['product.template']._fields
if bom_enable:
boms = return_moves.mapped('bom_line_id.bom_id')
Expand Down

0 comments on commit 086653b

Please sign in to comment.