Skip to Content
Menu
This question has been flagged
1 Reply
3495 Views

I have created some field in stock.picking modules, and i have inherited the "stock.view_picking_form" form.

I tried to added new page inside the notebook.

But it's does not showing the String Name.

Below i have mention the my code for your reference.

Could you tell anyone what i did the mistake?



.py File


class StockPicking(models.Model):
    _inherit = 'stock.picking'

  
    lorry_details = fields.Char('Lorry Details')
    remarks = fields.Text('Remarks')
    lab_outturn = fields.Float('Lab Outturn')
    headrice_outturn = fields.Float('Headrice Outturn')
    broken_outturn = fields.Float('Broken Outturn')
    estimated_cost = fields.Float('Estimated Cost - Rs.')
    pan_number = fields.Char('PAN Number')
    picking_type = fields.Selection(related="picking_type_id.code", string="Type")
   

.xml code

<notebook position="inside">
    <xpath expr="//form/sheet/notebook/page[1]" position="after">
        <page string="LabTest">
            <group>
                <group>
                    <label for="lab_outturn" attrs='{"readonly": [("state","=","done")]}'/>
                    <div class="o_row" name="lab_outturn">
                        <field name="lab_outturn" string="Lab Outturn" />
                        <span>%</span>
                    </div>
                </group>
                <group>
                    <label for="headrice_outturn" />
                    <div class="o_row" name="headrice_outturn" >
                        <field name="headrice_outturn" string="Headrice Outturn" attrs='{"readonly": [("state","=","done")]}'/>
                        <span>%</span>
                    </div>
                </group>
                <group>
                    <label for="broken_outturn" />
                    <div class="o_row" name="broken_outturn" >
                        <field name="broken_outturn" string="Broken Outturn"/>
                        <span>%</span>
                    </div>
                    <field name="estimated_cost"/>
                </group>
            </group>
        </page>
    </xpath>
</notebook>


Avatar
Discard
Best Answer

Hi, try this code in xml:

<record id="stock_picking_view_form_inherit1" model="ir.ui.view">
<field name="name">stock.picking.form.inherit1</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//form/sheet/notebook/page[1]" position="after">
<page string="LabTest">
<group>
<group>
<label for="lab_outturn" attrs='{"readonly": [("state","=","done")]}'/>
<div class="o_row" name="lab_outturn">
<field name="lab_outturn" string="Lab Outturn"/>
<span>%</span>
</div>
</group>
<group>
<label for="headrice_outturn"/>
<div class="o_row" name="headrice_outturn">
<field name="headrice_outturn" string="Headrice Outturn"
attrs='{"readonly": [("state","=","done")]}'/>
<span>%</span>
</div>
</group>
<group>
<label for="broken_outturn"/>
<div class="o_row" name="broken_outturn">
<field name="broken_outturn" string="Broken Outturn"/>
<span>%</span>
</div>
<field name="estimated_cost"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
Avatar
Discard
Related Posts Replies Views Activity
0
May 24
315
1
Mar 15
4191
0
Mar 15
2475
2
Nov 24
130
1
May 23
1105