bill task work selects wrong journal in multi-company context

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

Bug Description

Hello,

When running Bill Task Works in a multi company context, the system sometimes creates an invoice for the wrong company

This is for 6.1 and probably trunk too.

How to reproduce:
0. install modules accounting and hr_timesheet_invoice
1. create company Parent and Subsidiary as child of Parent
2. make sure Administrator has access to Parent Subsidiary, set Administrator default filter to Parent in preferences
3. rename Sales Journals to Sales Journal (parent) and Sales Journal (subsidiary) so they can be distinguished
4. create a customer on company Subsidiary named "Customer Subsidiary"
5. create a project named "Project for Subsidiary" with To Invoice = Yes and set customer to Customer Subsidiary
6. create a timesheet line on the analytic account "Project for Subsidiary"
7. run Bill Task Work and create the invoce (see screenshot 1)

-> the invoice generated has the correct customer and account (in yellow in screenshot 2), but uses the wrong journal and sales account (in red in screenshot 2); therefore an error message is produced when validating the invoice (Error occurred while validating the field(s) company_id: Company must be the same for its related account and period.).

I'll attach a merge proposal which uses the analytic account's company_id for the generated invoice.

Best regards,

-sbi

Related branches

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :
description: updated
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

fixed in trunk.

Changed in openobject-addons:
status: Confirmed → Fix Released
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.