diff --git a/modules/purchase_trade/purchase.py b/modules/purchase_trade/purchase.py index 63d8314..f8e4d55 100755 --- a/modules/purchase_trade/purchase.py +++ b/modules/purchase_trade/purchase.py @@ -922,6 +922,7 @@ class ContractClause(ModelSQL, ModelView): (None, ''), ('bulk', 'Bulk'), ('container', 'Container'), + ('tanker', 'Tanker'), ], "Cargo Mode") variables = fields.Function( fields.Char("Variables"), 'get_variables') @@ -992,6 +993,7 @@ class ContractTemplate(ModelSQL, ModelView): (None, ''), ('bulk', 'Bulk'), ('container', 'Container'), + ('tanker', 'Tanker'), ], "Cargo Mode") lines = fields.One2Many( 'contract.template.line', 'template', "Clauses") diff --git a/modules/purchase_trade/stock.py b/modules/purchase_trade/stock.py index a31b73e..1fa8525 100755 --- a/modules/purchase_trade/stock.py +++ b/modules/purchase_trade/stock.py @@ -66,12 +66,13 @@ class Location(metaclass=PoolMeta): if self.name == 'Transit': return True -class Move(metaclass=PoolMeta): - __name__ = 'stock.move' - - bldate = fields.Date("BL date") - lotqt = fields.One2Many('lot.qt','lot_move',"Lots") - lot = fields.Many2One('lot.lot',"Lot") +class Move(metaclass=PoolMeta): + __name__ = 'stock.move' + + bldate = fields.Date("BL date") + blnumber = fields.Char("BL number") + lotqt = fields.One2Many('lot.qt','lot_move',"Lots") + lot = fields.Many2One('lot.lot',"Lot") def get_linked_transit_move(self): if self.from_location.is_transit(): @@ -736,6 +737,7 @@ class ShipmentIn(metaclass=PoolMeta): ('none', ''), ('bulk', 'Bulk'), ('container', 'Container'), + ('tanker', 'Tanker'), ], 'Cargo Mode', required=True, states={'invisible': Eval('transport_type') == 'truck'}) @@ -1984,12 +1986,15 @@ class ShipmentIn(metaclass=PoolMeta): lot.lot_shipment_in = None lot.lot_av = 'available' Lot.save([lot]) - elif sh.incoming_moves: - for m in sh.incoming_moves: - if sh.bl_date: - m.bldate = sh.bl_date - StockMove.save([m]) - for lot in lots: + elif sh.incoming_moves: + for m in sh.incoming_moves: + if sh.bl_date: + m.bldate = sh.bl_date + if sh.bl_number: + m.blnumber = sh.bl_number + if sh.bl_date or sh.bl_number: + StockMove.save([m]) + for lot in lots: if lot.lot_type == 'physic': lot.lot_status = 'transit' Lot.save([lot]) diff --git a/modules/purchase_trade/view/move_form.xml b/modules/purchase_trade/view/move_form.xml index 0db42d2..2cdf480 100755 --- a/modules/purchase_trade/view/move_form.xml +++ b/modules/purchase_trade/view/move_form.xml @@ -9,6 +9,8 @@ this repository contains the full copyright notices and license terms. --> +