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

[17.0] [MIG] sale_stock_available_info_popup: Migration to 17.0 #21

Open
wants to merge 27 commits into
base: 17.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
9df0e23
[ADD] sale_stock_available_info_popup: new module
Apr 22, 2020
0fb59a2
Added translation using Weblate (Slovenian)
sysadminmatmoz Aug 11, 2020
bd70f1b
Translated using Weblate (Slovenian)
sysadminmatmoz Aug 11, 2020
3c5e7e3
[FIX] sale_stock_available_info: ensure test line order
chienandalu Jan 21, 2021
0e227f7
[IMP] sale_stock_available_info_popup: black, isort, prettier
victoralmau Feb 19, 2021
2898195
[MIG] sale_stock_available_info_popup: Migration to 13.0
victoralmau Feb 19, 2021
4948a8c
[FIX] sale_stock_available_info_popup: cache miss
chienandalu Oct 4, 2021
3c52607
[FIX] sale_stock_available_info_popup: right context
chienandalu Mar 24, 2022
695d3a3
[FIX] sale_stock_available_info_popup: immediately_usable_qty_today t…
cesar-tecnativa Jul 26, 2022
ee7c24c
[MIG] sale_stock_available_info_popup: Migration to 15.0
victoralmau Oct 27, 2022
0462001
[UPD] Update sale_stock_available_info_popup.pot
Nov 2, 2022
b33b44f
[UPD] README.rst
OCA-git-bot Nov 2, 2022
8c90413
Update translation files
weblate Nov 3, 2022
e939a0e
[IMP] sale_stock_available_info_popup: pre-commit stuff
bvanjeelharia Dec 20, 2022
38ad514
[MIG] sale_stock_available_info_popup: Migration to 16.0
bvanjeelharia Dec 20, 2022
cba0b9a
[UPD] Update sale_stock_available_info_popup.pot
Jan 25, 2023
4f05cd5
[UPD] README.rst
OCA-git-bot Jan 25, 2023
761fc1e
Update translation files
weblate Jan 25, 2023
1d1c22d
Added translation using Weblate (Croatian)
badbole Mar 1, 2023
69520bd
Translated using Weblate (Croatian)
badbole Mar 1, 2023
5f12ea3
[UPD] README.rst
OCA-git-bot Sep 3, 2023
eea24ed
Translated using Weblate (Spanish)
Ivorra78 Aug 27, 2023
0ed5d5b
Added translation using Weblate (Italian)
mymage Nov 24, 2023
0ed7915
Translated using Weblate (Italian)
mymage Nov 24, 2023
00a5713
[IMP] sale_stock_available_info_popup: pre-commit auto fixes
bizzappdev Apr 25, 2024
ba5ad1c
[MIG] sale_stock_available_info_popup: Migration to 17.0
bizzappdev Apr 25, 2024
d47a2f4
[DON'T MERGE] test-requirements.txt
bizzappdev Apr 25, 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
101 changes: 101 additions & 0 deletions sale_stock_available_info_popup/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
===============================
Sale Stock Available Info Popup
===============================

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

.. |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%2Fstock--logistics--availability-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-availability/tree/17.0/sale_stock_available_info_popup
:alt: OCA/stock-logistics-availability
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-availability-17-0/stock-logistics-availability-17-0-sale_stock_available_info_popup
: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/stock-logistics-availability&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the functionality of 'Sale Stock' module to add the
'Available to promise' quantity of the corresponding product to the
pop-up that show stock information at sales order line level.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Go to *Sales > Orders > quotations* and create a new one.
2. Add a sale order line with a storable product
3. Click on the icon |fa_info_circle| in the line and you will see in
the popover the 'Available to promise' quantity of the corresponding
product.

Note: Now the color of the icon depends on the 'Available to promise'
quantity of the corresponding product instead of 'Forecast Quantity'. If
that quantity is less than the quantity to deliver, the color of the
icon will be red, indicating an alert; otherwise it will be blue.

.. |fa_info_circle| image:: https://raw.githubusercontent.com/OCA/stock-logistics-availability/17.0/sale_stock_available_info_popup/static/src/img/info-circle-solid.png

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-availability/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/stock-logistics-availability/issues/new?body=module:%20sale_stock_available_info_popup%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

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Ernesto Tejeda
- Pedro M. Baeza
- Víctor Martínez
- César A. Sánchez

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/stock-logistics-availability <https://github.com/OCA/stock-logistics-availability/tree/17.0/sale_stock_available_info_popup>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sale_stock_available_info_popup/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import models
20 changes: 20 additions & 0 deletions sale_stock_available_info_popup/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Sale Stock Available Info Popup",
"summary": "Adds an 'Available to promise' quantity to the popover shown "
"in sale order line that display stock info of the product",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-availability",
"category": "Warehouse Management",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"depends": ["sale_stock", "stock_available"],
"data": ["views/sale_order_views.xml"],
"assets": {
"web.assets_backend": [
"sale_stock_available_info_popup/static/src/xml/qty_at_date.xml",
],
},
"installable": True,
}
35 changes: 35 additions & 0 deletions sale_stock_available_info_popup/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_available_info_popup
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-04-24 19:48+0000\n"
"PO-Revision-Date: 2023-09-03 13:35+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: sale_stock_available_info_popup
#. odoo-javascript
#: code:addons/sale_stock_available_info_popup/static/src/xml/qty_at_date.xml:0
#, python-format
msgid "Available to promise"
msgstr "Disponible para Prometer"

#. module: sale_stock_available_info_popup
#: model:ir.model.fields,field_description:sale_stock_available_info_popup.field_sale_order_line__immediately_usable_qty_today
msgid "Immediately Usable Qty Today"
msgstr "Cantidad inmediatamente utilizable hoy"

#. module: sale_stock_available_info_popup
#: model:ir.model,name:sale_stock_available_info_popup.model_sale_order_line
msgid "Sales Order Line"
msgstr "Línea de pedido de venta"
35 changes: 35 additions & 0 deletions sale_stock_available_info_popup/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_available_info_popup
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-03-01 17:22+0000\n"
"Last-Translator: Bole <[email protected]>\n"
"Language-Team: none\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.14.1\n"

#. module: sale_stock_available_info_popup
#. odoo-javascript
#: code:addons/sale_stock_available_info_popup/static/src/xml/qty_at_date.xml:0
#, python-format
msgid "Available to promise"
msgstr "Dostupno za ponuditi"

#. module: sale_stock_available_info_popup
#: model:ir.model.fields,field_description:sale_stock_available_info_popup.field_sale_order_line__immediately_usable_qty_today
msgid "Immediately Usable Qty Today"
msgstr "Danas raspoloživa količina"

#. module: sale_stock_available_info_popup
#: model:ir.model,name:sale_stock_available_info_popup.model_sale_order_line
msgid "Sales Order Line"
msgstr "Stavka prodaje"
34 changes: 34 additions & 0 deletions sale_stock_available_info_popup/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_available_info_popup
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-24 16:35+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: sale_stock_available_info_popup
#. odoo-javascript
#: code:addons/sale_stock_available_info_popup/static/src/xml/qty_at_date.xml:0
#, python-format
msgid "Available to promise"
msgstr "Disponibile da promettere"

#. module: sale_stock_available_info_popup
#: model:ir.model.fields,field_description:sale_stock_available_info_popup.field_sale_order_line__immediately_usable_qty_today
msgid "Immediately Usable Qty Today"
msgstr "Quantità immediatamente utilizzabile oggi"

#. module: sale_stock_available_info_popup
#: model:ir.model,name:sale_stock_available_info_popup.model_sale_order_line
msgid "Sales Order Line"
msgstr "Riga ordine di vendita"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_available_info_popup
#
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: sale_stock_available_info_popup
#. odoo-javascript
#: code:addons/sale_stock_available_info_popup/static/src/xml/qty_at_date.xml:0
#, python-format
msgid "Available to promise"
msgstr ""

#. module: sale_stock_available_info_popup
#: model:ir.model.fields,field_description:sale_stock_available_info_popup.field_sale_order_line__immediately_usable_qty_today
msgid "Immediately Usable Qty Today"
msgstr ""

#. module: sale_stock_available_info_popup
#: model:ir.model,name:sale_stock_available_info_popup.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
43 changes: 43 additions & 0 deletions sale_stock_available_info_popup/i18n/sl.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:
# * sale_stock_available_info_popup
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-08-11 10:59+0000\n"
"Last-Translator: Matjaz Mozetic <[email protected]>\n"
"Language-Team: none\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 3.10\n"

#. module: sale_stock_available_info_popup
#. odoo-javascript
#: code:addons/sale_stock_available_info_popup/static/src/xml/qty_at_date.xml:0
#, python-format
msgid "Available to promise"
msgstr "Lahko obljubimo"

#. module: sale_stock_available_info_popup
#: model:ir.model.fields,field_description:sale_stock_available_info_popup.field_sale_order_line__immediately_usable_qty_today
msgid "Immediately Usable Qty Today"
msgstr "Takoj razpoložljiva današnja kol"

#. module: sale_stock_available_info_popup
#: model:ir.model,name:sale_stock_available_info_popup.model_sale_order_line
msgid "Sales Order Line"
msgstr "Prodajna postavka"

#, python-format
#~ msgid ""
#~ "widget.data.immediately_usable_qty_today < widget.data.qty_to_deliver "
#~ "and !widget.data.is_mto"
#~ msgstr ""
#~ "widget.data.immediately_usable_qty_today < widget.data.qty_to_deliver "
#~ "and !widget.data.is_mto"
3 changes: 3 additions & 0 deletions sale_stock_available_info_popup/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from . import sale_order
36 changes: 36 additions & 0 deletions sale_stock_available_info_popup/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from collections import defaultdict

from odoo import api, fields, models


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

immediately_usable_qty_today = fields.Float(
compute="_compute_immediately_usable_qty_today"
)

@api.depends(
"product_id",
"product_uom_qty",
"scheduled_date",
"order_id.date_order",
"warehouse_id",
)
def _compute_immediately_usable_qty_today(self):
qty_processed_per_product = defaultdict(lambda: 0)
self.immediately_usable_qty_today = False
for line in self.sorted(key=lambda r: r.sequence):
if not line.display_qty_widget:
continue
product = line.product_id.with_context(
to_date=line.scheduled_date, warehouse=line.warehouse_id.id
)
qty_processed = qty_processed_per_product[product.id]
line.immediately_usable_qty_today = (
product.immediately_usable_qty - qty_processed
)
qty_processed_per_product[product.id] += line.product_uom_qty
3 changes: 3 additions & 0 deletions sale_stock_available_info_popup/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions sale_stock_available_info_popup/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [Tecnativa](https://www.tecnativa.com):
- Ernesto Tejeda
- Pedro M. Baeza
- Víctor Martínez
- César A. Sánchez
3 changes: 3 additions & 0 deletions sale_stock_available_info_popup/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module extends the functionality of 'Sale Stock' module to add the
'Available to promise' quantity of the corresponding product to the
pop-up that show stock information at sales order line level.
13 changes: 13 additions & 0 deletions sale_stock_available_info_popup/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
To use this module, you need to:

1. Go to *Sales \> Orders \> quotations* and create a new one.
2. Add a sale order line with a storable product
3. Click on the icon
![fa_info_circle](../static/src/img/info-circle-solid.png) in the
line and you will see in the popover the 'Available to promise'
quantity of the corresponding product.

Note: Now the color of the icon depends on the 'Available to promise'
quantity of the corresponding product instead of 'Forecast Quantity'. If
that quantity is less than the quantity to deliver, the color of the
icon will be red, indicating an alert; otherwise it will be blue.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading