This feature supports the use case of: - a customer receives a delivery from you. - there is a defective product in the delivery - they schedule a repair (RO) + return (picking) for the product We want to ease the creation/management of the repair order associated with the return, therefore the following features are added: - Create links between ROs and return pickings (smart button in return of all repairs associated with it + field in RO) - Option (requires active setting) to create RO(s) directly from a return picking Implementation notes: - Because return picking type doesn't have its own "Type of Operation" (it is 'code'='incoming'), we default to only incoming picking types that have at least 1 other picking type it is the 'return_picking_type_id' of. - Originally a Wizard for choosing which/how many products should have ROs created for them was designed (i.e. to match return wizard + to multi-create ROs), but this was determined to be too complicated due to SN/lot selection. Instead simple approach of creating a single RO each time button is pushed was implemented to match the helpdesk > repair button workflow. - ROs are purposely allowed for 'draft' and 'cancelled' returns/moves to support different types of workflows (e.g. RO is confirmed before return is) closes odoo/odoo#85157 Task: 2732517 Signed-off-by: Arnold Moyaux <arm@odoo.com>
37 lines
1.8 KiB
XML
37 lines
1.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="repair_view_picking_type_form" model="ir.ui.view">
|
|
<field name="name">stock.picking.type.inherit.repair</field>
|
|
<field name="model">stock.picking.type</field>
|
|
<field name="inherit_id" ref="stock.view_picking_type_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//group[@name='locations']" position="after">
|
|
<field name="return_type_of_ids" invisible="1"/>
|
|
<group string="Repairs" attrs="{'invisible': ['|', ('code', '!=', 'incoming'), ('return_type_of_ids', '=', [])]}">
|
|
<field name="is_repairable"/>
|
|
</group>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="repair_view_picking_form" model="ir.ui.view">
|
|
<field name="name">stock.picking.form.inherit.repair</field>
|
|
<field name="model">stock.picking</field>
|
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//button[@name='%(stock.act_stock_return_picking)d']" position="after">
|
|
<field name="is_repairable" invisible="1"/>
|
|
<button string="Repair" name="action_repair_return" type="object" attrs="{'invisible': [('is_repairable', '=', False)]}" data-hotkey="shift+k"/>
|
|
</xpath>
|
|
<xpath expr="//button[@name='action_see_packages']" position="after">
|
|
<field name="repair_ids" invisible="1"/>
|
|
<button name="action_view_repairs" type="object"
|
|
class="oe_stat_button" icon="fa-wrench"
|
|
attrs="{'invisible': [('nbr_repairs', '=', 0)]}">
|
|
<field name="nbr_repairs" string="Repair Orders" widget="statinfo"/>
|
|
</button>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
</odoo>
|