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

Hi everyone,

I’m working with Zebra scanners using Odoo’s Barcode app for Manufacturing. When we scan a Manufacturing Order (MO), it automatically filters to that single MO — so we get a chip like “Manufacturing Order = WH/MO/06299.”

That part works fine. But we often have Sales Orders that generate several MOs (one per line), and they all share the same “Source” (Origin) value. What we’d like to do is:

When we scan any one of those MOs (or a barcode representing the Sales Order itself), have the Barcode app show all MOs with the same Origin.

Right now the Barcode view only filters on name (the MO reference). Manually typing the Origin into the “Source” filter works, but scanning doesn’t trigger that filter automatically.

My idea was to extend the barcode search domain for mrp.production to something like:

['|', ('name', '=', barcode), ('origin', '=', barcode)]

That way scanning either the MO barcode or the Origin barcode would pull up all related MOs.

Has anyone implemented something similar?

Is there a recommended way to override the search domain used by the Barcode app (without breaking future updates)?

Also, if you know of an existing community module that already adds this kind of functionality, please point me in the right direction.

We’re on Odoo 18(Enterprise), using the default Manufacturing and Barcode apps.

Thanks in advance — any tips or clean examples would be appreciated.

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

Hi

Currently, in Odoo’s Barcode app for Manufacturing, scanning a Manufacturing Order (MO) barcode only filters that specific MO. To display all MOs sharing the same Sales Order origin, we can extend the barcode search domain.


The solution is to override the _barcode_search_domain method in mrp.production as follows:


from odoo import models


class MrpProduction(models.Model):

    _inherit = 'mrp.production'


    def _barcode_search_domain(self, barcode):

        return ['|', ('name', '=', barcode), ('origin', '=', barcode)]


With this change, scanning either the MO barcode or the related Sales Order barcode will show all MOs linked to that origin, streamlining the workflow and reducing manual filtering.


Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 24
1243
1
مايو 24
2572
0
مارس 22
2899
0
يونيو 21
2481
0
مايو 20
4012