تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1548 أدوات العرض

Hi everyone, 

I want to add a search in Product Variants list screen with a custom field, I am already added to the product.template model 


the field name is model_number

and I added with this code 


    class ProductCoNew(models.Model):
        _inherit = 'product.template'
    
        model_number = fields.Char(string='Model', required=True)


and this is my code to add the search 


   
        product.product_search_form_view
        product.product
       
       
           
               
                       domain="[('product_tmpl_id.model_number', 'ilike', self)]"/>
           
       
   


and 


    class ProductProduct(models.Model):
        _inherit = 'product.product'
    
        model_number_search = fields.Char(related='product_tmpl_id.model_number',
                                          string='DES 1', readonly=True, store=True)


but this code not working and giving me an error.


    Domain on non-relational field "model_number_search" makes no sense (domain:[('product_tmpl_id.model_number', 'ilike', self)])


I do not know what is the problem, 

please can anyone help me, 


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
نوفمبر 24
1494
1
نوفمبر 24
1696
4
نوفمبر 23
3305
0
يونيو 22
2192
3
يوليو 25
11523