Files
odoo-usability/stock_usability/views/stock_move.xml
Alexis de Lattre 96bfda6e1b Add product_barcode in SO lines, PO lines, stock move lines and invoice lines with optional="hide"
Show warning about double VAT partner even when not in editable mode
2021-04-28 11:27:04 +02:00

102 lines
4.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014-2020 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- Display advanced fields in stock moves form view -->
<record id="view_move_form" model="ir.ui.view">
<field name="name">stock.usability.stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form" />
<field name="arch" type="xml">
<!--
<field name="state" position="before">
<button type="object" name="button_do_unreserve" string="Unreserve"
groups="stock.group_stock_user"
attrs="{'invisible': [('reserved_quant_ids', '=', [])]}"/>
</field> -->
<field name="origin" position="after">
<field name="picking_id" readonly="1" string="Picking"/>
<field name="inventory_id" readonly="1"/>
</field>
<group name="origin_grp" position="after">
<group name="advanced" string="Advanced" groups="stock.group_stock_manager">
<field name="warehouse_id" readonly="1"/>
<field name="route_ids" widget="many2many_tags" readonly="1"/>
<field name="rule_id" readonly="1"/>
<field name="propagate_cancel" readonly="1"/>
<field name="price_unit" readonly="1"/>
<field name="partner_id" readonly="1"/>
<field name="restrict_partner_id" readonly="1"/>
</group>
</group>
</field>
</record>
<!-- By default, stock.move have:
_order = 'sequence, id'
I don't know if they have a good reason to choose this order,
but, when you open tree view of move lines from product, you want
the most recent moves at the top, so we change the default
order in the tree view (lower impact than changing _order -->
<record id="view_move_tree" model="ir.ui.view">
<field name="name">stock_usability.move.tree.better.order</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_tree" />
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="default_order">date desc, picking_id, sequence</attribute>
</tree>
<field name="state" position="after">
<button type="object" name="button_do_unreserve" string="Unreserve"
groups="stock.group_stock_user"
states="partially_available,assigned"
icon="fa-ban"/>
</field>
<field name="product_id" position="after">
<field name="product_barcode" optional="hide"/>
</field>
</field>
</record>
<record id="view_move_line_tree" model="ir.ui.view">
<field name="name">stock_usability.stock.move.line.tree</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_move_line_tree" />
<field name="arch" type="xml">
<field name="qty_done" position="before">
<field name="product_qty" sum="1" string="Reserved Qty"/>
</field>
<field name="qty_done" position="attributes">
<attribute name="sum">1</attribute>
</field>
<field name="state" position="after">
<button type="object" name="button_do_unreserve" string="Unreserve"
groups="stock.group_stock_user"
states="partially_available,assigned"
icon="fa-ban"/>
</field>
<field name="product_id" position="after">
<field name="product_barcode" optional="hide"/>
</field>
</field>
</record>
<!-- View embedded in picking -->
<record id="view_stock_move_line_detailed_operation_tree" model="ir.ui.view">
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_detailed_operation_tree" />
<field name="arch" type="xml">
<field name="product_id" position="after">
<field name="product_barcode" optional="hide"/>
</field>
</field>
</record>
</odoo>