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

pos session could not closed

By
asaithambi
on 6/27/14, 8:12 AM 1,552 views

i am trying to close the pos session for many times. it shows following warning and could not be closed...

 

Error!

You cannot confirm all orders of this session, because they have not the 'paid' status

I have the same problem. Orders don't get the « paid » status automatically in the POS. I have to go in Point of sales->Orders to pay each one.... One by one....

Pascal Tremblay
on 2/15/15, 12:42 PM
0

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 6/27/14, 4:25 PM

I doubt that some of the order are in draft (New) state. That is why this error has arised.

Either delete those draft records or make payment for them. Then it will work.

0

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 6/27/14, 8:21 AM

Hi

When close pos session all order of that will be in 'paid' or 'invioced'. One of your order in 'new' or other state thats why this Erros is comming. See folloing code: 

    def _confirm_orders(self, cr, uid, ids, context=None):
        wf_service = netsvc.LocalService("workflow")

        for session in self.browse(cr, uid, ids, context=context):
            local_context = dict(context or {}, force_company=session.config_id.journal_id.company_id.id)
            order_ids = [order.id for order in session.order_ids if order.state == 'paid']

            move_id = self.pool.get('account.move').create(cr, uid, {'ref' : session.name, 'journal_id' : session.config_id.journal_id.id, }, context=local_context)

            self.pool.get('pos.order')._create_account_move_line(cr, uid, order_ids, session, move_id, context=local_context)

            for order in session.order_ids:
                if order.state not in ('paid', 'invoiced'):
                    raise osv.except_osv(
                        _('Error!'),
                        _("You cannot confirm all orders of this session, because they have not the 'paid' status"))
                else:
                    wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr)

        return True

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

1 follower(s)

Stats

Asked: 6/27/14, 8:12 AM
Seen: 1552 times
Last updated: 3/16/15, 8:10 AM