181 lines
8.7 KiB
XML
181 lines
8.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Sample form view -->
|
|
<record id="grn_view_form" model="ir.ui.view">
|
|
<field name="name">grn.view.form</field>
|
|
<field name="model">grn</field>
|
|
<field name="arch" type="xml">
|
|
<form string="GRN">
|
|
<header>
|
|
<button name="button_action_confirm" string="Confirm" type="object" class="btn-primary" invisible="state != 'draft'"/>
|
|
<button name="button_create_transfer" string="Create Transfer" type="object" class="btn-info" invisible="state != 'confirmed' or picking_id != False"/>
|
|
<button name="button_action_done" string="Done" type="object" class="btn-primary" invisible="state != 'confirmed'"/>
|
|
<button name="button_action_cancel" string="Cancel" type="object" class="btn-secondary" invisible="state not in ['done','confirmed']"/>
|
|
<button name="button_action_reset_to_draft" string="Reset To Draft" type="object" class="btn-secondary" invisible="state != 'cancel'"/>
|
|
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" readonly="1"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button icon="fa-truck" type="object" name="action_view_transfer" invisible="not picking_id">
|
|
Receipts
|
|
</button>
|
|
</div>
|
|
<div class="oe_title">
|
|
<label for="name"/>
|
|
<h1>
|
|
<field name="name" placeholder="e.g Marc Demo"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="vendor_id" readonly="state != 'draft'" options="{'no_create_edit': True, 'no_create': True}"/>
|
|
<field name="location_id" readonly="state != 'draft'" options="{'no_create_edit': True, 'no_create': True}"/>
|
|
</group>
|
|
<group>
|
|
<field name="date" readonly="state != 'draft'"/>
|
|
<field name="picking_id" readonly="1" invisible="not picking_id"/>
|
|
</group>
|
|
<group>
|
|
<field name="note" readonly="state != 'draft'"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="GRN Details">
|
|
<field name="grn_line_ids" readonly="state != 'draft'">
|
|
<list editable="bottom">
|
|
<control>
|
|
<create string="Add a line"/>
|
|
<button name="action_add_from_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'order_id': parent.id}"/>
|
|
</control>
|
|
<field name="product_id" readonly="parent.state != 'draft'" options="{'no_create_edit': True, 'no_create': True}"/>
|
|
<field name="quantity" readonly="parent.state != 'draft'"/>
|
|
<field name="product_uom_id" readonly="1" string="UoM"/>
|
|
<field name="price" readonly="parent.state != 'draft'"/>
|
|
<field name="total_price" sum="Total" readonly="1" force_save="1"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<chatter/>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Sample list view -->
|
|
<record id="grn_view_list" model="ir.ui.view">
|
|
<field name="name">grn.view.list</field>
|
|
<field name="model">grn</field>
|
|
<field name="arch" type="xml">
|
|
<list string="GRN">
|
|
<field name="name"/>
|
|
<field name="date"/>
|
|
<field name="vendor_id"/>
|
|
<field name="state"/>
|
|
<field name="total_amount" readonly="1" string="Amount" sum="Total"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
<record id="grn_stock_quant_view_list" model="ir.ui.view">
|
|
<field name="name">stock.quant.grn.list</field>
|
|
<field name="model">stock.quant</field>
|
|
<field name="arch" type="xml">
|
|
<list string="Product Value">
|
|
<field name="product_id" column_invisible="context.get('single_product', False)"/>
|
|
<field name="location_id" column_invisible="context.get('hide_location', False)"/>
|
|
<field name="lot_id" groups="stock.group_production_lot" column_invisible="context.get('hide_lot', False)"/>
|
|
<field name="lot_properties"/>
|
|
<field name="quantity" string="On Hand"/>
|
|
<field name="product_uom_id" groups="uom.group_uom" string="Unit"/>
|
|
<field name="available_quantity" string="Available"/>
|
|
<field name="product_uom_id" groups="uom.group_uom" string="Unit"/>
|
|
<field name="company_id" groups="base.group_multi_company" optional="hidden"/>
|
|
<field name="currency_id" column_invisible="True"/>
|
|
<field name="cost_method" column_invisible="True"/>
|
|
<field name="value" sum="Total Value"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
<!-- Kanban View -->
|
|
<record id="grn_view_kanban" model="ir.ui.view">
|
|
<field name="name">grn.view.kanban</field>
|
|
<field name="model">grn</field>
|
|
<field name="arch" type="xml">
|
|
<kanban>
|
|
<field name="state"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_kanban_global_click">
|
|
<field name="name"/><br/>
|
|
<field name="date"/><br/>
|
|
<field name="state"/>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Search View -->
|
|
<record id="grn_view_search" model="ir.ui.view">
|
|
<field name="name">grn.view.search</field>
|
|
<field name="model">grn</field>
|
|
<field name="arch" type="xml">
|
|
<search>
|
|
<field name="name"/>
|
|
<filter string="Draft" name="filter_draft" domain="[('state','=','draft')]"/>
|
|
<filter string="Confirmed" name="filter_confirmed" domain="[('state','=','confirmed')]"/>
|
|
<filter string="Done" name="filter_done" domain="[('state','=','done')]"/>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
<!-- Action -->
|
|
<record id="grn_action" model="ir.actions.act_window">
|
|
<field name="name">GRN</field>
|
|
<field name="res_model">grn</field>
|
|
<field name="view_mode">list,form,kanban</field>
|
|
</record>
|
|
<record id="action_picking_list_incoming" model="ir.actions.act_window">
|
|
<field name="name">GRN Receipts</field>
|
|
<field name="res_model">stock.picking</field>
|
|
<field name="path">grnreceipts</field>
|
|
<field name="view_mode">list,kanban,form,calendar,activity</field>
|
|
<field name="domain">[('picking_type_id.code', '=', 'incoming')]</field>
|
|
<field name="context">{}</field>
|
|
</record>
|
|
<record model="ir.actions.act_window" id="location_open_quants_grn"> <!-- Used in location -->
|
|
<field name="context">{'search_default_productgroup': 1}</field>
|
|
<field name="domain">[('quantity','>',0),('location_id.usage', '=', 'internal')]</field>
|
|
<field name="name">Current Stock</field>
|
|
<field name="res_model">stock.quant</field>
|
|
<field name="view_id" ref="grn_stock_quant_view_list"/>
|
|
</record>
|
|
|
|
<!-- Menus -->
|
|
<menuitem name="GRN"
|
|
groups="stock.group_stock_manager,stock.group_stock_user"
|
|
web_icon="grn,static/description/icon.png"
|
|
id="grn_menu_root"/>
|
|
|
|
<menuitem name="GRN"
|
|
id="grn_menu"
|
|
parent="grn_menu_root"
|
|
sequence="1"
|
|
action="grn_action"/>
|
|
|
|
<menuitem id="grn_receipts"
|
|
name="Receipts"
|
|
parent="grn_menu_root"
|
|
action="action_picking_list_incoming"
|
|
sequence="2"
|
|
/>
|
|
<menuitem id="grn_raw_value"
|
|
name="Valuation"
|
|
parent="grn_menu_root"
|
|
action="location_open_quants_grn"
|
|
sequence="2"
|
|
/>
|
|
|
|
</odoo> |