Skip to content

Commit 2577f80

Browse files
committed
Merge PR OCA#1499 into 18.0
Signed-off-by pedrobaeza
2 parents b2f8e97 + cdc242f commit 2577f80

File tree

16 files changed

+775
-0
lines changed

16 files changed

+775
-0
lines changed

pos_supplierinfo_search/README.rst

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
===========================================
2+
Point of sale - Search products by supplier
3+
===========================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:975e1869b8294c679963a615128337b656fa6839c9e640a5be615f249a691d0b
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpos-lightgray.png?logo=github
20+
:target: https://github.com/OCA/pos/tree/18.0/pos_supplierinfo_search
21+
:alt: OCA/pos
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_supplierinfo_search
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/pos&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
In point of sale interface, allow to search products by supplier name,
32+
supplier product code or supplier product name.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Usage
40+
=====
41+
42+
In point of sale interface, just fill the "search products" box with
43+
some supplier data.
44+
45+
Bug Tracker
46+
===========
47+
48+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
49+
In case of trouble, please check there if your issue has already been reported.
50+
If you spotted it first, help us to smash it by providing a detailed and welcomed
51+
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_supplierinfo_search%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
52+
53+
Do not contact contributors directly about support or help with technical issues.
54+
55+
Credits
56+
=======
57+
58+
Authors
59+
-------
60+
61+
* Tecnativa
62+
* TAKOBI
63+
64+
Contributors
65+
------------
66+
67+
- Lorenzo Battistini (https://takobi.online)
68+
- Dhara Solanki <dhara.solanki@initos.com>
69+
- [Tecnativa](https://www.tecnativa.com):
70+
71+
- Carlos Lopez
72+
73+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
74+
75+
- Bhavesh Heliconia
76+
77+
Maintainers
78+
-----------
79+
80+
This module is maintained by the OCA.
81+
82+
.. image:: https://odoo-community.org/logo.png
83+
:alt: Odoo Community Association
84+
:target: https://odoo-community.org
85+
86+
OCA, or the Odoo Community Association, is a nonprofit organization whose
87+
mission is to support the collaborative development of Odoo features and
88+
promote its widespread use.
89+
90+
.. |maintainer-eLBati| image:: https://github.com/eLBati.png?size=40px
91+
:target: https://github.com/eLBati
92+
:alt: eLBati
93+
94+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
95+
96+
|maintainer-eLBati|
97+
98+
This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/18.0/pos_supplierinfo_search>`_ project on GitHub.
99+
100+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright 2020 Lorenzo Battistini @ TAKOBI
2+
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
3+
{
4+
"name": "Point of sale - Search products by supplier",
5+
"summary": "Search products by supplier data",
6+
"version": "18.0.1.0.0",
7+
"development_status": "Beta",
8+
"category": "Point Of Sale",
9+
"website": "https://github.com/OCA/pos",
10+
"author": "Tecnativa, TAKOBI, Odoo Community Association (OCA)",
11+
"maintainers": ["eLBati"],
12+
"license": "LGPL-3",
13+
"application": False,
14+
"installable": True,
15+
"auto_install": False,
16+
"depends": [
17+
"point_of_sale",
18+
],
19+
"assets": {
20+
"point_of_sale._assets_pos": [
21+
"/pos_supplierinfo_search/static/src/js/product_product.esm.js",
22+
],
23+
},
24+
}

pos_supplierinfo_search/i18n/es.po

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * pos_supplierinfo_search
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 12.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2023-07-11 09:09+0000\n"
10+
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
11+
"Language-Team: none\n"
12+
"Language: es\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 4.17\n"
18+
19+
#. module: pos_supplierinfo_search
20+
#: model:ir.model,name:pos_supplierinfo_search.model_pos_session
21+
msgid "Point of Sale Session"
22+
msgstr ""
23+
24+
#. module: pos_supplierinfo_search
25+
#: model:ir.model,name:pos_supplierinfo_search.model_product_template
26+
msgid "Product"
27+
msgstr ""
28+
29+
#. module: pos_supplierinfo_search
30+
#: model:ir.model.fields,field_description:pos_supplierinfo_search.field_product_product__supplier_data_json
31+
#: model:ir.model.fields,field_description:pos_supplierinfo_search.field_product_template__supplier_data_json
32+
msgid "Supplier data dict"
33+
msgstr "Dict de datos del proveedor"
34+
35+
#. module: pos_supplierinfo_search
36+
#: model:ir.model.fields,help:pos_supplierinfo_search.field_product_product__supplier_data_json
37+
#: model:ir.model.fields,help:pos_supplierinfo_search.field_product_template__supplier_data_json
38+
msgid ""
39+
"Technical field: Used in POS frontend to search products by supplierinfo"
40+
msgstr ""
41+
"Campo técnico: se utiliza en la interfaz de POS para buscar productos por "
42+
"proveedor"
43+
44+
#~ msgid "Product Template"
45+
#~ msgstr "Plantilla de producto"

pos_supplierinfo_search/i18n/it.po

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * pos_supplierinfo_search
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 15.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2024-07-22 08:58+0000\n"
10+
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 5.6.2\n"
18+
19+
#. module: pos_supplierinfo_search
20+
#: model:ir.model,name:pos_supplierinfo_search.model_pos_session
21+
msgid "Point of Sale Session"
22+
msgstr "Sessione punto vendita"
23+
24+
#. module: pos_supplierinfo_search
25+
#: model:ir.model,name:pos_supplierinfo_search.model_product_template
26+
msgid "Product"
27+
msgstr "Prodotto"
28+
29+
#. module: pos_supplierinfo_search
30+
#: model:ir.model.fields,field_description:pos_supplierinfo_search.field_product_product__supplier_data_json
31+
#: model:ir.model.fields,field_description:pos_supplierinfo_search.field_product_template__supplier_data_json
32+
msgid "Supplier data dict"
33+
msgstr "Dizionario dati fornitore"
34+
35+
#. module: pos_supplierinfo_search
36+
#: model:ir.model.fields,help:pos_supplierinfo_search.field_product_product__supplier_data_json
37+
#: model:ir.model.fields,help:pos_supplierinfo_search.field_product_template__supplier_data_json
38+
msgid ""
39+
"Technical field: Used in POS frontend to search products by supplierinfo"
40+
msgstr ""
41+
"Campo tecnico: utilizzato nel frontend POS per cercare prodotti per fornitore"
42+
43+
#~ msgid "Product Template"
44+
#~ msgstr "Modello prodotto"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * pos_supplierinfo_search
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: pos_supplierinfo_search
17+
#: model:ir.model,name:pos_supplierinfo_search.model_pos_session
18+
msgid "Point of Sale Session"
19+
msgstr ""
20+
21+
#. module: pos_supplierinfo_search
22+
#: model:ir.model,name:pos_supplierinfo_search.model_product_template
23+
msgid "Product"
24+
msgstr ""
25+
26+
#. module: pos_supplierinfo_search
27+
#: model:ir.model.fields,field_description:pos_supplierinfo_search.field_product_product__supplier_data_json
28+
#: model:ir.model.fields,field_description:pos_supplierinfo_search.field_product_template__supplier_data_json
29+
msgid "Supplier data dict"
30+
msgstr ""
31+
32+
#. module: pos_supplierinfo_search
33+
#: model:ir.model.fields,help:pos_supplierinfo_search.field_product_product__supplier_data_json
34+
#: model:ir.model.fields,help:pos_supplierinfo_search.field_product_template__supplier_data_json
35+
msgid ""
36+
"Technical field: Used in POS frontend to search products by supplierinfo"
37+
msgstr ""
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import product
2+
from . import pos_session
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2024 Tecnativa - Carlos Lopez
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
3+
4+
from odoo import models
5+
6+
7+
class PosSession(models.Model):
8+
_inherit = "pos.session"
9+
10+
def _loader_params_product_product(self):
11+
res = super()._loader_params_product_product()
12+
res["search_params"]["fields"].append("supplier_data_json")
13+
return res
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import json
2+
3+
from odoo import api, fields, models
4+
5+
6+
class ProductProduct(models.Model):
7+
_inherit = "product.product"
8+
9+
supplier_data_json = fields.Char(
10+
"Supplier data dict",
11+
help="Technical field: Used in POS frontend to search products by supplierinfo",
12+
compute="_compute_supplier_data_json",
13+
)
14+
15+
def _compute_supplier_data_json(self):
16+
for rec in self:
17+
rec.supplier_data_json = json.dumps(
18+
[
19+
{
20+
"supplier_name": s.partner_id.display_name,
21+
"supplier_product_code": s.product_code or "",
22+
"supplier_product_name": s.product_name or "",
23+
}
24+
for s in rec.product_tmpl_id.seller_ids
25+
]
26+
)
27+
28+
@api.model
29+
def _load_pos_data_fields(self, config_id):
30+
res = super()._load_pos_data_fields(config_id)
31+
res.append("supplier_data_json")
32+
return res
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"

0 commit comments

Comments
 (0)