stock_readjust_valuation/views/stock_readjust_valuation_views.xml
2026-01-13 16:32:10 +07:00

98 lines
5.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Form View -->
<record id="view_stock_readjust_valuation_form" model="ir.ui.view">
<field name="name">stock.readjust.valuation.form</field>
<field name="model">stock.readjust.valuation</field>
<field name="arch" type="xml">
<form string="Stock Readjustment">
<header>
<button name="action_load_products" string="Load Products" type="object" class="oe_highlight" invisible="state != 'draft'"/>
<button name="action_calculate" string="Calculate" type="object" class="oe_highlight" invisible="state != 'draft'"/>
<button name="action_reset_to_draft" string="Reset to Draft" type="object" invisible="state != 'calculated'"/>
<button name="action_apply" string="Apply Readjustment" type="object" class="oe_highlight" invisible="state != 'calculated'"/>
<field name="state" widget="statusbar" statusbar_visible="draft,calculated,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_journal_entries" type="object" class="oe_stat_button" icon="fa-bars" invisible="account_move_count == 0">
<field name="account_move_count" widget="statinfo" string="Journal Entries"/>
</button>
</div>
<div class="oe_title">
<h1><field name="name"/></h1>
</div>
<group>
<group>
<field name="date_start" readonly="state != 'draft'"/>
<field name="date_end" readonly="state != 'draft'"/>
</group>
<group>
<field name="journal_id" readonly="state != 'draft'"/>
<field name="company_id" readonly="1"/>
</group>
</group>
<notebook>
<page string="Products">
<field name="line_ids" readonly="state == 'done'">
<tree editable="bottom" create="1" delete="1">
<field name="product_id" readonly="parent.state != 'draft'"/>
<field name="initial_qty"/>
<field name="qty_counted" decoration-info="qty_counted != initial_qty"/>
<field name="initial_value"/>
<field name="target_initial_value" decoration-info="target_initial_value != initial_value"/>
<field name="purchase_qty" optional="show"/>
<field name="purchase_value" optional="show"/>
<field name="new_average_cost" decoration-bf="1"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<!-- Tree View -->
<record id="view_stock_readjust_valuation_tree" model="ir.ui.view">
<field name="name">stock.readjust.valuation.tree</field>
<field name="model">stock.readjust.valuation</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="journal_id"/>
<field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'done'"/>
</tree>
</field>
</record>
<!-- Action -->
<record id="action_stock_readjust_valuation" model="ir.actions.act_window">
<field name="name">Stock Readjustment</field>
<field name="res_model">stock.readjust.valuation</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Menu -->
<menuitem id="menu_stock_readjust_valuation"
name="Stock Readjustment"
parent="stock.menu_stock_warehouse_mgmt"
action="action_stock_readjust_valuation"
sequence="110"/>
</data>
</odoo>