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

I am fairly new to the community, so I am still learning to get around here.

My question for today is in regards to a field that does not give me an option to sort it or filter by it. The name of the field is components_availability.  It is in the model mrp.production.  Context = {}.​​

Modifiers = {"invisible":[("state","not in", ["confirmed","rogress"]]],"readonly":true} 

I am trying to add a filter to the Search form that will give me Manufacturing Orders only in components_availability status of Available. 

Below is one of the code snippets I tried. But it (and my other attempts) returned no Manufacturing Orders. 

NOTE: As stated above, I am fairly new to the community. I am unsure how to share code since I do not have enough Karma yet, but i am trying different methods..

Due to this form interpreting some characters as commands, I dropped the first "less than" character.  The next to last character of ? was used to replace a forward slash.  I also had to break it up into separate lines. I hope you can make sense of it.

filter string= "Component Status: 

Available" name="filter_components_availability" 

domain="[('state', '=', ('available'))]"?>

الصورة الرمزية
إهمال
الكاتب

@Chris TRINGHAM.
Thank you so much!!!
Your suggestion worked perfectly.

أفضل إجابة

I haven't fully tested this concept, but maybe you can try it.

1. Create a new boolean computed field to indicate whether the MO is Ready:

for record in self:
  record['x_studio_ready'] = False
  if record.reservation_state != 'confirmed' and record.components_availability_state  == 'available':
    record['x_studio_ready'] = True

You can change the logic in the Python code

2. Then it's easy to filter on this Boolean. 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
نوفمبر 15
6675
1
يوليو 25
554
Search a message تم الحل
1
فبراير 25
1253
0
سبتمبر 23
2222
2
يونيو 23
4042