Fix tests
This commit is contained in:
parent
4277d8ec3f
commit
6fa83746e0
8
sale.py
8
sale.py
|
@ -54,10 +54,10 @@ class MoveEvent:
|
|||
cls.raise_user_error('weight_required_in_sale_move_event',
|
||||
(event.rec_name,))
|
||||
sales_to_process.add(event.origin.sale.id)
|
||||
super(MoveEvent, cls).validate_event(events)
|
||||
if sales_to_process:
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
Sale.process(Sale.browse(list(sales_to_process)))
|
||||
with Transaction().set_user(0, set_context=True):
|
||||
super(MoveEvent, cls).validate_event(events)
|
||||
if sales_to_process:
|
||||
Sale.process(Sale.browse(list(sales_to_process)))
|
||||
|
||||
|
||||
class Sale:
|
||||
|
|
|
@ -299,6 +299,7 @@ state::
|
|||
|
||||
>>> config.user = farm_user.id
|
||||
>>> MoveEvent = Model.get('farm.move.event')
|
||||
>>> move_event = MoveEvent(move_event.id)
|
||||
>>> move_event.weight = Decimal('2365.0')
|
||||
>>> move_event.save()
|
||||
>>> MoveEvent.validate_event([move_event.id], config.context)
|
||||
|
@ -309,17 +310,19 @@ state::
|
|||
>>> sale.reload()
|
||||
>>> sale.shipment_state
|
||||
u'sent'
|
||||
>>> invoice, = sale.invoices
|
||||
|
||||
|
||||
Post invoice::
|
||||
|
||||
>>> config.user = account_user.id
|
||||
>>> Invoice = Model.get('account.invoice')
|
||||
>>> Invoice.post([i.id for i in sale.invoices], config.context)
|
||||
>>> invoice = Invoice(invoice.id)
|
||||
>>> Invoice.post([invoice.id], config.context)
|
||||
>>> config.user = sale_user.id
|
||||
>>> sale.reload()
|
||||
>>> len(sale.shipments), len(sale.shipment_returns), len(sale.invoices)
|
||||
(1, 0, 1)
|
||||
(0, 0, 1)
|
||||
|
||||
Pay invoice (TODO) and check unit price of Move event and Lot cost price is
|
||||
updated::
|
||||
|
|
Loading…
Reference in New Issue