|
@@ -100,7 +100,7 @@ def process_data(data=None):
|
|
|
|
|
|
return order.id
|
|
return order.id
|
|
|
|
|
|
- def paying_order(order_id, supplier_invoice_number=None, date_now=None, payment_term_id=None):
|
|
|
|
|
|
+ def paying_order(order_id, supplier_invoice_number=None, date_now=None, payment_term_id=None, mode=None):
|
|
order = get_purchase_order(order_id)
|
|
order = get_purchase_order(order_id)
|
|
|
|
|
|
lines = [{
|
|
lines = [{
|
|
@@ -152,14 +152,9 @@ def process_data(data=None):
|
|
payment = float(data.get('payment', 0.0))
|
|
payment = float(data.get('payment', 0.0))
|
|
|
|
|
|
if mode not in ('product_picking', 'payment', 'product_taking'):
|
|
if mode not in ('product_picking', 'payment', 'product_taking'):
|
|
- order_id = None
|
|
|
|
-
|
|
|
|
- if mode == 'purchase':
|
|
|
|
- order_id, currency_id = drafting_order(currency_id, supplier_id, cart_items, date_now, payment_term_id)
|
|
|
|
- making_order(order_id)
|
|
|
|
- complete_order(order_id)
|
|
|
|
- else:
|
|
|
|
- paying_order(order_id)
|
|
|
|
|
|
+ order_id, currency_id = drafting_order(currency_id, supplier_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
|
|
+ confirm_purchase_order(order_id)
|
|
|
|
+ paying_order(order_id, supplier_invoice_number, date_now, payment_term_id, mode)
|
|
|
|
|
|
if mode == 'product_picking':
|
|
if mode == 'product_picking':
|
|
order_id, currency_id = drafting_order(currency_id, supplier_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
order_id, currency_id = drafting_order(currency_id, supplier_id, cart_items, date_now, payment_term_id, warehouse_id)
|
|
@@ -171,7 +166,7 @@ def process_data(data=None):
|
|
if not order_id:
|
|
if not order_id:
|
|
return
|
|
return
|
|
|
|
|
|
- paying_order(order_id, supplier_invoice_number, date_now, payment_term_id)
|
|
|
|
|
|
+ paying_order(order_id, supplier_invoice_number, date_now, payment_term_id, mode)
|
|
done_purchase_order(order_id)
|
|
done_purchase_order(order_id)
|
|
|
|
|
|
if mode == 'product_taking':
|
|
if mode == 'product_taking':
|