Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] Backport from 15.0 to 14.0 pos_lot_selection #1239

Open
wants to merge 27 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
187d2fc
[10.0][ADD] pos_lot_selection: New module (#256)
chienandalu Mar 14, 2018
6666735
[UPD] Update pos_lot_selection.pot
oca-travis Jun 22, 2018
13c0cdb
[MIG] pos_lot_selection: Migration to 11.0
NachoAlesLopez Aug 30, 2018
a734e72
[IMP] pos_lot_selection: clone control no longer needed
chienandalu Mar 16, 2018
1540de0
[UPD] Update pos_lot_selection.pot
oca-travis Oct 27, 2018
37abfc4
[FIX] pos_lot_selection: ES6 code breaks phantomjs tests
kirca Feb 13, 2019
d5af8e5
Added translation using Weblate (Catalan)
danimv5 Mar 26, 2021
f07833d
Translated using Weblate (Catalan)
danimv5 Mar 26, 2021
83abe57
[MIG] pos_lot_selection
i-vyshnevska Aug 26, 2022
0b97a33
[UPD] Update pos_lot_selection.pot
Sep 26, 2022
1ec788f
[UPD] README.rst
OCA-git-bot Sep 26, 2022
a7b7cbc
[FIX] pos_lot_selection: proper module name in js definition
ivantodorovich Sep 28, 2022
b0b6e0b
[FIX] pos_lot_selection: access rights
ivantodorovich Sep 28, 2022
8d3cb10
[IMP] pos_lot_selection: bump js to es6
ivantodorovich Sep 28, 2022
89f515c
[IMP] pos_lot_selection: avoid replace in xml views, simplify code
ivantodorovich Sep 28, 2022
1940135
[UPD] Update pos_lot_selection.pot
Sep 29, 2022
31a0e6b
pos_lot_selection 15.0.1.0.1
OCA-git-bot Sep 29, 2022
6348363
Added translation using Weblate (Italian)
mymage Mar 9, 2023
c8035e7
Translated using Weblate (Italian)
mymage Mar 9, 2023
162120b
Translated using Weblate (Italian)
mymage Apr 17, 2023
130399e
Added translation using Weblate (Spanish)
Ivorra78 Jul 11, 2023
8f81d0c
Translated using Weblate (Spanish)
Ivorra78 Jul 11, 2023
5fe162a
[UPD] README.rst
OCA-git-bot Sep 3, 2023
8690627
Translated using Weblate (Italian)
mymage Nov 2, 2023
dd28475
Translated using Weblate (Italian)
mymage Jan 24, 2024
89651d1
[IMP] pos_lot_selection: black, isort, prettier
sergiocorato Sep 24, 2024
78344dc
[MIG] Backport pos_lot_selection from v. 15.0
sergiocorato Sep 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions pos_lot_selection/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
=================
POS Lot Selection
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bbdabf66a65199b6ec3d6b0b42e4b9754b6d93d0ee411f903c3c7c55db2ce777
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/14.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-14-0/pos-14-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=14.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:%2014.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

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/14.0/pos_lot_selection>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions pos_lot_selection/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions pos_lot_selection/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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": "14.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",
],
"data": ["templates/assets.xml"],
"qweb": ["static/src/xml/LotSelectorPopup.xml"],
"application": False,
"installable": True,
}
43 changes: 43 additions & 0 deletions pos_lot_selection/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_lot_selection
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-11 09:09+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_production_lot
msgid "Lot/Serial"
msgstr "Lote/Serie"

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/js/EditListPopup.js:0
#, python-format
msgid "Lot/Serial Number(s) Required"
msgstr "Número(s) de lote/serie obligatorio(s)"

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/xml/LotSelectorPopup.xml:0
#, python-format
msgid "prepared_lots"
msgstr "lotes_preparados"

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/xml/LotSelectorPopup.xml:0
#, python-format
msgid "props.lots"
msgstr "puntales.lotes"
43 changes: 43 additions & 0 deletions pos_lot_selection/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_lot_selection
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-24 17:34+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_production_lot
msgid "Lot/Serial"
msgstr "Lotto/seriale"

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/js/EditListPopup.js:0
#, python-format
msgid "Lot/Serial Number(s) Required"
msgstr "Richiesto numero(i) di lotto/serie"

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/xml/LotSelectorPopup.xml:0
#, python-format
msgid "prepared_lots"
msgstr "prepared_lots"

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/xml/LotSelectorPopup.xml:0
#, python-format
msgid "props.lots"
msgstr "props.lots"
40 changes: 40 additions & 0 deletions pos_lot_selection/i18n/pos_lot_selection.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_lot_selection
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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_production_lot
msgid "Lot/Serial"
msgstr ""

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/js/EditListPopup.js:0
#, python-format
msgid "Lot/Serial Number(s) Required"
msgstr ""

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/xml/LotSelectorPopup.xml:0
#, python-format
msgid "prepared_lots"
msgstr ""

#. module: pos_lot_selection
#. openerp-web
#: code:addons/pos_lot_selection/static/src/xml/LotSelectorPopup.xml:0
#, python-format
msgid "props.lots"
msgstr ""
1 change: 1 addition & 0 deletions pos_lot_selection/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_production_lot
30 changes: 30 additions & 0 deletions pos_lot_selection/models/stock_production_lot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2022 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)

from odoo import api, models
from odoo.tools import float_compare


class ProductionLot(models.Model):
_inherit = "stock.production.lot"

@api.model
def get_available_lots_for_pos(self, product_id, company_id):
lots = self.sudo().search(

Check warning on line 13 in pos_lot_selection/models/stock_production_lot.py

View check run for this annotation

Codecov / codecov/patch

pos_lot_selection/models/stock_production_lot.py#L13

Added line #L13 was not covered by tests
[
"&",
["product_id", "=", product_id],
"|",
["company_id", "=", company_id],
["company_id", "=", False],
]
)

lots = lots.filtered(
lambda l: float_compare(
l.product_qty, 0, precision_rounding=l.product_uom_id.rounding
)
> 0
)

return lots.mapped("name")

Check warning on line 30 in pos_lot_selection/models/stock_production_lot.py

View check run for this annotation

Codecov / codecov/patch

pos_lot_selection/models/stock_production_lot.py#L30

Added line #L30 was not covered by tests
1 change: 1 addition & 0 deletions pos_lot_selection/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to pick between existing lots in POS frontend.
9 changes: 9 additions & 0 deletions pos_lot_selection/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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.
Binary file added pos_lot_selection/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading