Skip to Content
Menu
This question has been flagged
3 Replies
4286 Views

I have two companies with their chart of account.


I'm trying to record a payment.

My user, the customer, the invoice, the period, the account are all in the secondary company.

But somehow, I get the error: "Account and Period must belong to the same company."


I've checked in the database, all records with company_id are set to my secondary company.

Avatar
Discard
Author Best Answer

If this error occurs on the invoice validation:

-> the invoice and the taxes of the invoice lines must have the same company


If this error occurs on the payment:

-> the invoice and the credit/debit accounts of the payment journal must have the same company

Avatar
Discard

I edited your question to reflect the problem - so others can find the answer if they have the same problem.

Author

Thank you Ray Carnes, I forgot to do that. Also I have to edit the response since I resolved a similar issue (same error message, slightly different context).

Best Answer

I suppose you are using Odoo 8 or below version.


If so, it depends on the user and his access, say you have logged in as "UserA" who has access to both the company.

Now when you are trying to make a payment, chances are always high that you may, or default values being fetched might belong to other company, hence system validates for such records, while posting.


So the best way to deal with it, either you login to a user who has access to single company and do the transactions, or install a module called "web_easy_switch_company", which helps you switch between the companies easily.

Download and try this App Easy_Switch_Company

 

Avatar
Discard
Author

Thank you for your response. For the company switch, I have spotted this module, yes. As for the default values, that may be a good hint here, I will look at it.