=======================
Barcode action launcher
=======================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:87fc995f6dec3e033f207c35131f848aaf3987733def7d2e096696664e9c93df
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/17.0/barcode_action
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-barcode_action
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=17.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to use barcodes as launchers of actions.
The action will launch a function that uses the barcode in order to
return an action.
**Table of contents**
.. contents::
:local:
Usage
=====
Actions must be configured with the following data in the context: \*
model: Model where we can find the method (required) \* method: Method
to execute (required) \* res_id: Id as base (optional)
The method must return an action. Installing this module with demo data
will install a demo application that allows the system administrator to
find a partner by the external reference encoded in a barcode.
Go to *Settings / Find partners* and scan a barcode that contains the
internal reference of an existing partner. As soon as you read the
barcode the system will redirect you to that partner's form view.
Technical implementation of this example:
Action:
::
<act_window id="res_partner_find"
name="Find Partner"
res_model="barcode.action"
view_mode="form"
view_type="form"
context="{'default_model': 'res.partner', 'default_method': 'find_res_partner_by_ref_using_barcode'}"
target="new"/>
<menuitem id="menu_orders_customers" name="Find partners"
action="res_partner_find"
parent="base.menu_administration"/>
Python code:
::
import json
from odoo import api, models, _
from odoo.tools.safe_eval import safe_eval
class ResPartner(models.Model):
_inherit = 'res.partner'
@api.multi
def find_res_partner_by_ref_using_barcode(self, barcode):
partner = self.search([('ref', '=', barcode)], limit=1)
if not partner:
action = self.env.ref('res_partner_find')
result = action.read()[0]
context = safe_eval(result['context'])
context.update({
'default_state': 'warning',
'default_status': _('Partner with Internal Reference '
'%s cannot be found') % barcode
})
result['context'] = json.dumps(context)
return result
action = self.env.ref('base.action_partner_form')
result = action.read()[0]
res = self.env.ref('base.view_partner_form', False)
result['views'] = [(res and res.id or False, 'form')]
result['res_id'] = partner.id
return result
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20barcode_action%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Creu Blanca
* ForgeFlow
Contributors
------------
- Enric Tobella <etobella@creublanca.es>
- Jordi Ballester <jordi.ballester@forgeflow.com>
- Foram Shah <foram.shah@initos.com>
- Dhara Solanki <dhara.solanki@initos.com>
- `APSL <https://apsl.tech>`__:
- Miquel Pascual <mpascual@apsl.net>
Maintainers
-----------
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
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 the `OCA/server-ux <https://github.com/OCA/server-ux/tree/17.0/barcode_action>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Raw data
{
"_id": null,
"home_page": "https://github.com/OCA/server-ux",
"name": "odoo-addon-barcode-action",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Creu Blanca, ForgeFlow, Odoo Community Association (OCA)",
"author_email": "support@odoo-community.org",
"download_url": null,
"platform": null,
"description": "=======================\nBarcode action launcher\n=======================\n\n.. \n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! This file is generated by oca-gen-addon-readme !!\n !! changes will be overwritten. !!\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! source digest: sha256:87fc995f6dec3e033f207c35131f848aaf3987733def7d2e096696664e9c93df\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n :target: https://odoo-community.org/page/development-status\n :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png\n :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html\n :alt: License: AGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github\n :target: https://github.com/OCA/server-ux/tree/17.0/barcode_action\n :alt: OCA/server-ux\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n :target: https://translation.odoo-community.org/projects/server-ux-17-0/server-ux-17-0-barcode_action\n :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n :target: https://runboat.odoo-community.org/builds?repo=OCA/server-ux&target_branch=17.0\n :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nThis module allows to use barcodes as launchers of actions.\n\nThe action will launch a function that uses the barcode in order to\nreturn an action.\n\n**Table of contents**\n\n.. contents::\n :local:\n\nUsage\n=====\n\nActions must be configured with the following data in the context: \\*\nmodel: Model where we can find the method (required) \\* method: Method\nto execute (required) \\* res_id: Id as base (optional)\n\nThe method must return an action. Installing this module with demo data\nwill install a demo application that allows the system administrator to\nfind a partner by the external reference encoded in a barcode.\n\nGo to *Settings / Find partners* and scan a barcode that contains the\ninternal reference of an existing partner. As soon as you read the\nbarcode the system will redirect you to that partner's form view.\n\nTechnical implementation of this example:\n\nAction:\n\n::\n\n <act_window id=\"res_partner_find\"\n name=\"Find Partner\"\n res_model=\"barcode.action\"\n view_mode=\"form\"\n view_type=\"form\"\n context=\"{'default_model': 'res.partner', 'default_method': 'find_res_partner_by_ref_using_barcode'}\"\n target=\"new\"/>\n\n <menuitem id=\"menu_orders_customers\" name=\"Find partners\"\n action=\"res_partner_find\"\n parent=\"base.menu_administration\"/>\n\nPython code:\n\n::\n\n import json\n from odoo import api, models, _\n from odoo.tools.safe_eval import safe_eval\n\n\n class ResPartner(models.Model):\n _inherit = 'res.partner'\n\n @api.multi\n def find_res_partner_by_ref_using_barcode(self, barcode):\n partner = self.search([('ref', '=', barcode)], limit=1)\n if not partner:\n action = self.env.ref('res_partner_find')\n result = action.read()[0]\n context = safe_eval(result['context'])\n context.update({\n 'default_state': 'warning',\n 'default_status': _('Partner with Internal Reference '\n '%s cannot be found') % barcode\n })\n result['context'] = json.dumps(context)\n return result\n action = self.env.ref('base.action_partner_form')\n result = action.read()[0]\n res = self.env.ref('base.view_partner_form', False)\n result['views'] = [(res and res.id or False, 'form')]\n result['res_id'] = partner.id\n return result\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20barcode_action%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n-------\n\n* Creu Blanca\n* ForgeFlow\n\nContributors\n------------\n\n- Enric Tobella <etobella@creublanca.es>\n- Jordi Ballester <jordi.ballester@forgeflow.com>\n- Foram Shah <foram.shah@initos.com>\n- Dhara Solanki <dhara.solanki@initos.com>\n- `APSL <https://apsl.tech>`__:\n\n - Miquel Pascual <mpascual@apsl.net>\n\nMaintainers\n-----------\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n :alt: Odoo Community Association\n :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\nThis module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/17.0/barcode_action>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n",
"bugtrack_url": null,
"license": "AGPL-3",
"summary": "Allows to use barcodes as a launcher",
"version": "17.0.1.0.0.4",
"project_urls": {
"Homepage": "https://github.com/OCA/server-ux"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f5298d0e253be33df56c0e5d7d15a4b493d72bc046858ca7e1f0d1555196bd1d",
"md5": "7e9706ec449cb662d4ecea7353b5efe4",
"sha256": "96c9ffcc16dc4152fa8f5d5755cdb7e41ecc3c0c1b6d73e48aaa71c46f871838"
},
"downloads": -1,
"filename": "odoo_addon_barcode_action-17.0.1.0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7e9706ec449cb662d4ecea7353b5efe4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 35591,
"upload_time": "2024-09-19T04:24:46",
"upload_time_iso_8601": "2024-09-19T04:24:46.760722Z",
"url": "https://files.pythonhosted.org/packages/f5/29/8d0e253be33df56c0e5d7d15a4b493d72bc046858ca7e1f0d1555196bd1d/odoo_addon_barcode_action-17.0.1.0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-19 04:24:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OCA",
"github_project": "server-ux",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "odoo-addon-barcode-action"
}