hr_expense: generated invoice may use wrong accounts in a multi-company context

Bug #1068038 reported by Stéphane Bidoul (Acsone)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 3

Bug Description

Hello,

When generating invoices from expenses, the invoice sometimes uses wrong accounts when the use generating the expense is from another company than the expense's company.

I reproduced with 6.1, but it probably applies to trunk too since the code has not changed.

How to reproduce:
- create 2 companies A and B
- create an expense for an employee of company B
- approve and invoice the expense with the user where company preference is set to A
- result: the invoice is created for company B (correct), but using accounts (payable, expense) from company A (wrong)
- expected result: the invoice should be with accounts of company A

I link a merge proposal.

Best regards,

-sbi

Tags: invoicing

Related branches

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Stephane,

Same issue faced on trunk too and I have checked your solution which is fixed this issue.

Thank you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Josse Colpaert (OpenERP) (jco-openerp) wrote :

In my branch I made the company field read-only. And you are only allowed to generate accounting entries when the companies of the user and the expense correspond.

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Josse,

This last change (forcing user and expense company to be the same) are too restrictive. It is indeed frequent in multi-company scnearios to have a user of one company submitting an expense note for another company (for users working for different companies, for instance).

Best regards,

-sbi

Revision history for this message
Josse Colpaert (OpenERP) (jco-openerp) wrote :

Hello Stéphane,

This should be done by changing the company "you work with" each time in the preferences of the user in the top-right menu. I hope this is workable for you.

Greetings,

Josse

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Josse,

This is really too restrictive and I see no good reason to enforce this.

While it is indeed known to be safer to change the company in preferences, everywhere in OpenERP you can work for different companies without changing the preferences. There are bugs here and there (such as this one) that are progressively being resolved, but there is no reason to oblige the user to change company in his preferences.

Best regards,

-sbi

Amit Parik (amit-parik)
tags: added: invoicing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.