Community Mailinglisten Archive


Point of sale and invoices in OpenERP 7.0

L'Heureux-Cyclage, Ludovic CHEVALIER
- 08.10.2015 03:37:00

I have a problem with point of sale and invoices for few months now.

I really nead advices about this question.
My first problem is about invoicing pos orders.

>From point of sale, when I validate a pos order, an account entrie will
be created at pos closing. If my customer want an invoice for his/her
purchase, OpenERP permit to create invoice from the pos order. But, that
generate a second account entrie. So, my accounting is false. :-(

I already have discussion about this with OpenERP employees, but I never
had a answer that solved this problem.

My second problem, which is the consequence of the first.

I disable the invoice button of the point of sale module due to the
first problem. So, my customers never have invoices for their purchases.

Then, I thank there was no matter having same sale journal for sales
from point of sale orders and sales from invoices. Indeed, when we close
a point of sale session, an account with a number wich come from journal
sequence is created.

If  the point of sale use the same journal as invoices, we make holes in
the invoices numbering.

So, I created a new sale journal, just for the point of sale, with its
own sequence.

Problem: when I create an invoice, this point of sale journal was
selected by default. So, I created a default value with condition, like
its describe in this thread:

It works, but, when I create an invoice from a sale order (not point of
sale order, just sale order), that doesn't work.

For my second problem, here is the method of account.invoice object
(from account module) that select the journal:
> def _get_journal(self, cr, uid, context=None):
>         if context is None:
>             context = {}
>         type_inv = context.get('type', 'out_invoice')
>         user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
>         company_id = context.get('company_id',
>         type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale_refund', 'in_refund': 'purchase_refund'}
>         journal_obj = self.pool.get('account.journal')
>         domain = [('company_id', '=', company_id)]
>         if isinstance(type_inv, list):
>             domain.append(('type', 'in', [type2journal.get(type) for type in type_inv if type2journal.get(type)]))
>         else:
>             domain.append(('type', '=', type2journal.get(type_inv, 'sale')))
>         res =, uid, domain, limit=1)
>, uid, [('state', '=', 'done')], context=context)
>         return res and res[0] or False 

We can see that the journal is chosen arbitrary by selecting the first
one of the request ("limit=1").

Is it normal that users can't choose the journal they want for invoices?
Why OpenERP prefers choose it by "chance"?

Maybe it was not a good idea to create a different journal for point of
sale. But I'm not sure that create account entries numbered with invoice
sequence, with point of sale session, account entries that are not
related to an invoice, is a good idea.

Is someone have the same thoughts as me?

Is someone have some answers for those questions/problems?