OCA / hr-expense

Human Resources Expenses OCA modules for Odoo
GNU Affero General Public License v3.0
50 stars 103 forks source link

[16.0] hr_expense_invoice: duplicated expense journal entry #241

Open SoniaViciana opened 3 months ago

SoniaViciana commented 3 months ago

Module

hr_expense_invoice https://github.com/OCA/hr-expense/pull/234

Describe the bug

If i have this expense report: image

Journal entries details will be: image

So, untaxed amount does not match:

To Reproduce

Affected versions: 16

Steps to reproduce the behavior:

  1. Make a expense report with 2 lines of expense
  2. Create a vendor invoice of one of them and publish
  3. "Post Journal Entries" from the expense report

@pedrobaeza

pedrobaeza commented 3 months ago

When you introduce a vendor bill, taxes are automatically emptied, so that's the problem. How did you get to have the taxes filled?

SoniaViciana commented 3 months ago

I put it to make more clear the error on expense entries -> 3.102,60 - 1.743,41 = 1.359,19

pedrobaeza commented 3 months ago

I'm not getting such problem in runboat with just hr_expense_invoice installed.

Check http://oca-hr-expense-16-0-4e4ed2640742.runboat.odoo-community.org/web?debug=1#id=5&cids=1&menu_id=194&active_id=18&model=hr.expense.sheet&view_type=form (with the DB base-only):

imagen

SoniaViciana commented 3 months ago

Same problem: image

"6000000 Expense" account amount it's wrong, the only difference is the tax: 30,58 * 1,15 = 35,17 Double imputation to expense, without https://github.com/OCA/hr-expense/pull/234 it didn't happen

pedrobaeza commented 3 months ago

@SoniaViciana there's no BILL/2024/05/0002 in the DB I'm mentioning (you have to logout and go to the other DB):

imagen

SoniaViciana commented 3 months ago

The problem that I have reported in this issue is when within a report there are 2 or more expense lines, one with an invoice and the other without. The test you have done does not represent the reported problem because there is only one expense line. Do we limit users from being able to include more than one expense line in a report?

pedrobaeza commented 3 months ago

OK, I will try that case.