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.

1

How to pay Point of sale invoices?

By
Anabela Damas
on 9/2/15, 12:47 PM 1,157 views

I'm using odoo v8 and POS (Point of sale) module.

But when I make a sale and choose the payment method and then the option "Invoice", the system creates an invoice but in the state open. It shouldn't be in the state paid?

How do I configure the POS to create the Invoices in the state paid thought the POS ?

Thanks 


 

1
Anabela Damas
On 9/4/15, 4:07 AM

This worked for me:

https://github.com/odoo/odoo/issues/6534

Did you use the method def _confirm_orders(self, cr, uid, ids, context=None): ???? Is this what works for you?

Pascal Tremblay
on 11/20/15, 8:19 PM

Ok! this new method works very well. Thanks

Pascal Tremblay
on 11/20/15, 8:42 PM
1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 12/1/15, 10:55 AM

We have corrected the method on https://github.com/odoo/odoo/issues/6534. 

Here is our new method who can manage also the return amount (the money we give back to customer).

We hope it could help somebody.

from openerp.osv import fields, osv
import logging
logger = logging.getLogger(__name_)

class pos_session(osv.osv):
_inherit = 'pos.session'

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

account_move_obj = self.pool.get('account.move')
account_move_line_obj = self.pool.get('account.move.line')
pos_order_obj = self.pool.get('pos.order')
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 = account_move_obj.create(cr, uid, {'ref' : session.name, 'journal_id' : session.config_id.journal_id.id, }, context=local_context)
pos_order_obj._create_account_move_line(cr, uid, order_ids, session, move_id, context=local_context)
for order in session.order_ids:
if order.state == 'done':
continue
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:
pos_order_obj.signal_workflow(cr, uid, [order.id], 'done')
order_ids = self.pool.get('pos.order').search(cr, uid, [('session_id','=', session.id)])

for obj_order_id in self.pool.get('pos.order').browse(cr, uid, order_ids, context=context):
move_line = []
for move_line_id in obj_order_id.invoice_id.move_id.line_id:
if move_line_id.name == obj_order_id.name:
move_line.append(move_line_id.id)

move_line_ids_1 = []

for statement_id in obj_order_id.statement_ids:

move_line_ids = account_move_line_obj.search(cr, uid, [('statement_id','=', statement_id.statement_id and statement_id.statement_id.id)])

if (move_line_ids != move_line_ids_1) :

for line in account_move_line_obj.browse(cr, uid, move_line_ids):

if line.credit and line.name.strip().strip(':') == obj_order_id.name:
move_line.append(line.id)
if line.debit and 'return' in line.name:
move_line.append(line.id)


move_line_ids_1 = move_line_ids

ctx = context.copy()
ctx.update({'active_ids': move_line})
self.pool.get('account.move.line.reconcile').trans_rec_reconcile_full(cr, uid, [], ctx)

return True
1

Acespritech

--Acespritech--
839
| 3 2 6
India
--Acespritech--

Having 8+ years of OpenERP Experience. We are Specialized in OpenERP/CRM Solutions, software development, Web development, E commerce solutions & other open source solutions.


Skype : acespritech

Email : info@acespritech.com

Acespritech
On 9/4/15, 1:10 AM

Hello !


There is not specific configuration for this situation in POS that you want.

We have to customize because, we have to select payment method again from Invoice also when registering payment but it is possible by changing workflow.


Thanks,

Acespritech Solutions Pvt. Ltd.

Skype: acespritech

info@acespritech.com

0
Nilim
On 1/25/16, 7:14 AM

 Hi,

For your query, to set POS payment invoice to PAID status automatically there is no configuration in Odoo. For this we need to have customized module as because, in general without any customization unless we register a payment in the Invoicing Menu for any POS Order,we wont be able to see the POS order invoice in PAID state

Hope this helps

Cheers!!

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: 9/2/15, 12:47 PM
Seen: 1157 times
Last updated: 3/1/16, 12:10 PM