-
-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by etobella
- Loading branch information
Showing
22 changed files
with
1,031 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
================= | ||
POS Lot Selection | ||
================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:332823a29c82b672a1e514ec5a74caeb6946df35774d3d2fe58b8d05e7ba9e5e | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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%2Fpos-lightgray.png?logo=github | ||
:target: https://github.com/OCA/pos/tree/17.0/pos_lot_selection | ||
:alt: OCA/pos | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/pos-17-0/pos-17-0-pos_lot_selection | ||
: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/pos&target_branch=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to pick between existing lots in POS frontend. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
1. Go to *Inventory > Settings* and set the option *Track lots or serial | ||
numbers* | ||
2. Chose a product that is stockable, go to its *Inventory* tab, and set | ||
*Tracking* to *By Lots*. | ||
3. Go to its *Sales* tab and set it as *Available in the Point of Sale*. | ||
4. Click on *Update Qty On Hand*, chose the same location configured in | ||
the POS you want the lot available in; write a quantity; unfold the | ||
*Lot/Serial Number* field and pick create one if none is available | ||
yet. | ||
5. Create a new lot with the serial number of your choice. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/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/pos/issues/new?body=module:%20pos_lot_selection%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 | ||
------- | ||
|
||
* Tecnativa | ||
* Camptocamp | ||
|
||
Contributors | ||
------------ | ||
|
||
- Camptocamp | ||
|
||
- Iryna Vyshnevska | ||
- Ivan Todorovich | ||
- Maksym Yankin | ||
|
||
- Dixmit | ||
|
||
- Enric Tobella | ||
|
||
- Tecnativa | ||
|
||
- David Vidal | ||
|
||
- Trobz Consulting | ||
|
||
- Nguyen Minh Chien [email protected] | ||
|
||
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/pos <https://github.com/OCA/pos/tree/17.0/pos_lot_selection>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2018 Tecnativa S.L. - David Vidal | ||
# Copyright 2022 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "POS Lot Selection", | ||
"version": "17.0.1.0.0", | ||
"category": "Point of Sale", | ||
"author": "Tecnativa, Camptocamp, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/pos", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"point_of_sale", | ||
], | ||
"assets": { | ||
"point_of_sale._assets_pos": [ | ||
"pos_lot_selection/static/src/js/**/*.js", | ||
"pos_lot_selection/static/src/xml/**/*.xml", | ||
], | ||
"web.assets_tests": [ | ||
"pos_lot_selection/static/tests/tours/**/*", | ||
], | ||
}, | ||
"application": False, | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * pos_lot_selection | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-08-22 18:15+0000\n" | ||
"Last-Translator: Ivorra78 <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: es\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: pos_lot_selection | ||
#: model:ir.model,name:pos_lot_selection.model_stock_lot | ||
msgid "Lot/Serial" | ||
msgstr "Lote/Número de serie" | ||
|
||
#. module: pos_lot_selection | ||
#. odoo-javascript | ||
#: code:addons/pos_lot_selection/static/src/js/EditListPopup.js:0 | ||
#, python-format | ||
msgid "Lot/Serial Number(s) Required" | ||
msgstr "Lote/Número(s) de serie Obligatorio" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * pos_lot_selection | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-11-02 16:37+0000\n" | ||
"Last-Translator: mymage <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.17\n" | ||
|
||
#. module: pos_lot_selection | ||
#: model:ir.model,name:pos_lot_selection.model_stock_lot | ||
msgid "Lot/Serial" | ||
msgstr "Lotto/seriale" | ||
|
||
#. module: pos_lot_selection | ||
#. odoo-javascript | ||
#: code:addons/pos_lot_selection/static/src/js/EditListPopup.js:0 | ||
#, python-format | ||
msgid "Lot/Serial Number(s) Required" | ||
msgstr "Richiesto numero(i) lotto/seriale" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * pos_lot_selection | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: pos_lot_selection | ||
#: model:ir.model,name:pos_lot_selection.model_stock_lot | ||
msgid "Lot/Serial" | ||
msgstr "" | ||
|
||
#. module: pos_lot_selection | ||
#. odoo-javascript | ||
#: code:addons/pos_lot_selection/static/src/js/EditListPopup.js:0 | ||
#, python-format | ||
msgid "Lot/Serial Number(s) Required" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from . import product_product | ||
from . import stock_lot | ||
|
||
from . import pos_session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Dixmit | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class PosSession(models.Model): | ||
_inherit = "pos.session" | ||
|
||
def _loader_params_product_product(self): | ||
result = super()._loader_params_product_product() | ||
result["search_params"]["fields"].append("available_lot_for_pos_ids") | ||
return result | ||
|
||
def get_pos_ui_product_product_by_params(self, custom_search_params): | ||
return super( | ||
PosSession, self.with_company(self.company_id.id) | ||
).get_pos_ui_product_product_by_params(custom_search_params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2022 Camptocamp SA | ||
# Copyright 2024 Dixmit | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
|
||
from odoo import api, fields, models | ||
from odoo.tools import float_compare | ||
|
||
|
||
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
available_lot_for_pos_ids = fields.Json( | ||
compute="_compute_available_lot_for_pos", prefetch=False | ||
) | ||
|
||
@api.depends() | ||
@api.depends_context("company") | ||
def _compute_available_lot_for_pos(self): | ||
for record in self: | ||
record.available_lot_for_pos_ids = record.get_available_lots_for_pos( | ||
self.env.company.id | ||
) | ||
|
||
def get_available_lots_for_pos(self, company_id): | ||
self.ensure_one() | ||
if self.type != "product" or self.tracking == "none": | ||
return [] | ||
lots = ( | ||
self.env["stock.lot"] | ||
.sudo() | ||
.search( | ||
[ | ||
"&", | ||
["product_id", "=", self.id], | ||
"|", | ||
["company_id", "=", company_id], | ||
["company_id", "=", False], | ||
] | ||
) | ||
) | ||
|
||
lots = lots.filtered( | ||
lambda lot: float_compare( | ||
lot.product_qty, 0, precision_digits=lot.product_uom_id.rounding | ||
) | ||
> 0 | ||
) | ||
return [lot._get_pos_info() for lot in lots] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2022 Camptocamp SA | ||
# Copyright 2024 Dixmit | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) | ||
|
||
from odoo import models | ||
|
||
|
||
class StockLot(models.Model): | ||
_inherit = "stock.lot" | ||
|
||
def _get_pos_info(self): | ||
# We will add this as a hook to add more fields if necessary | ||
return { | ||
"id": self.id, | ||
"name": self.name, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- Camptocamp | ||
- Iryna Vyshnevska | ||
- Ivan Todorovich | ||
- Maksym Yankin | ||
- Dixmit | ||
- Enric Tobella | ||
- Tecnativa | ||
- David Vidal | ||
- Trobz Consulting | ||
- Nguyen Minh Chien <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module allows to pick between existing lots in POS frontend. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
1. Go to *Inventory \> Settings* and set the option *Track lots or | ||
serial numbers* | ||
2. Chose a product that is stockable, go to its *Inventory* tab, and | ||
set *Tracking* to *By Lots*. | ||
3. Go to its *Sales* tab and set it as *Available in the Point of | ||
Sale*. | ||
4. Click on *Update Qty On Hand*, chose the same location configured in | ||
the POS you want the lot available in; write a quantity; unfold the | ||
*Lot/Serial Number* field and pick create one if none is available | ||
yet. | ||
5. Create a new lot with the serial number of your choice. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.