[IMP] product: cost price field place on form view

Since we need to set the cost price when reinvoicing
'at cost, the field should be displayed almost
everytime.

This commit is thus a partial undo of 6ba6ff8e8c
This commit is contained in:
jem-odoo
2018-01-29 17:16:27 +01:00
parent 6eed6a503b
commit 5b42cf64b3
3 changed files with 30 additions and 32 deletions
+4 -8
View File
@@ -48,6 +48,10 @@
</group>
<group name="group_standard_price">
<field name="list_price" string="Sales Price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<div name="standard_price_uom" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}">
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</div>
<field name="company_id" groups="base.group_multi_company"
options="{'no_create': True}"/>
<field name="uom_id" groups="product.group_uom" options="{'no_create': True}"/>
@@ -97,14 +101,6 @@
</group>
</page>
<page string="Inventory" name="inventory" groups="stock.group_stock_user,product.group_stock_packaging" attrs="{'invisible':[('type', '=', 'service')]}">
<group name="inventory">
<group string="Inventory Valuation" name="inventory_valuation">
<label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}"/>
<div name="standard_price_uom" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1)]}">
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
</div>
</group>
</group>
<group name="packaging" string="Packaging"
colspan="4"
attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1)]}"
+20 -20
View File
@@ -11,7 +11,7 @@
<group string="Logistics">
<field name="route_ids" widget="many2many_tags" groups="stock.group_adv_location"/>
<div colspan="2" attrs="{'invisible': [('parent_id', '=', False)]}">
The following routes will apply to the products in this category taking into account parent categories:
The following routes will apply to the products in this category taking into account parent categories:
<field name="total_route_ids" nolabel="1" widget="many2many_tags"/>
</div>
<field name="removal_strategy_id" options="{'no_create': True}"/>
@@ -83,25 +83,25 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<group name="inventory_valuation" position="before">
<group string="Operations" name="operations">
<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', '=', [])]}"/>
<label for="sale_delay"/>
<div>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
</div>
<xpath expr="//group[@name='packaging']" position="before">
<group name="inventory">
<group string="Operations" name="operations">
<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', '=', [])]}"/>
<label for="sale_delay"/>
<div>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
</div>
</group>
<group string="Traceability" name="traceability" groups="stock.group_production_lot">
<field name="tracking" widget="radio" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
</group>
<group string="Counterpart Locations" name="stock_property" groups="base.group_no_one">
<field name="property_stock_production" domain="[('usage','=','production')]"/>
<field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
</group>
</group>
<group string="Traceability" name="traceability" groups="stock.group_production_lot">
<field name="tracking" widget="radio" attrs="{'invisible':[('type', 'in', ['service', 'digital'])]}"/>
</group>
</group>
<group name="inventory_valuation" position="after">
<group string="Counterpart Locations" name="stock_property" groups="base.group_no_one">
<field name="property_stock_production" domain="[('usage','=','production')]"/>
<field name="property_stock_inventory" domain="[('usage','=','inventory')]"/>
</group>
</group>
</xpath>
<page name="inventory" position="inside">
<group string="Description for Delivery Orders">
<field name="description_pickingout" nolabel="1" placeholder="This note will show up on delivery orders."/>
@@ -227,7 +227,7 @@
</data>
</field>
</record>
<!-- view used for product.template only -->
<record model="ir.ui.view" id="product_template_form_view_procurement_button">
<field name="name">product.template_procurement</field>
@@ -6,10 +6,12 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="purchase.view_product_supplier_inherit"/>
<field name="arch" type="xml">
<group name="inventory_valuation" position="inside">
<field name="landed_cost_ok" class="oe_inline" attrs="{'invisible':[('type', 'not in', ['product', 'consu', 'service'])]}"/>
<field name="split_method" attrs="{'invisible':['|', ('landed_cost_ok', '=' ,False), ('type', 'not in', ['product', 'consu', 'service'])]}"/>
</group>
<xpath expr="//group[@name='inventory']" position="inside">
<group string="Inventory Valuation" name="inventory_valuation">
<field name="landed_cost_ok" class="oe_inline" attrs="{'invisible':[('type', 'not in', ['product', 'consu', 'service'])]}"/>
<field name="split_method" attrs="{'invisible':['|', ('landed_cost_ok', '=' ,False), ('type', 'not in', ['product', 'consu', 'service'])]}"/>
</group>
</xpath>
</field>
</record>
</data>