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