Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Invoice number pattern and controll per company

By
Piotr Piotrowski
on 4/24/15, 8:31 AM 1,346 views

Hallo everyone, 


I would like to configure following functionality:

On behalf of Company A, Company B, Company C

I would like to make an Invoice with individual Invoice number, for example INV_A, INV_B, INV_C.

Those companies are selling the same service (from Odoo point of view) so let`s say I create Sale Order, where I am able to select company in tab "Other Information".

After creating SO, I am trying to create Invoice and after VALIDATION I always get this error:


Field(s) `company_id` failed against a constraint: Account and Period must belong to the same company.


This comes from constraint check [_check_company_id] from [_name = "account.move.line"] model. What is more, I get problem with [lines.account_id.company_id] which is different that other company informations in line.

CODE:

def _check_company_id(self, cr, uid, ids, context=None):

    lines = self.browse(cr, uid, ids, context=context)

     for l in lines:

         if l.company_id != l.account_id.company_id or l.company_id != l.period_id.company_id:

         return False

    return True


Could someone tell me, where have I configured something incorrectly? I cannot find any reason and it drives me crazy...

Thanks in advance,

Piotr

Invoice company and debtors account(customer account) company must be same!!

Tidy Way
on 4/24/15, 9:00 AM
0
Piotr Piotrowski
On 4/27/15, 4:56 AM

Sorry for answering this way - it`s really irritating with karma...

I have managed what I wanted to achieve. Maybe this is banal for most of community, but maybe someone will use this as a solution some day.

My problem was, that account id was incorrect and I was not able to find proper setting for this but following settings are working for me:

I have defined structured multicompany (but without Multicompany checkbox in settings), so that there is PARENT company (Parent) and CHILDREN copmanies (A, B)

in Sale.Order I choose only Parent company and when I am creating invoice, I am choosing appropriate children company. Because of this I am able to:

- have proper invoice numbers

- have proper addresses in invoice


That`s it. I would like to see in SO list proper companies, not only parent, but for now this solution is satisfying.

0
Michael Pol
On 4/24/15, 9:10 AM

It looks like you have wrong company configuration between period and account linked with sales journal.  Please check  configuration of both, company should be same.

0

zbik

--zbik--
5976
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 4/24/15, 9:13 AM

1. Each company must define its own Chart of accounts - verify/define it in Settings/Configuration/Accounting -> section Chart of Accounts.
2. Each company must define its own Periods
3. Each company must define its own Taxes 
4. Each company must define its own Journals (For example Sales Journal - this journal determines invoice number - possible other per company)

If tax or journal or account or period (in Sale Order) belong to different companies this error is raised.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 4/24/15, 8:31 AM
Seen: 1346 times
Last updated: 5/31/15, 2:16 AM