[6.1 / trunk] bank_statement multicompany error

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

Bug Description

Hello,

In trunk and 6.1, it is not possible to create bank statements for another company.

How to reproduce:
- install trunk with demo data
- configure an account chart for another company than Your Company (eg OpenERP Editor)
- make sure Administrator has access to OpenERP Editor and has Your Company as preferred company
- create a bank statement and change the journal to the bank journal of OpenERP Editor
- try to save -> ValidateError: Error occurred while validating the field(s) journal_id,period_id: The journal and period chosen have to belong to the same company. This is because the period is incorrect
- change the period to a period of OpenERP Editor
- try to save again -> same error for no obvious reason

I think this is due to the fact that in the orm create method, the validation of related fields (company_id) is done before calculating related fields.

Best regards,

-sbi

Tags: bank statement

Related branches

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Stepahane,

Bank statement with multi-company are working fine with latest trunk 7.0

Would you please try with latest code and notify us.

For your more information I have attached the video, So would you please check it.

Thanks ans waiting for your reply!

Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Amit,

I just tried again with a fresh update of the 7.0 branch, and could reproduce the issue, and confirm it is fixed with the patch I attached above.

Here is a more detailed instruction to reproduce:
- install trunk with demo data
- configure Belgium account chart for default company (Your Company)
- enable multi-company in the general settings
- give multi company rights to Administrator
- configure the custom account chart for Company "OpenERP Editor"
- make sure Administrator has access to OpenERP Editor and has Your Company as preferred company
- rename the Bank journals for Your Company and OpenERP Editor so you can distinguish them
- create a bank statement -> the form shows
  * Journal: Bank (Your Company)
  * Period: X 12/2012 (Your Company)
  * Company: Your Company
- change journal to Bank (OpenERP Editor)
- try to save -> ValidateError: Error occurred while validating the field(s) journal_id,period_id: The journal and period chosen have to belong to the same company. This is because the period is incorrect
- change period to 01/2012 (OpenERP Editor)
-> at this point, journal, period and company match
- try to save again -> same error for no obvious reason

Best regards,

-sbi

Changed in openobject-addons:
status: Incomplete → New
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Stephane,

Thanks for your detail steps.

I have faced the same problem at my end.

Thank you!

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Amit Parik (amit-parik)
tags: added: bank statement
Revision history for this message
Mahendra Barad(OpenERP) (mba-openerp) wrote :

Hello,

It has been fixed into https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1077029-mba
branch with following

Revision ID:<email address hidden>
Revision No:8983

Thanks.

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