change to location of equipments
This commit is contained in:
parent
bcfb207a30
commit
d69e4b141a
@ -27,6 +27,7 @@ def register():
|
||||
maintenance.ServiceMaintenanceAgended,
|
||||
move.Move,
|
||||
move.ShipmentOut,
|
||||
move.ShipmentInternal,
|
||||
sale.Sale,
|
||||
sale.SaleLine,
|
||||
contract.Contract,
|
||||
|
@ -191,7 +191,7 @@
|
||||
<field name="type">form</field>
|
||||
<field name="name">calibration_total_form</field>
|
||||
</record>
|
||||
|
||||
<!-- Vista de Calendario Inutilizada
|
||||
<record model="ir.ui.view" id="maintenance_diary_view_calendar">
|
||||
<field name="model">optical_equipment_maintenance.diary</field>
|
||||
<field name="type">calendar</field>
|
||||
@ -213,6 +213,7 @@
|
||||
<field name="view" ref="optical_equipment.agended_list_view_form"/>
|
||||
<field name="act_window" ref="act_maintenance_diary_calendar"/>
|
||||
</record>
|
||||
-->
|
||||
<record model="ir.ui.view" id="assing_agended_view_form">
|
||||
<field name="model">optical_equipment_maintenance.agended</field>
|
||||
<field name="type">form</field>
|
||||
@ -270,10 +271,12 @@
|
||||
<field name="model">optical_equipment_maintenance.service,-1</field>
|
||||
<field name="action" ref="report_capacitation"/>
|
||||
</record>
|
||||
<!--
|
||||
<menuitem parent="menu_diary"
|
||||
action="act_maintenance_diary_calendar"
|
||||
sequence="10"
|
||||
id="menu_agenda_form"/>
|
||||
-->
|
||||
<menuitem parent="menu_equipment"
|
||||
action="act_maintenance_service_form"
|
||||
sequence="20"
|
||||
|
33
move.py
33
move.py
@ -159,9 +159,38 @@ class ShipmentOut(metaclass=PoolMeta):
|
||||
)
|
||||
|
||||
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'
|
||||
__name__ = 'stock.shipment.internal'
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('done')
|
||||
@set_employee('done_by')
|
||||
def done(cls, shipments):
|
||||
pool = Pool()
|
||||
Move = pool.get('stock.move')
|
||||
Date = pool.get('ir.date')
|
||||
|
||||
for shipment in shipments:
|
||||
for move in shipment.moves:
|
||||
if move.equipment:
|
||||
move.equipment.location = shipment.to_location
|
||||
move.equipment.save()
|
||||
|
||||
Move.do([m for s in shipments for m in s.incoming_moves])
|
||||
cls.write([s for s in shipments if not s.effective_date], {
|
||||
|
||||
'effective_date': Date.today(),
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
this repository contains the full copyright notices and license terms.-->
|
||||
<tree>
|
||||
<field name="code"/>
|
||||
<field name="location"/>
|
||||
<field name="propietary"/>
|
||||
<field name="propietary_address"/>
|
||||
<field name="product" expand="1"/>
|
||||
|
Loading…
Reference in New Issue
Block a user