Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2525 มุมมอง

Hi everyone i am using odoo 14 community version, How do i remove internal reference of product from bill of materials list view, for example now its coming [internal_ref]product name

i want to display only product name . i had used this free module in odoo hide https://apps.odoo.com/apps/modules/13.0/hide_internal_reference/
 it works in sales module , purchase and manufacturing but it doesn't hide in bom so tried using python side but it shows blank field in boms side , what should i do in my python code so it hide internal reference in bill of material list view

in python side

from odoo import models, fields, api


class CustomBomName(models.Model):
_inherit = 'mrp.bom'

custom_product_name = fields.Char(related='product_id.name')

in xml side 



model="ir.ui.view" id="view_bom_custom_name">
name="name">bom.custom.name.tree.inherit
name="model">mrp.bom
name="type">tree
name="inherit_id" ref="mrp.mrp_bom_tree_view"/>
name="arch" type="xml">
expr="/tree/field[@name='product_tmpl_id']" position="after">
name="custom_product_name"/>




what changes do i need to make to make it reflect in bill of material 

Thank you for your time

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Inherit the corresponding field(in xml) and pass display_default_code as False in the context.

Thanks

อวตาร
ละทิ้ง
ผู้เขียน

i have inherited the field in xml , how do i pass display_default_code as false can you give me an example please

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 22
3908
1
ม.ค. 22
2431
3
มิ.ย. 25
9279
1
ก.ย. 21
2218
0
มิ.ย. 21
2870