-
- Downloads
[FIX] account: fix payment to own company via expense
Expense - Steps to reproduce the bug: 1. Create an employee whose private address is linked to the current company's partner_id 2. Create an Expense and expense report with the employee(1) with mode paid by employee 3. Confirm the Expense report and post the journal entries 4. Click "Register Payment" --> User Error occurs 5. A User Error like the following should appear (with different journal entry names): "Journal Entry Draft Entry PBNK1/2023/00001 (INV/2023/00005) is not valid. In order to proceed, the journal items must include one and only one receivable/payable account (with an exception of internal transfers)." The User Error also occurs for a different scenario mentioned in https://github.com/odoo/odoo/pull/127412 According to SVFU on how the bug is fixed: The condition that classifies the extra lines as "counterpart lines" was only intended for internal transfers. Each company has a related "transfer account" that is used as an intermediary account for internal transfers. Thus the old condition (c.f. commit diff) when checking whether a line is a "counterpart line" can be replaced by checking whether the account associated with the line is the "transfer account" of our company. closes odoo/odoo#128645 Signed-off-by:Laurent Smet (las) <las@odoo.com>