odoo/odoo#277938

Created by fw-bot
Merged at f5c1d2210f18d1644a7ce67fca806f5c5db3df69

Statuses:

label
odoo-dev:saas-19.4-18.0-expense-guard-1-549291-fw
head
293338c5ebf43259fd9850d00a652c31ab8c1311
merged
5 days ago by Accounting, Julien Alardot (jual)
odoo/odoo
18.0 #277423
saas-18.3 #277737
saas-18.4 #277863
19.0 #277883
saas-19.1 #277894
saas-19.2 #277903
saas-19.3 #277920
saas-19.4 #277938
master #278016

[FIX] hr_expense: protect the journal and memo of expense payments

Before this commit, the journal and the memo of a payment linked to a company-paid expense report could be modified although such payments must be kept consistent with their expense report: a missing comma in the set of protected fields merged 'journal_id' and 'ref' into a single meaningless entry. The memo was also left editable because the set still referred to 'ref', which was renamed to 'memo'.

Steps to reproduce:
- submit, approve and post an expense paid by company
- open the payment created for the expense report
- edit the memo or the journal and save, then try to edit the date

Editing the date is refused with "You cannot do this modification since the payment is linked to an expense report", while the memo and journal changes are silently accepted.

Solution:
Restore the missing comma and protect the renamed memo field.


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #277737
Forward-Port-Of: #277423