flectra/addons/stock_account/views/product_views.xml

107 lines
6.2 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
2018-01-16 11:34:37 +01:00
<flectra>
<data>
<record id="view_category_property_form" model="ir.ui.view">
<field name="name">product.category.stock.property.form.inherit</field>
<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_user">
<field name="property_stock_account_input_categ_id" domain="[('deprecated', '=', False)]" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_account_output_categ_id" domain="[('deprecated', '=', False)]" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}" />
<field name="property_stock_valuation_account_id" domain="[('deprecated', '=', False)]" attrs="{'required':[ ('property_valuation', '=', 'real_time')]}"/>
<field name="property_stock_journal"/>
</group>
</group>
<group name="account_property" position="before">
<group>
<group string="Inventory Valuation">
<field name="property_cost_method"/>
<field name="property_valuation" groups="account.group_account_user"/>
</group>
</group>
</group>
</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">
<data>
<field name="list_price" position="after">
<field name="valuation" invisible="1" readonly="1"/>
<field name="cost_method" invisible="1" readonly="1"/>
<field name="property_cost_method" invisible="1"/>
</field>
<field name="standard_price" position="replace">
<div class="o_row">
<field name="standard_price"
attrs="{'readonly':[('valuation','=','real_time')]}"
widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}" />
<button string="Update Cost" type="action"
name="%(action_view_change_standard_price)d"
attrs="{'invisible':['|', '|', ('valuation','!=', 'real_time'), ('cost_method', 'not in', ['average', 'standard']), ('product_variant_count', '>', 1)]}"
class="oe_link oe_read_only" colspan="2"/>
</div>
</field>
<group name="accounting" position="inside">
<group name="property_inventory_valuation" string="Stock Valuation" attrs="{'invisible': ['|', ('type','=','service'), ('valuation', '!=', 'real_time')]}" groups="account.group_account_user">
<field name="property_valuation" invisible="1"/>
<field name="property_stock_account_input"
domain="[('deprecated', '=', False)]"/>
<field name="property_stock_account_output"
domain="[('deprecated', '=', False)]"/>
</group>
</group>
</data>
</field>
</record>
<record id="product_variant_easy_edit_view_inherit" model="ir.ui.view">
<field name="name">product.product.product.view.form.easy.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_variant_easy_edit_view"/>
<field name="arch" type="xml">
<data>
<field name="standard_price" position="after">
<field name="valuation" invisible="1"/>
<field name="cost_method" invisible="1"/>
</field>
<field name="standard_price" position="after">
<button string="Set standard cost" type="action"
name="%(action_view_change_standard_price)d"
attrs="{'invisible':['|',('valuation','!=', 'real_time'), ('cost_method', 'not in', ['standard'])]}"
class="oe_link oe_read_only" colspan="2"/>
</field>
<field name="standard_price" position="after">
<button string="Set standard cost" type="action"
name="%(action_view_change_standard_price)d"
attrs="{'invisible':['|',('valuation','!=', 'real_time'), ('cost_method', 'not in', ['average'])]}"
class="oe_link oe_read_only" colspan="2"/>
</field>
</data>
</field>
</record>
<record id="product_valuation_action" model="ir.actions.act_window">
<field name="name">Product Valuation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_stock_product_tree2"/>
<field name="domain">[('type', '=', 'product'), ('qty_available', '!=', 0)]</field>
<field name="context">{'company_owned': True}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
If there are products, you will see its name and valuation.
</p>
</field>
</record>
</data>
2018-01-16 11:34:37 +01:00
</flectra>