Package: odoo10-addon-barcodes-search
This module expends Odoo functionality, allowing user to search any item by
its barcode.Table of contentsUsageDevelopmentBug TrackerCreditsAuthorsContributorsMaintainersUsageIn the main menu click on the barcode new buttonIn the pop up form, enter the barcode and click on the search buttonCase 1: One item foundIf an item is found, the pop up is closed, and the form view of the item is
displayed. (Demo data with0419100000009to search a partner)Case 2: Many items foundIf many items are found, the list of the items are displayed and the user
can go on the according form view by clicking on the button on the end of
the line. This case can occur:in a normal case, if a barcode is associated to many models. Two typical
cases are : product.product / product.template and res.users / res.partner.
(Demo data with3057068106783to search a product)if the database is corrupted, and a barcode is set to many differents
items.Case 3: Barcode with specific ruleIn some specifics cases when the barcode contains extra data (like price
or weight), the barcode will be different than the product barcode.
In that case, the item is displayed, and the data is analysed.Exemple : Barcode2391000005002when:23is a prefix91000is a base code of the product00500is the price2is a control digitIf this barcode is entered, the product with the barcode2391000000007will
be returned.DevelopmentUse in other modulesThe search will be done on all the fields namedbarcodein any models.For developers, there are one handy method inbarcode.searchas well:result=self.env['barcode.search'].search_by_barcode('12345567890123')@api.modeldefsearch_by_barcode(self,barcode):"""Return the record associated with the barcode.

    Args:
        barcode (str): Barcode string to search for.

    Returns: a tuple (Field, BaseModel, ExtraData)
        Field: a record of the field that matched the search
        BaseModel: A record matching the barcode, if existing
        ExtraData: An optional dictionnary that provides extra informations
    """InheritanceIf you want to make a search on a field that is not named ‘barcode’, you
should overload the functionget_barcode_fieldsof the modelbarcode.search.If you want to implement another integration of extra data in a barcode
via a rule, you should overload the functionget_model_by_rule_typeof the modelbarcode.search.For the time being, three rule types are handled:weight, defined in Odoostockmoduleprice, defined in Odoopoint_of_salemoduleprice_to_weight, defined in OCApos_price_to weightmoduleBug TrackerBugs are tracked onGitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomedfeedback.Do not contact contributors directly about support or help with technical issues.CreditsAuthorsGRAPContributorsSylvain LE GAL <https://twitter.com/legalsylvain>MaintainersThis module is maintained by the OCA.OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.This module is part of theOCA/stock-logistics-barcodeproject on GitHub.You are welcome to contribute. To learn how please visithttps://odoo-community.org/page/Contribute.