mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
89 lines
2.9 KiB
Diff
89 lines
2.9 KiB
Diff
diff -r bc1fb9a60269 stock.py
|
|
--- a/trytond/trytond/modules/stock_consignment/stock.py Mon Apr 23 18:19:54 2018 +0200
|
|
+++ b/trytond/trytond/modules/stock_consignment/stock.py Mon Jul 09 11:49:57 2018 +0200
|
|
@@ -226,7 +226,7 @@
|
|
@classmethod
|
|
@ModelView.button
|
|
@Workflow.transition('assigned')
|
|
- @set_origin_consignment
|
|
+ @unset_origin_consignment
|
|
def assign(cls, moves):
|
|
super(Move, cls).assign(moves)
|
|
|
|
diff -r bc1fb9a60269 tests/scenario_stock_consignment.rst
|
|
--- a/trytond/trytond/modules/stock_consignment/tests/scenario_stock_consignment.rst Mon Apr 23 18:19:54 2018 +0200
|
|
+++ b/trytond/trytond/modules/stock_consignment/tests/scenario_stock_consignment.rst Mon Jul 09 11:49:57 2018 +0200
|
|
@@ -13,6 +13,9 @@
|
|
>>> from trytond.modules.account.tests.tools import create_chart, \
|
|
... get_accounts, create_tax
|
|
|
|
+ >>> from trytond.modules.account_invoice.tests.tools import \
|
|
+ ... create_payment_term
|
|
+
|
|
Install stock_consignment::
|
|
|
|
>>> config = activate_modules('stock_consignment')
|
|
@@ -159,23 +162,35 @@
|
|
>>> move.origin == invoice_line
|
|
True
|
|
|
|
+Create payment term::
|
|
+
|
|
+ >>> payment_term = create_payment_term()
|
|
+ >>> payment_term.save()
|
|
+
|
|
Use supplier consignment stock for shipment out::
|
|
|
|
- >>> ShipmentOut = Model.get('stock.shipment.out')
|
|
- >>> shipment_out = ShipmentOut()
|
|
- >>> shipment_out.customer = customer
|
|
- >>> shipment_out.warehouse = warehouse_loc
|
|
- >>> move = shipment_out.outgoing_moves.new()
|
|
- >>> move.product = product
|
|
- >>> move.quantity = 3
|
|
- >>> move.from_location = output_loc
|
|
- >>> move.to_location = customer_loc
|
|
+ >>> Sale = Model.get('sale.sale')
|
|
+ >>> SaleLine = Model.get('sale.line')
|
|
+ >>> sale = Sale()
|
|
+ >>> sale.party = customer
|
|
+ >>> sale.payment_term = payment_term
|
|
+ >>> sale.invoice_method = 'shipment'
|
|
+ >>> sale_line = SaleLine()
|
|
+ >>> sale.lines.append(sale_line)
|
|
+ >>> sale_line.product = product
|
|
+ >>> sale_line.quantity = 2.0
|
|
+ >>> sale.click('quote')
|
|
+ >>> sale.click('confirm')
|
|
+ >>> sale.click('process')
|
|
+ >>> shipment_out, = sale.shipments
|
|
>>> shipment_out.click('wait')
|
|
>>> move, = shipment_out.inventory_moves
|
|
>>> move.from_location = supplier_consignment_loc
|
|
>>> shipment_out.click('assign_try')
|
|
True
|
|
>>> move, = shipment_out.inventory_moves
|
|
+ >>> shipment_out.click('pack')
|
|
+ >>> shipment_out.click('done')
|
|
>>> isinstance(move.origin, InvoiceLine)
|
|
True
|
|
|
|
@@ -223,7 +238,7 @@
|
|
|
|
Check customer invoice line::
|
|
|
|
- >>> invoice_line, = InvoiceLine.find([('invoice_type', '=', 'out')])
|
|
+ >>> invoice_line = InvoiceLine.find([('invoice_type', '=', 'out')])[1]
|
|
>>> invoice_line.product == product
|
|
True
|
|
>>> invoice_line.quantity
|
|
@@ -257,7 +272,7 @@
|
|
u'assigned'
|
|
>>> move, = shipment.moves
|
|
>>> bool(move.origin)
|
|
- True
|
|
+ False
|
|
>>> shipment.click('cancel')
|
|
>>> shipment.state
|
|
u'cancel'
|