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

When creating an order for a receipt, internal transfer, or delivery in the Inventory app, the system automatically assigns the 'Responsible' field in the 'Additional Info' tab to the user who creates the order. This can cause issues for warehouse operators that they use barcode app, as they are unable to view orders assigned to someone else. Is it possible to modify this automation so that the 'Responsible' field is left empty by default, allowing all operators to see and execute the orders?

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

Hi,

user_id = fields.Many2one(
'res.users', 'Responsible', tracking=True,
domain=lambda self: [('groups_id', 'in', self.env.ref('stock.group_stock_user').id)],
default=lambda self: self.env.user)
this is how the field is defined in the stock.picking model.Either you can override the field or just inherit the view and set its default attributes as False.
الصورة الرمزية
إهمال
أفضل إجابة

You could make an automated rule on creation to update the record. Settings > Technical > Automation rules

Model is transfer; Trigger after creation; Extra condition User is set

Action to do; update record; Update 'Responsible' to leave empty

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

Hi Jaideep,

Thanks for your response! I hadn’t considered trying an automation rule—great suggestion! However, I’ve noticed it doesn't seem to work with timing conditions like "after creation," which should be correct. It does work when I select "on save," but there's an issue. If I manually click the save button, I get an error. Oddly enough, it only works when I navigate away or go to another page, allowing the system to autosave the record.

Do you have any thoughts on why this might be happening?

Hi Iasonas,

On save would override the field in the event a user was indeed selected, so on create should be the appropriate condition I would believe. Am not sure why it doesn't work, unfortunately I didn't get to test it.

If you are using a test database it is likely scheduled actions are disabled it could be why the action isn't triggered.

الكاتب أفضل إجابة

Anyone know something about this topic?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 24
741
0
أغسطس 24
732
0
أغسطس 24
466
1
أغسطس 24
586
1
أغسطس 23
2500