Link to transport
This commit is contained in:
@@ -2972,6 +2972,8 @@ class LotShipping(Wizard):
|
||||
|
||||
def default_ship(self, fields):
|
||||
values = {}
|
||||
if getattr(self, '_created_shipment_in', None):
|
||||
values['shipment_in'] = self._created_shipment_in
|
||||
if len(self.records) != 1:
|
||||
return values
|
||||
record = self.records[0]
|
||||
@@ -3017,7 +3019,7 @@ class LotShipping(Wizard):
|
||||
if self.ship.shipment_in:
|
||||
return 'ship'
|
||||
shipment, = ShipmentIn.create([self._shipment_in_create_values()])
|
||||
self.ship.shipment_in = shipment
|
||||
self._created_shipment_in = shipment.id
|
||||
return 'ship'
|
||||
|
||||
def transition_shipping(self):
|
||||
|
||||
@@ -223,7 +223,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'link to transport creates shipment in from planned locations'
|
||||
wizard = lot_module.LotShipping()
|
||||
supplier = Mock(id=30)
|
||||
created_shipment = Mock()
|
||||
created_shipment = Mock(id=40)
|
||||
ShipmentIn = Mock()
|
||||
ShipmentIn.create.return_value = [created_shipment]
|
||||
wizard.records = [Mock(r_supplier=supplier)]
|
||||
@@ -244,7 +244,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'from_location': 10,
|
||||
'to_location': 20,
|
||||
}])
|
||||
self.assertEqual(wizard.ship.shipment_in, created_shipment)
|
||||
self.assertEqual(wizard.default_ship(None)['shipment_in'], 40)
|
||||
|
||||
@with_transaction()
|
||||
def test_get_mtm_applies_component_ratio_as_percentage(self):
|
||||
|
||||
Reference in New Issue
Block a user