Hi,
I\ am\ using\ odoo14\.\ I\ want\ to\ hide\ a\ column\ in\ stock\.view_stock_move_line_operation_tree\.\ The\ field\ ,\ expected_serial_no,\ is\ added\ to\ the\ above\ tree\ view\.\ When\ the\ picking\ is\ for\ a\ Delivery\ Order,\ I\ want\ to\ hide\ expected_serial_no\.\ When\ it\ is\ a\ Receipt,\ I\ want\ to\ show\ it\.
Below\ is\ a\ snippet\ of\ my\ code\.\ No\ matter\ what\ I\ put\ for\ the\ attrs=\{'invisible':\.\.\.\},\ I\ cannot\ hide\ the\ expected_serial_no\ column\.\ Can\ you\ tell\ me\ what\ I\ did\ was\ wrong\ and\ how\ can\ I\ achieve\ what\ I\ want\ as\ stated\ above\.
Regards,
Simon\ Lee
class\ my_stock_move_line\(models\.Model\):
\ \ \ \ _name\ =\ 'stock\.move\.line'
\ \ \ \ _inherit\ =\ 'stock\.move\.line'
\ \ \ \
\ \ \ \ expected_serial_no\ =\ fields\.Char\(string='Exp\ Serial\ No',\ compute='_get_exp_serial_no'\)\ \
ir\.ui\.view"\ id="view_stock_move_line_operation_tree_inherited">
\ \ \ \ stock\.move\.line\.operations\.tree\.inherited
\ \ \ \ stock.move.line
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
2518
Tampilan
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
Custom Widget : Field invisible if empty
Diselesaikan
|
|
3
Des 16
|
8076 | |
|
1
Jun 17
|
6776 | ||
|
0
Mar 15
|
3926 |
Please post your XML code in comment.
<record model="ir.ui.view" id="view_stock_move_line_operation_tree_inherited">
<field name="name">stock.move.line.operations.tree.inherited</field>
<field name="model">stock.move.line</field>
<field name="inherit_id" ref="stock.view_stock_move_line_operation_tree"/>
<field name="priority" eval="15"/>
<field name="arch" type="xml">
<!-- Add the expected BBD column. -->
<xpath expr="//field[@name='product_uom_id']" position="after">
<field name="picking_code" invisible="1" />
<field name="expected_serial_no" attrs="{'invisible':[('picking_code', 'in', ('outgoing'))]}" />
</xpath>
</field>
</record>