update optical_equipment

This commit is contained in:
raskolnikov 2022-12-12 12:01:03 -05:00
parent 1e04245079
commit 5b8f627652

50
move.py
View File

@ -72,19 +72,6 @@ class ShipmentOut(metaclass=PoolMeta):
| (Eval('sale_type').in_(['maintenance', 'replaces'])))}
})
def get_outgoing_moves(self, name):
moves = []
if self.state == 'done':
for move in self.inventory_moves:
moves.append(move.id)
return moves
else:
for move in self.moves:
if move.from_location == self.warehouse_output:
moves.append(move.id)
return moves
@classmethod
def view_attributes(cls):
return super(ShipmentOut, cls).view_attributes() + [
@ -179,44 +166,11 @@ class ShipmentOut(metaclass=PoolMeta):
propietary_address=shipment.delivery_address.id,
equipment=move.equipment.id)
maintenance.save()
shipment.service_maintenance_initial = True
shipment.save()
else:
raise UserError(str('Por favor Primero debe Asignar un serial a todos los Equipos.'))
def _get_inventory_move(self, move):
'Return inventory move for the outgoing move if necessary'
pool = Pool()
Move = pool.get('stock.move')
Uom = pool.get('product.uom')
quantity = move.quantity
for inventory_move in self.inventory_moves:
if (inventory_move.origin == move
and inventory_move.state != 'cancelled'):
quantity -= Uom.compute_qty(
inventory_move.uom, inventory_move.quantity, move.uom)
quantity = move.uom.round(quantity)
if quantity <= 0:
return
inventory_move = Move(
from_location=self.warehouse_storage,
to_location=move.from_location,
product=move.product,
uom=move.uom,
quantity=quantity,
shipment=self,
planned_date=move.planned_date,
company=move.company,
origin=move,
state='staging' if move.state == 'staging' else 'draft',
)
if inventory_move.on_change_with_unit_price_required():
inventory_move.unit_price = move.unit_price
inventory_move.currency = move.currency
return inventory_move
class ShipmentInternal(metaclass=PoolMeta):
'Shipment Interncal'