Merge PR #320 into 15.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-10-26 14:34:38 +00:00

View File

@@ -1210,10 +1210,13 @@ class Rma(models.Model):
self._ensure_can_be_replaced() self._ensure_can_be_replaced()
moves_before = self.delivery_move_ids moves_before = self.delivery_move_ids
self._action_launch_stock_rule(scheduled_date, warehouse, product, qty, uom) self._action_launch_stock_rule(scheduled_date, warehouse, product, qty, uom)
new_move = self.delivery_move_ids - moves_before new_moves = self.delivery_move_ids - moves_before
if new_move: body = ""
self.message_post( # The product replacement could explode into several moves like in the case of
body=_( # MRP BoM Kits
for new_move in new_moves:
body += (
_(
'Replacement: Move <a href="#" data-oe-model="stock.move"' 'Replacement: Move <a href="#" data-oe-model="stock.move"'
' data-oe-id="%(move_id)d">%(move_name)s</a> (Picking <a' ' data-oe-id="%(move_id)d">%(move_name)s</a> (Picking <a'
' href="#" data-oe-model="stock.picking"' ' href="#" data-oe-model="stock.picking"'
@@ -1228,10 +1231,11 @@ class Rma(models.Model):
"picking_name": new_move.picking_id.name, "picking_name": new_move.picking_id.name,
} }
) )
+ "\n"
) )
else:
self.message_post( self.message_post(
body=_( body=body
or _(
"Replacement:<br/>" "Replacement:<br/>"
'Product <a href="#" data-oe-model="product.product" ' 'Product <a href="#" data-oe-model="product.product" '
'data-oe-id="%(id)d">%(name)s</a><br/>' 'data-oe-id="%(id)d">%(name)s</a><br/>'