Files
odoo_source/addons/stock/product_view.xml
T
qsm-odoo ccd50b7ecd [FIX] stock: nested statinfo values
Inside a statinfo context, the widget statinfo should not be used
(cause useless DOM depth + misalignements). Just change to integer
values.
2015-09-30 10:11:54 +02:00

334 lines
19 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_stock_product_tree" model="ir.ui.view">
<field name="name">product.stock.tree.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="decoration-danger">virtual_available&lt;0</attribute>
<attribute name="decoration-info">virtual_available&gt;=0 and state in ('draft', 'end', 'obsolete')</attribute>
</tree>
<field name="price" position="after">
<field name="qty_available"/>
<field name="virtual_available"/>
</field>
</field>
</record>
<record id="view_stock_product_template_tree" model="ir.ui.view">
<field name="name">product.template.stock.tree.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<tree position="attributes">
<attribute name="decoration-danger">virtual_available&lt;0</attribute>
<attribute name="decoration-info">virtual_available&gt;=0 and state in ('draft', 'end', 'obsolete')</attribute>
</tree>
<field name="uom_id" position="after">
<field name="qty_available"/>
<field name="virtual_available"/>
</field>
</field>
</record>
<record id="action_receive_move" model="ir.actions.act_window">
<field name="name">Receipts</field>
<field name="res_model">stock.move</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain" eval="[('picking_id.picking_type_id.code','=','incoming'), ('location_id.usage','!=','internal'), ('location_dest_id.usage', '=', 'internal')]"/>
<field name="view_id" ref="view_move_tree_receipt_picking"/>
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to register a receipt for this product.
</p><p>
Here you will find the history of all receipts related to
this product, as well as all future receipts you are waiting
from your suppliers.
</p>
</field>
</record>
<record id="action_deliver_move" model="ir.actions.act_window">
<field name="name">Deliveries</field>
<field name="res_model">stock.move</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_move_tree_receipt_picking"/>
<field name="domain" eval="[('picking_type_id.code','=','outgoing'), ('location_id.usage','=','internal'), ('location_dest_id.usage', '!=', 'internal')]"/>
<field name="context" eval="'{\'search_default_product_id\': [active_id]}'"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a delivery order for this product.
</p><p>
Here you will find the history of all past deliveries related to
this product, as well as all the products you must deliver to
customers.
</p>
</field>
</record>
<!-- Product Template -->
<record id="product_template_search_form_view_stock" model="ir.ui.view">
<field name="name">product.template.search.stock.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_search_view"/>
<field name="arch" type="xml">
<field name="pricelist_id" position="after">
<separator/>
<field name="location_id" widget="selection" context="{'location': self}"/>
<field name="warehouse_id" widget="selection" context="{'warehouse': self}"/>
<separator/>
<filter name="real_stock_available" string="Available Products" domain="[('qty_available','&gt;',0)]"/>
<filter name="real_stock_exhausted" string="Exhausted Stock" domain="[('qty_available','&lt;=',0)]"/>
<filter name="real_stock_negative" string="Negative Stock" domain="[('qty_available','&lt;',0)]"/>
</field>
</field>
</record>
<record id="view_template_property_form" model="ir.ui.view">
<field name="name">product.template.stock.property.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<div name="weight" position="after">
<field name="tracking" on_change="onchange_tracking(tracking)" widget="radio" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}" groups="stock.group_production_lot"/>
</div>
<field name="company_id" position="after">
<field name="route_ids" widget="many2many_checkboxes" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
<field name="route_from_categ_ids" widget="many2many_tags" readonly="1" attrs="{'invisible':[('route_from_categ_ids', '=', [])]}"/>
</field>
<group name="group_lots_and_weight" position="after">
<group name="stock_property" groups="base.group_no_one">
<field name="property_stock_procurement" domain="[('usage','=','procurement')]"/>
<field name="property_stock_production" domain="[('usage','=','production')]"/>
<field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
</group>
</group>
<field name="description_purchase" position="after">
<separator string="Description for Pickings" colspan="4"/>
<field name="description_picking" placeholder="Description for Pickings (Rack, Row and Case Information)" nolabel="1" colspan="4"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="product_template_kanban_stock_view">
<field name="name">Product Template Kanban Stock</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_kanban_view"/>
<field name="arch" type="xml">
<field name="lst_price" position="after">
<field name="type"/>
</field>
<ul position="inside">
<li t-if="record.type.raw_value == 'product'">On hand: <field name="qty_available"/> <field name="uom_id"/></li>
<li t-if="record.type.raw_value == 'product'">Forecasted: <field name="virtual_available"/> <field name="uom_id"/></li>
</ul>
</field>
</record>
<!-- Product Variant -->
<record id="product_search_form_view_stock" model="ir.ui.view">
<field name="name">product.search.stock.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<field name="pricelist_id" position="before">
<field name="location_id" widget="selection" context="{'location': self}"/>
<field name="warehouse_id" widget="selection" context="{'warehouse': self}"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="product_kanban_stock_view">
<field name="name">Product Kanban Stock</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_kanban_view"/>
<field name="arch" type="xml">
<field name="lst_price" position="after">
<field name="reception_count"/>
<field name="delivery_count"/>
</field>
<xpath expr="//div[@name='tags']" position="inside">
<a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value&gt;1">
<t t-esc="record.reception_count.value"/> Receipts
</a>
<a name="%(action_receive_move)d" type="action" t-if="record.reception_count.raw_value==1">
<t t-esc="record.reception_count.value"/> Receipt
</a>
<a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value&gt;1">
<t t-esc="record.delivery_count.value"/> Deliveries
</a>
<a name="%(action_deliver_move)d" type="action" t-if="record.delivery_count.raw_value==1">
<t t-esc="record.delivery_count.value"/> Delivery
</a>
</xpath>
</field>
</record>
<record id="product_product_view_form_easy_inherit_stock" model="ir.ui.view">
<field name="name">product.product.view.form.easy.inherit.stock</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
<field name="arch" type="xml">
<sheet position="before">
<header>
<button name="%(action_view_change_product_quantity)d" string="Update Qty On Hand" type="action" attrs="{'invisible': [('type', '!=', 'product')]}"/>
<button string="Procurement Request" name="%(stock.act_make_procurement)d" type="action" attrs="{'invisible': [('type', '!=', 'product')]}"/>
</header>
</sheet>
</field>
</record>
<record model="ir.ui.view" id="product_form_view_procurement_button">
<field name="name">product.product.procurement</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<data>
<header position="inside">
<button string="Update Qty On Hand"
type="action"
name="%(action_view_change_product_quantity)d"
attrs="{'invisible': [('type', '!=', 'product')]}"/>
<button string="Procurement Request"
type="action"
name="%(stock.act_make_procurement)d"
attrs="{'invisible': [('type', '!=', 'product')]}"/>
</header>
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="%(product_open_quants)d"
icon="fa-building-o"
type="action" attrs="{'invisible':[('type', '!=', 'product')]}">
<field name="qty_available" widget="statinfo" string="On Hand"/>
</button>
<button type="action"
name="%(stock.action_stock_level_forecast_report_product)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o">
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="virtual_available" widget="statinfo" nolabel="1"/>
<span attrs="{'invisible':[('outgoing_qty', '=', 0),('incoming_qty','=',0)]}">
(-<field name="outgoing_qty" widget="statinfo" nolabel="1"/>
+<field name="incoming_qty" widget="statinfo" nolabel="1"/>)
</span>
</span>
<span class="o_stat_text">Forecasted</span>
</div>
</button>
<button string="Traceability"
type="action"
name= "%(act_product_stock_move_open)d"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-arrows-v"
groups="stock.group_stock_user"/>
<button type="action"
name="%(product_open_orderpoint)d"
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<field name="nbr_reordering_rules" widget="statinfo"/>
</button>
<button name="%(product_open_orderpoint)d" type="action"
attrs="{'invisible':['|',('type', '!=', ['product', 'consu']),('nbr_reordering_rules', '!=', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<div class="o_form_field o_stat_info mr4">
<span class="o_stat_text">Min :</span>
<span class="o_stat_text">Max:</span>
</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="reordering_min_qty"/></span>
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
<button string="Routes" type="object"
name="action_view_routes"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-cogs" groups="stock.group_adv_location"/>
</div>
</data>
</field>
</record>
<record model="ir.ui.view" id="product_template_form_view_procurement_button">
<field name="name">product.template_procurement</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<data>
<header position="inside" >
<button name="%(action_view_change_product_quantity)d" string="Update Qty On Hand" type="action" attrs="{'invisible': [('type', '!=', 'product')]}"/>
<button string="Procurement Request" name="%(stock.act_make_procurement)d" type="action" attrs="{'invisible': [('type', '!=', 'product')]}"/>
</header>
<div name="button_box" position="inside">
<button type="object"
name="action_open_quants"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o">
<field name="qty_available" widget="statinfo" string="On Hand"/>
</button>
<button type="action"
name="%(stock.action_stock_level_forecast_report_template)d"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-building-o">
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="virtual_available" widget="integer"/>
<span attrs="{'invisible':[('outgoing_qty', '=', 0),('incoming_qty','=',0)]}" groups="base.group_no_one">
(-<field name="outgoing_qty" widget="integer"/>+<field name="incoming_qty" widget="integer"/>)
</span>
</span>
<span class="o_stat_text">Forecasted</span>
</div>
</button>
<button string="Traceability" type="object"
name= "action_view_stock_moves"
attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}"
class="oe_stat_button" icon="fa-arrows-v"
groups="stock.group_stock_user"/>
<button type="object"
name="action_view_orderpoints"
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '==', 1)]}"
class="oe_stat_button"
icon="fa-refresh">
<field name="nbr_reordering_rules" widget="statinfo"/>
</button>
<button type="object"
name="action_view_orderpoints"
attrs="{'invisible':['|',('type', '!=', 'product'),('nbr_reordering_rules', '!=', 1)]}"
class="oe_stat_button" icon="fa-refresh">
<div class="o_form_field o_stat_info mr4">
<span class="o_stat_text">Min:</span>
<span class="o_stat_text">Max:</span>
</div>
<div class="o_form_field o_stat_info">
<span class="o_stat_value"><field name="reordering_min_qty"/></span>
<span class="o_stat_value"><field name="reordering_max_qty"/></span>
</div>
</button>
<button string="Routes" type="object"
name="action_view_routes"
attrs="{'invisible':[('type', '!=', 'product')]}"
class="oe_stat_button" icon="fa-cogs"
groups="stock.group_adv_location"/>
</div>
<group name="sale_condition" position="inside">
<label for="sale_delay"/>
<div>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
</div>
</group>
</data>
</field>
</record>
</data>
</openerp>