[FIX] account: Fix _compute_linked_attachment_id
When the record is a draft record (with a NewId), the attachment is not retrieved correctly. Indeed, `move_vals` contains the real ids. closes odoo/odoo#121224 X-original-commit: 34ff1d66d5352f36d8d982d868e0b01c929c3c88 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -1528,7 +1528,7 @@ class AccountMove(models.Model):
|
||||
])
|
||||
move_vals = {att.res_id: att for att in attachments}
|
||||
for move in self:
|
||||
move[attachment_field] = move_vals.get(move.id, False)
|
||||
move[attachment_field] = move_vals.get(move._origin.id, False)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# INVERSE METHODS
|
||||
|
||||
Reference in New Issue
Block a user