point_of_sale: payment moves not are added in the correct journal

Bug #272141 reported by Jordi Esteve (www.zikzakmedia.com)
4
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Christophe CHAUVET

Bug Description

When a POS sale is done (whitout invoice) the payment move is created in the journal defined in the POS (invoice or sale journal) instead if the payment journal.

I think the following lines (in create_account_move function of pos.py) order.sale_journal.id should change to payment.journal_id.id

                # Create one entry for the payment
                payment_move_id = account_move_obj.create(cr, uid, {
                    'journal_id': order.sale_journal.id,
                    'period_id': period,
                }, context=context)
                account_move_line_obj.create(cr, uid, {
                    'name': order.name,
                    'date': order.date_order,
                    'ref': order.name,
                    'move_id': payment_move_id,
                    'account_id': payment_account,
                    'credit': ((payment.amount<0) and -payment.amount) or 0.0,
                    'debit': ((payment.amount>0) and payment.amount) or 0.0,
                    'journal_id': order.sale_journal.id,
                    'period_id': period,
                }, context=context)
                to_reconcile.append(account_move_line_obj.create(cr, uid, {
                    'name': order.name,
                    'date': order.date_order,
                    'ref': order.name,
                    'move_id': payment_move_id,
                    'account_id': order_account,
                    'credit': ((payment.amount>0) and payment.amount) or 0.0,
                    'debit': ((payment.amount<0) and -payment.amount) or 0.0,
                    'journal_id': order.sale_journal.id,
                    'period_id': period,
                }, context=context))

should change to:

                # Create one entry for the payment
                payment_move_id = account_move_obj.create(cr, uid, {
                    'journal_id': payment.journal_id.id,
                    'period_id': period,
                }, context=context)
                account_move_line_obj.create(cr, uid, {
                    'name': order.name,
                    'date': order.date_order,
                    'ref': order.name,
                    'move_id': payment_move_id,
                    'account_id': payment_account,
                    'credit': ((payment.amount<0) and -payment.amount) or 0.0,
                    'debit': ((payment.amount>0) and payment.amount) or 0.0,
                    'journal_id': payment.journal_id.id,
                    'period_id': period,
                }, context=context)
                to_reconcile.append(account_move_line_obj.create(cr, uid, {
                    'name': order.name,
                    'date': order.date_order,
                    'ref': order.name,
                    'move_id': payment_move_id,
                    'account_id': order_account,
                    'credit': ((payment.amount>0) and payment.amount) or 0.0,
                    'debit': ((payment.amount<0) and -payment.amount) or 0.0,
                    'journal_id': payment.journal_id.id,
                    'period_id': period,
                }, context=context))

Jordi

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Hi

We have found a lot of bug with POS, we create ours based on point_of_sale with a new features, we publish them this WE and try to merge it with point_of_sale.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Ok, waiting for your merge. Please note that we also fixed lots of things in the POS :)

Changed in openobject-addons:
assignee: nobody → christophe-chauvet
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Fixed, thanks.

Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.