flectra/addons/mrp_repair/views/mrp_repair_views.xml

295 lines
18 KiB
XML
Raw Permalink Normal View History

<?xml version="1.0" encoding="utf-8"?>
2018-01-16 11:34:37 +01:00
<flectra>
<data>
<record id="view_repair_order_tree" model="ir.ui.view">
<field name="name">mrp.repair.tree</field>
<field name="model">mrp.repair</field>
<field name="arch" type="xml">
<tree string="Repairs order" decoration-muted="state in ('done','cancel')" decoration-info="state=='draft'">
<field name="name" />
<field name="product_id" />
<field name="partner_id"/>
<field name="address_id"/>
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
<field name="guarantee_limit"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_repair_order_form" model="ir.ui.view">
<field name="name">mrp.repair.form</field>
<field name="model">mrp.repair</field>
<field name="arch" type="xml">
<form string="Repair Order">
<header>
<button name="action_send_mail" states="draft" string="Send Quotation" type="object"/>
<button name="print_repair_order" states="draft" string="Print Quotation" type="object"/>
<button name="action_validate" states="draft" type="object" string="Confirm Repair" class="oe_highlight"/>
<button name="action_repair_start" attrs="{'invisible': ['&amp;', ('state','!=','confirmed'), '!', '&amp;', ('state','=','ready'), ('invoice_method','=','b4repair')]}"
type="object" string="Start Repair" class="oe_highlight"/>
<button name="action_repair_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name="action_repair_end" states="under_repair" type="object" string="End Repair" class="oe_highlight"/>
<button name="action_repair_invoice_create" states="2binvoiced" type="object" string="Create Invoice" class="oe_highlight"/>
<button name="action_repair_cancel" string="Cancel Repair" type="object" attrs="{'invisible':['|',('invoice_method','!=','none'), ('state', 'not in',('confirmed','2binvoiced','ready','under_repair'))]}"/>
<button name="action_repair_cancel" states="draft" type="object" string="Cancel Repair"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done"/>
</header>
<sheet string="Repairs order">
<div class="oe_button_box" name="button_box">
<button name="action_created_invoice"
type="object"
class="oe_stat_button"
icon="fa-pencil-square-o" string="Invoice" attrs="{'invisible': ['|',('invoice_method','=','none'), ('state','in',('confirmed','2binvoiced','draft'))]}">
</button>
</div>
<label for="name"/>
<h1>
<field name="name"/>
</h1>
<group>
<group>
<field name="tracking" invisible="1" attrs="{'readonly': 1}"/>
<field name="product_id" domain="[('type', 'in', ['product', 'consu'])]"/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom" groups="product.group_uom"/>
</div>
<field name="lot_id" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}" groups="stock.group_production_lot" attrs="{'required': [('tracking', '!=', 'none')], 'readonly': [('state', '=', 'done')]}"/>
<field name="partner_id" attrs="{'required':[('invoice_method','!=','none')]}"/>
<field name="address_id" groups="sale.group_delivery_invoice_address"/>
</group>
<group>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="guarantee_limit"/>
<field name="invoice_method"/>
<field name="partner_invoice_id" attrs="{'invisible':[('invoice_method','=', 'none')],'required':[('invoice_method','!=','none')]}" groups="sale.group_delivery_invoice_address"/>
<field name="pricelist_id" groups="product.group_sale_pricelist" context="{'product_id':product_id}" attrs="{'invisible':[('invoice_method','=', 'none')]}"/>
</group>
</group>
<notebook>
<page string="Parts">
<field name="operations" context="{'default_product_uom_qty': product_qty}">
<form string="Operations">
<notebook>
<page string="Repair Line">
<group>
<group>
<field name="product_id"/>
<field name="name"/>
<label for="product_uom_qty"/>
<div class="o_row">
<field name="product_uom_qty"/>
<field name="product_uom" groups="product.group_uom"/>
</div>
<field name="type" invisible="1"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="invoiced" invisible="1"/>
<field name="price_subtotal" widget="monetary" invisible="1"/>
</group>
<group groups="stock.group_stock_multi_locations">
<field name="location_id" />
<field name="location_dest_id"/>
</group>
</group>
</page>
<page string="History" attrs="{'invisible':[('move_id','=', False)]}">
<group>
<field name="move_id" />
<field name="invoice_line_id" invisible="1"/>
</group>
</page>
</notebook>
</form>
<tree string="Operations" editable="bottom">
<field name="type"/>
<field name="product_id"/>
<field name='name'/>
<field name="lot_id" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}" groups="stock.group_production_lot"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
<field name="product_uom_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" domain="[('type_tax_use','=','sale')]"/>
<field name="price_subtotal" widget="monetary"/>
</tree>
</field>
<group class="oe_subtotal_footer oe_right">
<field name="amount_untaxed" sum="Untaxed amount"/>
<field name="amount_tax"/>
<div class="oe_subtotal_footer_separator oe_inline">
<label for="amount_total" />
<button name="button_dummy"
states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
</div>
<field name="amount_total" nolabel="1" sum="Total amount" class="oe_subtotal_footer_separator"/>
</group>
<div class="oe_clear"/>
</page>
<page string="Operations">
<!-- <field name="invoice_id"/> -->
<field name="fees_lines">
<form string="Fees">
<group>
<field name="product_id"/>
<field name="name"/>
<label for="product_uom_qty"/>
<div class="o_row">
<field name="product_uom_qty" string="Quantity"/>
<field name="product_uom" groups="product.group_uom"/>
</div>
<field name="price_unit"/>
<field widget="many2many_tags" name="tax_id" domain="[('type_tax_use','=','sale')]"/>
<field name="price_subtotal" widget="monetary" invisible="1"/>
</group>
</form>
<tree string="Fees" editable="bottom">
<field name="product_id" domain="[('type','=','service')]" required="True"/>
<field name='name'/>
<field name="product_uom_qty" string="Quantity"/>
<field name="product_uom" string="Unit of Measure" groups="product.group_uom"/>
<field name="price_unit"/>
<field name="tax_id" domain="[('type_tax_use', '=', 'sale')]" widget="many2many_tags"/>
<field name="price_subtotal" widget="monetary"/>
</tree>
</field>
</page>
<page string="Extra Info" groups="base.group_no_one">
<group>
<group>
<field name="move_id"/>
</group>
<group>
<field name="repaired"/>
<field name="invoiced"/>
</group>
</group>
</page>
<page string="Notes">
<field name="internal_notes" placeholder="Add internal notes..."/>
<field name="quotation_notes" placeholder="Add quotation notes..."/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="view_mrp_repair_kanban" model="ir.ui.view">
<field name="name">mrp.repair.kanban</field>
<field name="model">mrp.repair</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="name" />
<field name="product_id" />
<field name="partner_id"/>
<field name="address_id"/>
<field name="guarantee_limit"/>
<field name="state"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="row mb4">
<div class="col-xs-6">
<strong><span><t t-esc="record.name.value"/></span></strong>
</div>
<div class="col-xs-6 text-right">
<span class="label label-default"><field name="state" widget="kanban_label_selection" options="{'classes': {'draft': 'info', 'cancel': 'danger', 'done': 'success', 'under_repair': 'dafault'}}"/></span>
</div>
</div>
<div class="row">
<div class="col-xs-6 text-muted">
<span><t t-esc="record.product_id.value"/></span>
</div>
<div class="col-xs-6">
<span class="pull-right">
<field name="partner_id"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_repair_order_form_filter" model="ir.ui.view">
<field name="name">mrp.repair.select</field>
<field name="model">mrp.repair</field>
<field name="arch" type="xml">
<search string="Search Repair Orders">
<field name="name" string="Repair Orders"/>
<field name="state"/>
<filter string="Quotations" domain="[('state','=','draft')]"/>
<filter string="Confirmed" domain="[('state','=','confirmed')]" name="current" />
<filter string="Ready To Repair" domain="[('state','=','ready')]"/>
<separator/>
<filter string="Invoiced" domain="[('invoiced','=',True)]"/>
<field name="product_id"/>
<field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
<separator/>
<filter string="My Activities" name="activities_my"
domain="[('activity_ids.user_id', '=', uid)]"/>
<separator/>
<filter string="Late Activities" name="activities_overdue"
domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter string="Today Activities" name="activities_today"
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Future Activities" name="activities_upcoming_all"
domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
]"/>
<group expand="0" string="Group By">
<filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="Product" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Guarantee limit Month" domain="[]" context="{'group_by':'guarantee_limit'}" help="Guarantee limit by Month"/>
<filter string="Company" domain="[]" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
</group>
</search>
</field>
</record>
<record id="action_repair_order_tree" model="ir.actions.act_window">
<field name="name">Repair Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.repair</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form</field>
<field name="search_view_id" ref="view_repair_order_form_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a reparation order.
</p><p>
In a repair order, you can detail the components you remove,
add or replace and record the time you spent on the different
operations.
</p><p>
The repair order uses the warranty date on the Serial Number in
order to know if whether the repair should be invoiced to the
customer or not.
</p>
</field>
</record>
<menuitem action="action_repair_order_tree" id="menu_repair_order" groups="stock.group_stock_user" name="Repairs" sequence="36"
web_icon="mrp_repair,static/description/icon.png"/>
</data>
2018-01-16 11:34:37 +01:00
</flectra>