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

Hi,


Inside of the Odoo 14 workorder tablet-view (black background when going to Manufacturing ->  Workcenter Overview -> Work Orders -> Open a workorder, there is a field where you have to enter a serial number for the component or by-product (center of the screen).


What I want to achieve here is that I want to set a no_create/no_create_edit etc. option on this field, but only when I'm picking a component (test_type = register_consumed_materials i believe). When registering a by-product (register_byproducts), I'm fine with the users creating a new serial number so perhaps I only want no_open.


How do I go about doing this? I've tried setting a t-if on an attribute field but to no success yet.


So it's the application Manufacturing, model mrp.workorder and view mrp_workorder_view_form_tablet. 

الصورة الرمزية
إهمال
أفضل إجابة

As a workaround you can add the field twice in the view and use domain to hide/show them so the first field will be invisible if  test_type != register_consumed_materials and you can set no_create and no_create_edit to False and add the same field and set invisible if  test_type != register_byproducts and set no_create and no_create_edit to True.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يونيو 22
2234
6
يناير 23
6258
0
سبتمبر 21
3634
1
يونيو 23
5393
0
يونيو 23
1754