odoo/odoo#191497

Created by fw-bot
Merged at eb383f970eca7fc000560bbe66c5b2c69cd04fed

Statuses:

label
odoo-dev:18.0-16.0-fix-expense-company-instead-of-partner-jual-h8cW-fw
head
9b1eaf2edaa1b1c0af439c10ddf3ace6dd43e193
merged
9 months ago by Accounting, Julien Alardot (jual)
odoo/odoo
16.0 #187778
17.0 #191347
saas-17.2 #191435
saas-17.4 #191437
18.0 #191497
saas-18.2
saas-18.3
saas-18.4
19.0
master #191512

[FW][FIX] hr_expense: Fix bad commercial_partner_id

This fixes the simple, yet very common case where:
- You are creating an expense for one of your employee
- The partner of said employee has its field parent_id set to be your own company
- The expense move commercial_partner_id would then always be yourself
- You never pay your employees, only yourself
- ???
- Jail

task-4345465

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


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

Forward-Port-Of: #191437
Forward-Port-Of: #187778