Community mailing list archives

Re: Point of sale and invoices in OpenERP 7.0

Bassirou Ndaw
- 10/28/2015 04:45:18
Good work, Sylvain.
This is not only a OpenERP 7 issue: This double payment problem is also in Odoo 8.
On 15 October 2015 at 12:12 Sylvain LE GAL <> wrote:

Sylvain LE GAL
Service informatique
GRAP - Groupement Régional Alimentaire de Proximité

3 Grande rue des Feuillants, 69001 Lyon
Bureau :
Astreinte :

GRAP sur le Web : Site Web | Facebook | Twitter
GRAP - service Informatique sur le Web : Twitter

2015-10-13 15:07 GMT+02:00 Ludovic CHEVALIER <>:

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 don't have this problem. Invoiced PoS are not considered when PoS is closed. it isn't ? Just 'paid' PoS generate entries, no 'invoiced'.

But we had other problems. For example, by default the invoice generated from PoS Order is opened, (even if the PoS is paid). (so reporting is bad, it is possible to pay twice a PoS....) This module fixes this undesired features. It allows too to invoice an unpaid PoS Order.
With that module accounting is OK. (and otherS modules to reduce entries quantity....)

If this module can help you, you can review this sleeping PR. (OCA / pos)
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.
Did your accountant requested that ? It's not a problem in my company. My accountant consider PoS entries like invoices. We so set the same sale Journal for both. (sale and PoS order). No problem with that. (in France)

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"?
Indeed some algorithms in Odoo are based on a "chance **" args. A certain hand, it gives a touch of fun to this software, like playing to the russian roulette. Don't you think ?
That being said, user can change the journal, or set another 'sale' journal (if invoices are created from stock picking for exemple).
For invoices created from PoS, I guess a little custom module could add this extra feature.
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?



Post to:

Post to: