Default From To
This commit is contained in:
@@ -2108,6 +2108,8 @@ class LotQt(
|
||||
lqt.lot_shipment_internal.as_('r_lot_shipment_internal'),
|
||||
si.vessel.as_('r_vessel'),
|
||||
si.operator.as_('r_operator'),
|
||||
si.bl_date.as_('r_bl_date'),
|
||||
si.bl_number.as_('r_bl_number'),
|
||||
lqt.lot_move.as_('r_lot_move'),
|
||||
lqt.lot_status.as_('r_lot_status'),
|
||||
Case((lp.lot_type=='physic',lp.lot_av),else_=lqt.lot_av).as_('r_lot_av'),
|
||||
@@ -2264,6 +2266,8 @@ class LotQt(
|
||||
lp.lot_shipment_internal.as_('r_lot_shipment_internal'),
|
||||
si.vessel.as_("r_vessel"),
|
||||
si.operator.as_("r_operator"),
|
||||
si.bl_date.as_("r_bl_date"),
|
||||
si.bl_number.as_("r_bl_number"),
|
||||
lp.move.as_("r_lot_move"),
|
||||
lp.lot_status.as_("r_lot_status"),
|
||||
lp.lot_av.as_("r_lot_av"),
|
||||
@@ -2340,6 +2344,8 @@ class LotQt(
|
||||
lp.lot_shipment_internal.as_('r_lot_shipment_internal'),
|
||||
Max(si.vessel).as_("r_vessel"),
|
||||
Max(si.operator).as_("r_operator"),
|
||||
Max(si.bl_date).as_("r_bl_date"),
|
||||
Max(si.bl_number).as_("r_bl_number"),
|
||||
Max(lp.move).as_("r_lot_move"),
|
||||
Max(lp.lot_status).as_("r_lot_status"),
|
||||
Max(lp.lot_av).as_("r_lot_av"),
|
||||
@@ -2404,6 +2410,8 @@ class LotQt(
|
||||
union.r_lot_shipment_internal.as_('r_lot_shipment_internal'),
|
||||
union.r_vessel.as_("r_vessel"),
|
||||
union.r_operator.as_("r_operator"),
|
||||
union.r_bl_date.as_("r_bl_date"),
|
||||
union.r_bl_number.as_("r_bl_number"),
|
||||
union.r_lot_move.as_("r_lot_move"),
|
||||
union.r_lot_status.as_("r_lot_status"),
|
||||
union.r_lot_av.as_("r_lot_av"),
|
||||
@@ -2492,6 +2500,8 @@ class LotReport(
|
||||
r_lot_shipment_internal = fields.Many2One('stock.shipment.internal', "Shipment Internal")
|
||||
r_vessel = fields.Many2One('trade.vessel', "Vessel")
|
||||
r_operator = fields.Many2One('party.party', "Operator")
|
||||
r_bl_date = fields.Date("BL date")
|
||||
r_bl_number = fields.Char("BL number")
|
||||
r_lot_move = fields.Many2One('stock.move', "Move")
|
||||
r_lot_parent = fields.Many2One('lot.lot',"Parent")
|
||||
r_lot_himself = fields.Many2One('lot.lot',"Lot")
|
||||
@@ -2953,17 +2963,23 @@ class LotShipping(Wizard):
|
||||
|
||||
shipping = StateTransition()
|
||||
|
||||
def transition_start(self):
|
||||
if self.model.__name__ == 'lot.report':
|
||||
return 'ship'
|
||||
return 'end'
|
||||
|
||||
#def default_ship(self, fields):
|
||||
#values = []
|
||||
# if self.model.__name__ == 'lot.report':
|
||||
# return {
|
||||
# }
|
||||
|
||||
def transition_start(self):
|
||||
if self.model.__name__ == 'lot.report':
|
||||
return 'ship'
|
||||
return 'end'
|
||||
|
||||
def default_ship(self, fields):
|
||||
values = {}
|
||||
if len(self.records) != 1:
|
||||
return values
|
||||
record = self.records[0]
|
||||
if record.r_planned_from_location:
|
||||
values['planned_from_location'] = (
|
||||
record.r_planned_from_location.id)
|
||||
if record.r_planned_to_location:
|
||||
values['planned_to_location'] = record.r_planned_to_location.id
|
||||
return values
|
||||
|
||||
def transition_shipping(self):
|
||||
Lot = Pool().get('lot.lot')
|
||||
LotQt = Pool().get('lot.qt')
|
||||
@@ -3078,11 +3094,15 @@ class LotShippingStart(ModelView):
|
||||
('out', 'Shipment Out'),
|
||||
('int', 'Internal Shipment'),
|
||||
], 'Shipment type', readonly=True)
|
||||
shipment_in = fields.Many2One('stock.shipment.in',"Shipment In", states={'invisible': (Eval('shipment') != 'in')})
|
||||
shipment_out = fields.Many2One('stock.shipment.out',"Shipment Out", states={'invisible': (Eval('shipment') != 'out')})
|
||||
shipment_internal = fields.Many2One('stock.shipment.internal',"Shipment Internal", states={'invisible': (Eval('shipment') != 'int')})
|
||||
full = fields.Boolean("Link all the lot")
|
||||
quantity = fields.Numeric("Qt", states={'readonly': (Eval('full') == True)})
|
||||
shipment_in = fields.Many2One('stock.shipment.in',"Shipment In", states={'invisible': (Eval('shipment') != 'in')})
|
||||
shipment_out = fields.Many2One('stock.shipment.out',"Shipment Out", states={'invisible': (Eval('shipment') != 'out')})
|
||||
shipment_internal = fields.Many2One('stock.shipment.internal',"Shipment Internal", states={'invisible': (Eval('shipment') != 'int')})
|
||||
planned_from_location = fields.Many2One(
|
||||
'stock.location', "Planned From", readonly=True)
|
||||
planned_to_location = fields.Many2One(
|
||||
'stock.location', "Planned To", readonly=True)
|
||||
full = fields.Boolean("Link all the lot")
|
||||
quantity = fields.Numeric("Qt", states={'readonly': (Eval('full') == True)})
|
||||
|
||||
@classmethod
|
||||
def default_full(cls):
|
||||
|
||||
Reference in New Issue
Block a user