|
@@ -86,8 +86,11 @@ class PosSales(http.Controller):
|
|
'date': get_datetime(),
|
|
'date': get_datetime(),
|
|
'user': get_current_user(),
|
|
'user': get_current_user(),
|
|
'currencies': currencies,
|
|
'currencies': currencies,
|
|
|
|
+ 'journals': get_journals(),
|
|
'customers': get_customers(image_type=image_type),
|
|
'customers': get_customers(image_type=image_type),
|
|
- 'products': get_products(image_type, map(lambda x: x.get('locationStock').get('id'), warehouses))
|
|
|
|
|
|
+ 'products': get_products(image_type, map(lambda x: x.get('locationStock').get('id'), warehouses)),
|
|
|
|
+ 'paymentTerms': get_payment_terms(),
|
|
|
|
+ 'warehouses': warehouses
|
|
}
|
|
}
|
|
|
|
|
|
# Take data for payment
|
|
# Take data for payment
|
|
@@ -183,21 +186,13 @@ class PosSales(http.Controller):
|
|
|
|
|
|
# Imports
|
|
# Imports
|
|
from server_datetime import get_date, get_datetime
|
|
from server_datetime import get_date, get_datetime
|
|
- from account_journal import get_currency
|
|
|
|
|
|
|
|
'''
|
|
'''
|
|
╔═╗╦╔╗╔╦╔═╗╦ ╦ ╔╗ ╦ ╦╔╦╗╔═╗╔═╗╔╦╗ ╔═╗╔═╗╔═╗ ╔═╗╦═╗╔═╗╔═╗╔═╗╔╦╗╦ ╦╦═╗╔═╗
|
|
╔═╗╦╔╗╔╦╔═╗╦ ╦ ╔╗ ╦ ╦╔╦╗╔═╗╔═╗╔╦╗ ╔═╗╔═╗╔═╗ ╔═╗╦═╗╔═╗╔═╗╔═╗╔╦╗╦ ╦╦═╗╔═╗
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠╩╗║ ║ ║║║ ╦║╣ ║ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠╩╗║ ║ ║║║ ╦║╣ ║ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╚═╝═╩╝╚═╝╚═╝ ╩ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╚═╝═╩╝╚═╝╚═╝ ╩ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
'''
|
|
'''
|
|
- def finish_budget_pos(
|
|
|
|
- journal_id,
|
|
|
|
- customer_id,
|
|
|
|
- cart_items,
|
|
|
|
- date_now,
|
|
|
|
- payment_term_id,
|
|
|
|
- warehouse_id
|
|
|
|
- ):
|
|
|
|
|
|
+ def finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id):
|
|
# Imports
|
|
# Imports
|
|
from account_journal import get_currency
|
|
from account_journal import get_currency
|
|
from sale_order import create_sale_from_cart
|
|
from sale_order import create_sale_from_cart
|
|
@@ -221,17 +216,7 @@ class PosSales(http.Controller):
|
|
╠╣ ║║║║║╚═╗╠═╣ ╚═╗╠═╣║ ║╣ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╠╣ ║║║║║╚═╗╠═╣ ╚═╗╠═╣║ ║╣ ╠═╝║ ║╚═╗ ╠═╝╠╦╝║ ║║ ║╣ ║║║ ║╠╦╝║╣
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╩ ╩╩═╝╚═╝ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╚═╝╩ ╩╩═╝╚═╝ ╩ ╚═╝╚═╝ ╩ ╩╚═╚═╝╚═╝╚═╝═╩╝╚═╝╩╚═╚═╝
|
|
'''
|
|
'''
|
|
- def finish_sale_pos(
|
|
|
|
- journal_id,
|
|
|
|
- customer_id,
|
|
|
|
- cart_items,
|
|
|
|
- date_now,
|
|
|
|
- payment_term_id,
|
|
|
|
- payment,
|
|
|
|
- payment_method,
|
|
|
|
- bank_payment_data,
|
|
|
|
- warehouse_id
|
|
|
|
- ):
|
|
|
|
|
|
+ def finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id):
|
|
# Create budget
|
|
# Create budget
|
|
sale_order_id, currency_id = finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
sale_order_id, currency_id = finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
|
|
|
|
@@ -290,14 +275,8 @@ class PosSales(http.Controller):
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠═╝╠╦╝║ ║ ║║║ ║║ ║ ╠═╝║║ ╠╩╗║║║║║ ╦
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠═╝╠╦╝║ ║ ║║║ ║║ ║ ╠═╝║║ ╠╩╗║║║║║ ╦
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╩ ╩╚═╚═╝═╩╝╚═╝╚═╝ ╩ ╩ ╩╚═╝╩ ╩╩╝╚╝╚═╝
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╩ ╩╚═╚═╝═╩╝╚═╝╚═╝ ╩ ╩ ╩╚═╝╩ ╩╩╝╚╝╚═╝
|
|
'''
|
|
'''
|
|
- def finish_process_picking(
|
|
|
|
- journal_id,
|
|
|
|
- customer_id,
|
|
|
|
- cart_items,
|
|
|
|
- date_now,
|
|
|
|
- payment_term_id
|
|
|
|
- ):
|
|
|
|
- sale_order_id, _ = finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id)
|
|
|
|
|
|
+ def finish_process_picking(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id):
|
|
|
|
+ sale_order_id, _ = finish_budget_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
|
|
|
|
# Imports
|
|
# Imports
|
|
from sale_order import confirm_sale_order, force_assign_picking
|
|
from sale_order import confirm_sale_order, force_assign_picking
|
|
@@ -315,18 +294,10 @@ class PosSales(http.Controller):
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠═╝╠═╣╚╦╝║║║║╣ ║║║ ║
|
|
╠╣ ║║║║║╚═╗╠═╣ ╠═╝╠═╣╚╦╝║║║║╣ ║║║ ║
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╩ ╩ ╩ ╩ ╩ ╩╚═╝╝╚╝ ╩
|
|
╚ ╩╝╚╝╩╚═╝╩ ╩ ╩ ╩ ╩ ╩ ╩ ╩╚═╝╝╚╝ ╩
|
|
'''
|
|
'''
|
|
- def finish_payment(
|
|
|
|
- sale_order_id,
|
|
|
|
- currency_id,
|
|
|
|
- date_now,
|
|
|
|
- payment_term_id,
|
|
|
|
- payment,
|
|
|
|
- payment_method,
|
|
|
|
- bank_payment_data
|
|
|
|
- ):
|
|
|
|
|
|
+ def finish_payment(sale_order_id, currency_id, date_now, payment_term_id, payment, payment_method, bank_payment_data):
|
|
# Imports
|
|
# Imports
|
|
from account_invoice import (
|
|
from account_invoice import (
|
|
- create_invoice,
|
|
|
|
|
|
+ create_invoice,
|
|
create_invoice_move_lines,
|
|
create_invoice_move_lines,
|
|
number_invoice,
|
|
number_invoice,
|
|
close_invoice
|
|
close_invoice
|
|
@@ -412,7 +383,7 @@ class PosSales(http.Controller):
|
|
finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id)
|
|
finish_sale_pos(journal_id, customer_id, cart_items, date_now, payment_term_id, payment, payment_method, bank_payment_data, warehouse_id)
|
|
|
|
|
|
if mode == 'product_picking':
|
|
if mode == 'product_picking':
|
|
- finish_process_picking(journal_id, customer_id, cart_items, date_now, payment_term_id)
|
|
|
|
|
|
+ finish_process_picking(journal_id, customer_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
|
|
|
|
if mode == 'payment':
|
|
if mode == 'payment':
|
|
sale_order_id = row.get('saleOrderId', None)
|
|
sale_order_id = row.get('saleOrderId', None)
|