Skip to Content
Menu
This question has been flagged
2 Replies
1950 Views

hey, i'm using odoov14 , i wanted to make order line field of purchase order visible in search view.

here my python code.

from odoo import models, fields, api


class CustomPurchaseReportFields(models.Model):
_inherit = 'purchase.order.line'

in xml

xml version="1.0" encoding="UTF-8" ?>



id="purchase_order_view_search" model="ir.ui.view">
name="name">purchase.order.view.search
name="model">purchase.order
name="inherit_id" ref="purchase.view_purchase_order_filter"/>
name="arch" type="xml">
name="name" position="after">
name="order_line" string="AWB No"
filter_domain="[('order_line.awb_no.name','ilike',self)]"/>





Avatar
Discard
Author Best Answer

..

Avatar
Discard
Best Answer

Hi, amina lifam,

Please find code in comment.

I hope this will help you. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

You can used bellow example..

class CustomPurchaseReportFields(models.Model):
_inherit = 'purchase.order.line'

catg_id = field.Many2one('product.category', string="Category")

<record id="purchase_order_view_search" model="ir.ui.view">
<field name="name">purchase.order.rfq.search</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="order_line" string="Category" filter_domain="[
('order_line.catg_id', 'ilike', self)]"
/>
</xpath>
</field>
</record>

Related Posts Replies Views Activity
0
Jan 24
839
3
Apr 22
3456
2
Apr 20
4087
1
Oct 20
3344
1
Oct 24
543