I'm adding a custom string field (stock_value) to the 'product.supplierinfo' module in Odoo enterprise 11 but I can't get it to display the label correctly.
I inherited the module and then added a new field to the module and to the view trough xpath.
Problem: the string related to the new field is not shown.
Module:
class class_name(models.Model):
_inherit = 'product.supplierinfo'
stock_value = fields.Integer(string="Stock")
View:
<!-- Stock value in the vendors -->
<record id="view_product_product_supplierinfo_form_view" model="ir.ui.view">
<field name="name">product.supplierinfo.product.form</field>
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='price']" position="after">
<field name="stock_value" />
</xpath>
</field>
</record>
Result: as you can see theres a zero bellow the price value but the string label 'Stock' is not shown.
Other thing is tried:
Adding the next code:
<separator />
<label for="stock_value" string="Stock Value"/>
Gives me
Putting the field inside a group gives me
I also tried changing the position to 'before' in this last view but I cannot manage to make it look as it should. I tried using @string but that no longer works.
Thank you in advantage for your help.