19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:07 +01:00
parent ba20ce7443
commit 768b70e05e
2357 changed files with 1057103 additions and 712486 deletions

View file

@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<odoo>
<record id="view_account_form" model="ir.ui.view">
<field name="name">account.account.form</field>
<field name="model">account.account</field>
<field name="inherit_id" ref="account.view_account_form"/>
<field name="arch" type="xml">
<field name="tag_ids" position="after">
<field name="account_stock_variation_id" invisible="account_type != 'asset_current'"/>
<field name="account_stock_expense_id" invisible="account_type != 'asset_current'" placeholder="For Perpetual Continental Only" groups="base.group_no_one"/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_value_form_view" model="ir.ui.view">
<field name="name">product.value.form.view</field>
<field name="model">product.value</field>
<field name="arch" type="xml">
<form string="Adjust Valuation">
<sheet>
<field name="move_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<group>
<group>
<label for="current_value" class="oe_inline"/>
<div class="oe_inline">
<field name="current_value" style="width: 100px;" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<span><field name="current_value_details" class="oe_inline me-5"/></span>
</div>
<field name="value" string="New Value" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<field name="description"/>
</group>
<group>
<field class="alert alert-info" role="alert" name="current_value_description" nolabel="1" colspan="2"/>
<field class="alert alert-info" role="alert" name="computed_value_description" nolabel="1" colspan="2" invisible="not computed_value_description"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="product_value_action" model="ir.actions.act_window">
<field name="name">Adjust Valuation</field>
<field name="res_model">product.value</field>
<field name="view_mode">form</field>
</record>
</odoo>

View file

@ -2,7 +2,7 @@
<odoo>
<data>
<record id="product_template_tree_view" model="ir.ui.view">
<field name="name">product.template.tree.inherit.stock.account</field>
<field name="name">product.template.list.inherit.stock.account</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
@ -19,7 +19,7 @@
<field name="arch" type="xml">
<group name="logistics" position="after">
<group string="Inventory Valuation">
<field name="property_cost_method"/>
<field name="property_cost_method" required="True"/>
<field name="property_valuation" groups="account.group_account_readonly,stock.group_stock_manager"/>
</group>
</group>
@ -31,36 +31,73 @@
<field name="model">product.category</field>
<field name="inherit_id" ref="account.view_category_property_form"/>
<field name="arch" type="xml">
<group name="account_property" position="inside">
<group name="account_stock_property" string="Account Stock Properties" groups="account.group_account_readonly" attrs="{'invisible':[('property_valuation', '=', 'manual_periodic')]}">
<field name="property_valuation" invisible="1"/>
<field name="property_stock_valuation_account_id" options="{'no_create': True}" attrs="{'required':[('property_valuation', '=', 'real_time')]}"/>
<field name="property_stock_journal" attrs="{'required':[('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_account_input_categ_id" options="{'no_create': True}" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_account_output_categ_id" options="{'no_create': True}" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<div colspan="2" class="alert alert-info mt16" role="status">
<b>Set other input/output accounts on specific </b><button name="%(stock.action_prod_inv_location_form)d" role="button" type="action" class="btn-link" style="padding: 0;vertical-align: baseline;" string="locations"/>.
</div>
</group>
</group>
<field name="property_account_expense_categ_id" position="after">
<field name="property_stock_valuation_account_id" string="Stock Account" options="{'no_create': True}"/>
<field name="account_stock_variation_id" string="Stock Variation" options="{'no_create': True}"/>
<field name="property_price_difference_account_id" options="{'no_create': True}" invisible="not (property_cost_method == 'standard' and property_valuation == 'real_time')"/>
</field>
</field>
</record>
<!-- Stock Report View -->
<record model="ir.ui.view" id="view_template_property_form_stock_account">
<field name="name">view.template.property.form.stock.account</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='serial_prefix_format']" position="before">
<field name="lot_valuated" widget="confirm_boolean" invisible="tracking == 'none'"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="product_product_stock_tree_inherit_stock_account">
<field name="name">product.product.stock.tree.inherit.stock.account</field>
<field name="name">product.product.stock.list.inherit.stock.account</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.product_product_stock_tree"/>
<field name="arch" type="xml">
<field name="qty_available" position="before">
<field name="company_currency_id" invisible="1"/>
<field name="cost_method" invisible="1"/>
<field name="avg_cost" string="Unit Cost" optional="show" widget='monetary' options="{'currency_field': 'company_currency_id'}"/>
<field name="total_value" string="Total Value" optional="show" widget='monetary' options="{'currency_field': 'company_currency_id'}" sum="Total Value"/>
<button name="%(stock_valuation_layer_action)d" title="Valuation Report" type="action" class="btn-link"
icon="fa-bar-chart" context="{'search_default_product_id': id, 'default_product_id': id}" attrs="{'invisible': [('cost_method', '!=', 'average')]}"/>
<button name="%(stock_valuation_layer_report_action)d" title="Valuation Report" type="action" class="btn-link"
icon="fa-bar-chart" context="{'search_default_product_id': id, 'default_product_id': id}" attrs="{'invisible': [('cost_method', '!=', 'fifo')]}"/>
<field name="company_currency_id" column_invisible="True"/>
<field name="cost_method" optional="hide"/>
<field name="avg_cost"
string="Unit Cost" optional="show" widget='stock_action_field'
options="{
'currency_field': 'company_currency_id',
'action_name': 'stock_account.stock_avco_report_action',
'disabled': 'cost_method == \'fifo\'',
}" context="{
'active_id': id,
'cost_method': cost_method,
}"/>
<field
name="total_value" string="Total Value" optional="show"
widget='stock_action_field' options="{
'currency_field': 'company_currency_id',
'action_name': 'stock_account.stock_move_valuation_action',
}" context=" {
'search_default_product_id': id,
'search_default_incoming': 1,
'search_default_remaining': 1,
'cost_method': cost_method,
'tracking': tracking,
}"
sum="Total Value"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="product_product_view_list_at_date">
<field name="name">product.product.list.inherit.stock.account.at.date</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.view_stock_product_tree"/>
<field name="arch" type="xml">
<field name="standard_price" position="after">
<field name="avg_cost" string="Unit Cost" optional="hide" options="{
'currency_field': 'company_currency_id',
}"/>
<field name="total_value" string="Total Value" optional="hide" options="{
'currency_field': 'company_currency_id',
}"/>
</field>
</field>
</record>

View file

@ -1,33 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="stock_account_report_invoice_document" inherit_id="account.report_invoice_document">
<xpath expr="//div[@id='total']" position="after">
<xpath expr="//div[@id='right-elements']" position="after">
<t groups="stock_account.group_lot_on_invoice">
<t t-set="lot_values" t-value="o._get_invoiced_lot_values()"/>
<t t-if="lot_values">
<br/>
<table class="table table-sm" style="width: 50%;" name="invoice_snln_table">
<thead>
<tr>
<th><span>Product</span></th>
<th class="text-end"><span>Quantity</span></th>
<th class="text-end"><span>SN/LN</span></th>
</tr>
</thead>
<tbody>
<t t-foreach="lot_values" t-as="snln_line">
<tr>
<td><t t-esc="snln_line['product_name']"/></td>
<td class="text-end">
<t t-esc="snln_line['quantity']"/>
<t t-esc="snln_line['uom_name']" groups="uom.group_uom"/>
</td>
<td class="text-end"><t t-esc="snln_line['lot_name']"/></td>
</tr>
</t>
</tbody>
</table>
</t>
<div t-if="not lot_values" class="oe_structure">&#8203;</div>
<table t-else="" class="table table-sm mt-2" style="width: 50%;" name="invoice_snln_table">
<thead>
<tr>
<th><span>Product</span></th>
<th class="text-end"><span>Quantity</span></th>
<th class="text-end"><span>SN/LN</span></th>
</tr>
</thead>
<tbody>
<tr t-foreach="lot_values" t-as="snln_line">
<td><t t-esc="snln_line['product_name']">Bacon</t></td>
<td class="text-end">
<t t-esc="snln_line['quantity']">6.00</t>
<t t-esc="snln_line['uom_name']" groups="uom.group_uom">units</t>
</td>
<td><t class="text-end" t-esc="snln_line['lot_name']">BC46282798</t></td>
</tr>
</tbody>
</table>
</t>
</xpath>
</template>

View file

@ -6,39 +6,19 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
<field name="arch" type="xml">
<div id="production_lot_info" position="after">
<h2>Valuation</h2>
<div class="row mt16 o_settings_container" name="valuation_setting_container">
<div class="col-12 col-lg-6 o_setting_box"
id="additional_cost_setting"
title="Affect landed costs on reception operations and split them among products to update their cost price.">
<div class="o_setting_left_pane">
<field name="module_stock_landed_costs"/>
<block id="production_lot_info" position="after">
<block title="Valuation" name="valuation_setting_container">
<setting id="additional_cost_setting" title="Affect landed costs on reception operations and split them among products to update their cost price." documentation="/applications/inventory_and_mrp/inventory/management/reporting/integrating_landed_costs.html" help="Add additional cost (transport, customs, ...) in the value of the product.">
<field name="module_stock_landed_costs"/>
<div class="content-group">
<div name="landed_cost_info"/>
</div>
<div class="o_setting_right_pane">
<label for="module_stock_landed_costs"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/inventory/management/reporting/integrating_landed_costs.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Add additional cost (transport, customs, ...) in the value of the product.
</div>
<div class="content-group">
<div name="landed_cost_info"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" attrs="{'invisible': [('group_stock_production_lot', '=', False)]}" id="group_lot_on_invoice">
<div class="o_setting_left_pane">
<field name="group_lot_on_invoice"/>
</div>
<div class="o_setting_right_pane">
<label for="group_lot_on_invoice"/>
<div class="text-muted">
Lots &amp; Serial numbers will appear on the invoice
</div>
</div>
</div>
</div>
</div>
</setting>
<setting invisible="not group_stock_production_lot" id="group_lot_on_invoice" help="Lots &amp; Serial numbers will appear on the invoice">
<field name="group_lot_on_invoice"/>
</setting>
</block>
</block>
</field>
</record>
</data>

View file

@ -1,53 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_move_form_inherit" model="ir.ui.view">
<field name="name">stock.move.form.inherit</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside" >
<button name="action_get_account_moves" icon="fa-usd" class="oe_stat_button" string="Accounting Entries" type="object" groups="account.group_account_readonly"/>
</xpath>
</field>
</record>
<record id="view_stock_quant_tree_inventory_editable_inherit_stock_account" model="ir.ui.view">
<field name="name">stock.quant.inventory.tree.editable.inherit.stock.account</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_id']" position="after">
<field name="accounting_date" optional="hide"/>
</xpath>
</field>
</record>
<record id="view_location_form_inherit" model="ir.ui.view">
<field name="name">stock.location.form.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='additional_info']" position="after">
<group string="Accounting Information" attrs="{'invisible':[('usage','not in',('inventory','production'))]}">
<field name="valuation_in_account_id" options="{'no_create': True}"/>
<field name="valuation_out_account_id" options="{'no_create': True}"/>
</group>
</xpath>
</field>
</record>
<record id="view_stock_return_picking_form_inherit_stock_account" model="ir.ui.view">
<field name="name">stock.return.picking.stock.account.form</field>
<field name="inherit_id" ref="stock.view_stock_return_picking_form"/>
<field name="model">stock.return.picking</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_return_moves']/tree" position="inside">
<field name="to_refund" groups="base.group_no_one"/>
<xpath expr="//field[@name='product_return_moves']/list" position="inside">
<field name="to_refund" groups="base.group_no_one" optional="hide"/>
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_location_form_inherit" model="ir.ui.view">
<field name="name">stock.location.form.inherit</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='additional_info']" position="after">
<div>
<group string="Accounting Information" invisible="usage not in ('inventory', 'production')">
<label for="valuation_account_id" string="Cost of Production" invisible="usage != 'production'"/>
<label for="valuation_account_id" string="Loss Account" invisible="usage != 'inventory'"/>
<field name="valuation_account_id" nolabel="1" options="{'no_create': True}"/>
</group>
</div>
</xpath>
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_production_lot_form_stock_account" model="ir.ui.view">
<field name="name">view.production.lot.form.stock.account</field>
<field name="model">stock.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="arch" type="xml">
<group name="inventory_group" position="inside">
<field name="company_currency_id" invisible="1"/>
<field name="total_value" widget="monetary" invisible="not lot_valuated"
options="{'currency_field': 'company_currency_id'}"/>
<field name="avg_cost" widget="monetary" invisible="not lot_valuated"
options="{'currency_field': 'company_currency_id'}"/>
<field name="standard_price" widget="monetary" invisible="not lot_valuated"
options="{'currency_field': 'company_currency_id'}"/>
</group>
</field>
</record>
</data>
</odoo>

View file

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="stock_move_view_list">
<field name="name">stock.move.view.list.inherit.stock.account</field>
<field name="inherit_id" ref="stock.view_move_tree"/>
<field name="model">stock.move</field>
<field name="arch" type="xml">
<field name="state" position="after">
<field name="value" optional="hide"/>
<field name="remaining_qty" optional="hide"/>
<field name="remaining_value" optional="hide"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_move_search">
<field name="name">stock.move.search.inherit.stock.account</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_search"/>
<field name="arch" type="xml">
<filter name="inventory" position="after">
<separator/>
<filter name="remaining" string="Remaining" domain="[('remaining_qty', '=', True)]"/>
</filter>
</field>
</record>
<record model="ir.ui.view" id="stock_move_view_list_valuation">
<field name="name">stock.move.view.list.valuation</field>
<field name="model">stock.move</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<list default_order="date desc, id desc">
<field name="company_currency_id" column_invisible="1"/>
<field name="reference" width="300px"/>
<field name="date"/>
<field name="quantity"/>
<field name="product_uom" groups="uom.group_uom"/>
<field name="lot_ids" widget="many2many_tags" column_invisible="context.get('tracking') == 'none'"/>
<field name="value" widget="monetary" options="{'currency_field': 'company_currency_id'}" column_invisible="context.get('cost_method') != 'fifo'"/>
<field name="standard_price" widget="monetary" options="{'currency_field': 'company_currency_id'}" string="Unit Cost" column_invisible="context.get('cost_method') == 'fifo'"/>
<field name="remaining_qty" sum="Total Remaining Qty" width="200px"/>
<field name="remaining_value" widget="monetary" options="{'currency_field': 'company_currency_id'}" sum="Total Remaining Value" width="200px"/>
<field name="value_justification" column_invisible="context.get('cost_method') != 'fifo'" optional="hide"/>
</list>
</field>
</record>
<record model="ir.actions.act_window" id="stock_move_valuation_action">
<field name="name">Valuation</field>
<field name="res_model">stock.move</field>
<field name="view_mode">list</field>
<field name="domain">['|', ('is_in', '=', True), ('is_out', '=', True)]</field>
<field name="view_id" ref="stock_move_view_list_valuation"/>
</record>
<record model="ir.actions.server" id="stock_move_action_adjust_valuation">
<field name="name">Adjust Valuation</field>
<field name="model_id" ref="model_stock_move"/>
<field name="binding_model_id" ref="model_stock_move"/>
<field name="state">code</field>
<field name="code">
action = records.action_adjust_valuation()
</field>
</record>
</odoo>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_picking_form">
<field name="name">stock.account.view.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"></field>
<field name="arch" type="xml">
<xpath expr="//button[@name='%(stock.act_stock_return_picking)d']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
</field>
</record>
</odoo>

View file

@ -1,34 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_stock_quant_tree_inherit">
<field name="name">stock.quant.tree.inherit</field>
<field name="name">stock.quant.list.inherit</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree"></field>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_id']" position="after">
<field name="currency_id" invisible="1"/>
<field name="currency_id" column_invisible="True"/>
<field name="value" optional="hidden"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_stock_quant_tree_editable_inherit">
<field name="name">stock.quant.tree.editable.inherit</field>
<field name="name">stock.quant.list.editable.inherit</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_editable"></field>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_id']" position="after">
<field name="currency_id" invisible="1"/>
<field name="cost_method" invisible="1"/>
<field name="currency_id" column_invisible="True"/>
<field name="cost_method" column_invisible="True"/>
<field name="value" optional="hidden" sum="Total Value"/>
</xpath>
<xpath expr="//button[@name='action_view_orderpoints']" position="after">
<button name="%(stock_valuation_layer_report_action)d" title="Stock Valuation"
string="Valuation" type="action" class="btn-link" icon="fa-bar-chart"
context="{'search_default_product_id': product_id}"
attrs="{'invisible': [('cost_method', '!=', 'fifo')]}"/>
</xpath>
</field>
</record>
<record id="view_stock_quant_tree_inventory_editable_inherit_stock_account" model="ir.ui.view">
<field name="name">stock.quant.inventory.list.editable.inherit.stock.account</field>
<field name="model">stock.quant</field>
<field name="inherit_id" ref="stock.view_stock_quant_tree_inventory_editable"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_id']" position="after">
<field name="accounting_date" optional="hide"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -1,163 +0,0 @@
<odoo>
<record id="stock_valuation_layer_form" model="ir.ui.view">
<field name="name">stock.valuation.layer.form</field>
<field name="model">stock.valuation.layer</field>
<field name="arch" type="xml">
<form edit="0" create="0">
<sheet>
<group>
<group>
<field name="create_date" string="Date" />
<field name="product_id" />
<field name="stock_move_id" attrs="{'invisible': [('stock_move_id', '=', False)]}" />
</group>
</group>
<notebook>
<page string="Valuation" name="valuation">
<group>
<field name="quantity" />
<field name="uom_id" groups="uom.group_uom" />
<field name="currency_id" invisible="1" />
<field name="unit_cost" />
<field name="value" />
<field name="remaining_qty" />
</group>
</page>
<page string="Other Info" name="other_info">
<group>
<field name="description" />
<field name="account_move_id" groups="account.group_account_invoice" attrs="{'invisible': [('account_move_id', '=', False)]}" />
<field name="company_id" groups="base.group_multi_company" />
<field name="stock_valuation_layer_id" attrs="{'invisible': [('stock_valuation_layer_id', '=', False)]}" />
</group>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="stock_valuation_layer_tree" model="ir.ui.view">
<field name="name">stock.valuation.layer.tree</field>
<field name="model">stock.valuation.layer</field>
<field name="arch" type="xml">
<tree default_order="id desc" create="0"
import="0" js_class="inventory_report_list"
action="action_open_reference" type="object">
<field name="create_date" string="Date" />
<field name="reference"/>
<button name="action_open_layer" icon="fa-arrow-right" title="Open Valuation Layer" type="object"/>
<field name="product_id" />
<field name="company_id" groups="base.group_multi_company"/>
<field name="quantity" string="Moved Quantity"/>
<field name="unit_cost" />
<field name="uom_id" groups="uom.group_uom" />
<field name="currency_id" invisible="1" />
<field name="value" sum="Total Value"/>
<groupby name="product_id">
<field name="cost_method" invisible="1"/>
<field name="quantity_svl" invisible="1"/>
<button name="action_revaluation" icon="fa-plus" title="Add Manual Valuation" type="object" attrs="{'invisible':['|', ('cost_method', '=', 'standard'), ('quantity_svl', '&lt;=', 0)]}" />
</groupby>
</tree>
</field>
</record>
<record id="stock_valuation_layer_pivot" model="ir.ui.view">
<field name="name">stock.valuation.layer.pivot</field>
<field name="model">stock.valuation.layer</field>
<field name="arch" type="xml">
<pivot>
<field name="quantity" type="measure"/>
<field name="value" type="measure"/>
</pivot>
</field>
</record>
<record id="stock_valuation_layer_action" model="ir.actions.act_window">
<field name="name">Stock Valuation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.valuation.layer</field>
<field name="view_mode">tree,form,pivot</field>
<field name="view_id" ref="stock_valuation_layer_tree"/>
<field name="domain">[('product_id.type', '=', 'product')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face"/>
<p>
There are no valuation layers. Valuation layers are created when there are product moves that impact the valuation of the stock.
</p>
</field>
</record>
<record id="view_inventory_valuation_search" model="ir.ui.view">
<field name="name">Inventory Valuation</field>
<field name="model">stock.valuation.layer</field>
<field name="arch" type="xml">
<search string="Inventory Valuation">
<field name="product_id"/>
<field name="categ_id" />
<field name="product_tmpl_id" />
<separator/>
<filter string="Incoming" name="incoming" domain="[('stock_move_id.location_id.usage', 'not in', ('internal', 'transit')), ('stock_move_id.location_dest_id.usage', 'in', ('internal', 'transit'))]"/>
<filter string="Outgoing" name="outgoing" domain="[('stock_move_id.location_id.usage', 'in', ('internal', 'transit')), ('stock_move_id.location_dest_id.usage', 'not in', ('internal', 'transit'))]"/>
<separator/>
<filter string="Has Remaining Qty" name="has_remaining_qty" domain="[('remaining_qty', '>', 0)]"/>
<group expand='0' string='Group by...'>
<filter string='Product' name="group_by_product_id" context="{'group_by': 'product_id'}"/>
</group>
</search>
</field>
</record>
<!-- reporting view -->
<record id="stock_valuation_layer_report_tree" model="ir.ui.view">
<field name="name">stock.valuation.layer.report.tree</field>
<field name="model">stock.valuation.layer</field>
<field name="inherit_id" ref="stock_valuation_layer_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="quantity" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="unit_cost" position="after">
<field name="remaining_qty" sum="Total Remaining Quantity"/>
</field>
<field name="value" position="before">
<field name="remaining_value" sum="Total Remaining Value"/>
</field>
</field>
</record>
<record id="stock_valuation_layer_report_action" model="ir.actions.act_window">
<field name="name">Stock Valuation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.valuation.layer</field>
<field name="view_mode">tree,form,pivot</field>
<field name="view_id" ref="stock_valuation_layer_report_tree"/>
<field name="context">{'search_default_has_remaining_qty': 1}</field>
<field name="domain">[('product_id.type', '=', 'product')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face"/>
<p>
There are no valuation layers. Valuation layers are created when there are product moves that impact the valuation of the stock.
</p>
</field>
</record>
<menuitem id="menu_valuation" name="Valuation" parent="stock.menu_warehouse_report" sequence="250" action="stock_valuation_layer_action" groups="base.group_no_one"/>
<record id="stock_valuation_layer_picking" model="ir.ui.view">
<field name="name">stock.valuation.layer.picking</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button string="Valuation" type="object"
name="action_view_stock_valuation_layers"
class="oe_stat_button" icon="fa-dollar" groups="base.group_no_one"
attrs="{'invisible': [('state', 'not in', ['done'])]}" />
</xpath>
</field>
</record>
</odoo>