|
@@ -1,6 +1,6 @@
|
|
|
# -*- coding: utf-8 -*-
|
|
|
from openerp import http
|
|
|
-from openerp.http import request
|
|
|
+from openerp.http import request as r
|
|
|
|
|
|
from http_response import make_gzip_response
|
|
|
import logging
|
|
@@ -207,7 +207,7 @@ class PosSales(http.Controller):
|
|
|
currency_id = get_currency(journal_id)
|
|
|
|
|
|
if not currency_id:
|
|
|
- currency_id = request.env.user.company_id.currency_id.id
|
|
|
+ currency_id = r.env.user.company_id.currency_id.id
|
|
|
|
|
|
self.make_info_log('[OK] Getting journal')
|
|
|
|
|
@@ -268,7 +268,7 @@ class PosSales(http.Controller):
|
|
|
self.make_info_log('[OK] Closing invoice')
|
|
|
|
|
|
# Create bank statement
|
|
|
- create_bank_statement(account_voucher.id, date_now)
|
|
|
+ invoice.create_bank_statement(date_now, r.context.get('uid'), account_voucher, None)
|
|
|
self.make_info_log('[OK] Creating account bank statement')
|
|
|
|
|
|
# Create bank payment statement
|
|
@@ -314,7 +314,7 @@ class PosSales(http.Controller):
|
|
|
from res_bank_payment import create_bank_payment_statement
|
|
|
|
|
|
# Payment term
|
|
|
- sale_order = request.env['sale.order'].browse(sale_order_id)
|
|
|
+ sale_order = r.env['sale.order'].browse(sale_order_id)
|
|
|
sale_order.write({
|
|
|
'payment_term': payment_term_id
|
|
|
})
|
|
@@ -344,7 +344,7 @@ class PosSales(http.Controller):
|
|
|
self.make_info_log('[OK] Closing invoice')
|
|
|
|
|
|
# Create bank statement
|
|
|
- create_bank_statement(account_voucher.id, date_now)
|
|
|
+ invoice.create_bank_statement(date_now, r.context.get('uid'), account_voucher, None)
|
|
|
self.make_info_log('[OK] Creating account bank statement')
|
|
|
|
|
|
# Create bank payment statement
|
|
@@ -384,6 +384,9 @@ class PosSales(http.Controller):
|
|
|
payment_method = row.get('paymentMethod', 'Efectivo')
|
|
|
bank_payment_data = row.get('bankPaymentData', {})
|
|
|
|
|
|
+ if warehouse_id is None:
|
|
|
+ warehouse_id = r.env['sale.order']._get_default_warehouse()
|
|
|
+
|
|
|
if mode == 'budget':
|
|
|
finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id, customer_pricelist_id, user_id)
|
|
|
|