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

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>

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 24
1977
3
เม.ย. 22
4428
2
เม.ย. 20
4956
1
ต.ค. 20
4352
1
ต.ค. 24
2153