跳至內容
選單
此問題已被標幟
2 回覆
3161 瀏覽次數

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)]"/>





頭像
捨棄
作者 最佳答案

..

頭像
捨棄
最佳答案

Hi, amina lifam,

Please find code in comment.

I hope this will help you. 

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

頭像
捨棄

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>

相關帖文 回覆 瀏覽次數 活動
0
1月 24
2085
3
4月 22
4513
2
4月 20
5027
1
10月 20
4405
1
10月 24
2253