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

[14.0][MIG] stock_picking_quick #1088

Merged
merged 18 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions setup/stock_picking_quick/odoo/addons/stock_picking_quick
6 changes: 6 additions & 0 deletions setup/stock_picking_quick/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
96 changes: 96 additions & 0 deletions stock_picking_quick/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
===================
Quick Stock Picking
===================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/12.0/stock_picking_quick
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-12-0/stock-logistics-workflow-12-0-stock_picking_quick
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/154/12.0
:alt: Try me on Runbot

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

This module allows to easily pick products into a picking (mass line add/update).

**Table of contents**

.. contents::
:local:

Usage
=====

Inside a picking, you can click on "Add products", to open a product tree view, then update "qty to process" field.

The update of "qty to process" will add a new move line or update the existing move line. If qty to process is 0 its move line will be deleted if it exists.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_quick%0Aversion:%2012.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
~~~~~~~

* Akretion

Contributors
~~~~~~~~~~~~

Akretion

* Sébastien BEAU <sebastien.beau@akretion.com>
* Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
* Pierrick Brun <pierrick.brun@akretion.com>
* David Béal <david.beal@akretion.com>

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.

.. |maintainer-PierrickBrun| image:: https://github.com/PierrickBrun.png?size=40px
:target: https://github.com/PierrickBrun
:alt: PierrickBrun
.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px
:target: https://github.com/bealdav
:alt: bealdav

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-PierrickBrun| |maintainer-bealdav|

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/12.0/stock_picking_quick>`_ 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 stock_picking_quick/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions stock_picking_quick/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# © 2022 Today Akretion
# @author Pierrick Brun <pierrick.brun@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Quick Stock Picking",
"version": "14.0.1.0.3",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-workflow",
"license": "AGPL-3",
"category": "Stock",
"depends": ["base_product_mass_addition", "stock"],
"data": ["views/picking_view.xml", "views/product_view.xml"],
"installable": True,
"maintainers": ["PierrickBrun", "bealdav"],
}
68 changes: 68 additions & 0 deletions stock_picking_quick/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_quick
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-06-23 16:19+0000\n"
"Last-Translator: Fernando Colus <fcolus1@gmail.com>\n"
"Language-Team: none\n"
"Language: pt_BR\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 3.10\n"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.view_picking_form
msgid "Add"
msgstr "Adicionar"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_search_view4picking
msgid "Filter products available in the current location"
msgstr "Filtrar produtos disponíveis na localização atual"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_tree_view4picking
msgid "Open"
msgstr "Abrir"

#. module: stock_picking_quick
#: model:ir.model,name:stock_picking_quick.model_product_product
msgid "Product"
msgstr "Produto"

#. module: stock_picking_quick
#: code:addons/stock_picking_quick/models/stock_picking.py:24
#, python-format
msgid "Product Variants"
msgstr "Variantes de produto"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_tree_view4picking
msgid "Products for picking"
msgstr "Produtos para coleta"

#. module: stock_picking_quick
#: model:ir.model.fields,field_description:stock_picking_quick.field_product_product__move_ids
msgid "Stock Moves"
msgstr "Movimentações de Estoque"

#. module: stock_picking_quick
#: model:ir.model.fields,help:stock_picking_quick.field_product_product__move_ids
msgid "Technical: used to compute quantities to pick."
msgstr "Técnico: usado para calcular as quantidades a serem coletadas."

#. module: stock_picking_quick
#: model:ir.model,name:stock_picking_quick.model_stock_picking
msgid "Transfer"
msgstr "Transferência"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_search_view4picking
msgid "Use Only Available Products"
msgstr "Use apenas produtos disponíveis"
69 changes: 69 additions & 0 deletions stock_picking_quick/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_quick
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-06-26 10:05+0000\n"
"Last-Translator: Matjaz Mozetic <matjaz@luxim.si>\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 4.3.2\n"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.view_picking_form
msgid "Add"
msgstr "Dodaj"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_search_view4picking
msgid "Filter products available in the current location"
msgstr "Filtriraj izdelke na voljo na trenutni lokaciji"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_tree_view4picking
msgid "Open"
msgstr "Odpri"

#. module: stock_picking_quick
#: model:ir.model,name:stock_picking_quick.model_product_product
msgid "Product"
msgstr "Proizvod"

#. module: stock_picking_quick
#: code:addons/stock_picking_quick/models/stock_picking.py:24
#, python-format
msgid "Product Variants"
msgstr "Različice proizvodov"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_tree_view4picking
msgid "Products for picking"
msgstr "Proizvodi za dobavnico"

#. module: stock_picking_quick
#: model:ir.model.fields,field_description:stock_picking_quick.field_product_product__move_ids
msgid "Stock Moves"
msgstr "Premiki zaloge"

#. module: stock_picking_quick
#: model:ir.model.fields,help:stock_picking_quick.field_product_product__move_ids
msgid "Technical: used to compute quantities to pick."
msgstr "Tehnično: za izračun količin na dobavnici."

#. module: stock_picking_quick
#: model:ir.model,name:stock_picking_quick.model_stock_picking
msgid "Transfer"
msgstr "Premestitev"

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_search_view4picking
msgid "Use Only Available Products"
msgstr "Uporabljaj le proizvode na voljo"
66 changes: 66 additions & 0 deletions stock_picking_quick/i18n/stock_picking_quick.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_quick
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.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: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.view_picking_form
msgid "Add"
msgstr ""

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_search_view4picking
msgid "Filter products available in the current location"
msgstr ""

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_tree_view4picking
msgid "Open"
msgstr ""

#. module: stock_picking_quick
#: model:ir.model,name:stock_picking_quick.model_product_product
msgid "Product"
msgstr ""

#. module: stock_picking_quick
#: code:addons/stock_picking_quick/models/stock_picking.py:24
#, python-format
msgid "Product Variants"
msgstr ""

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_tree_view4picking
msgid "Products for picking"
msgstr ""

#. module: stock_picking_quick
#: model:ir.model.fields,field_description:stock_picking_quick.field_product_product__move_ids
msgid "Stock Moves"
msgstr ""

#. module: stock_picking_quick
#: model:ir.model.fields,help:stock_picking_quick.field_product_product__move_ids
msgid "Technical: used to compute quantities to pick."
msgstr ""

#. module: stock_picking_quick
#: model:ir.model,name:stock_picking_quick.model_stock_picking
msgid "Transfer"
msgstr ""

#. module: stock_picking_quick
#: model_terms:ir.ui.view,arch_db:stock_picking_quick.product_search_view4picking
msgid "Use Only Available Products"
msgstr ""

2 changes: 2 additions & 0 deletions stock_picking_quick/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_picking
from . import product_product
46 changes: 46 additions & 0 deletions stock_picking_quick/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# © 2022 Today Akretion
# @author Pierrick Brun <pierrick.brun@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).


from odoo import api, models


class ProductProduct(models.Model):
_inherit = "product.product"

@api.depends("stock_move_ids")
@api.depends_context("parent_model")
def _compute_process_qty(self):
res = super(ProductProduct, self)._compute_process_qty()
if self.env.context.get("parent_model", False) == "stock.picking":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add a depends_context for that entry

quantities = self.env["stock.move"].read_group(
[
("picking_id", "=", self.env.context.get("parent_id")),
("product_id", "in", self.ids),
],
["product_id", "product_qty:sum"],
["product_id"],
)
for product in self:
for qty in quantities:
if product.id == qty["product_id"][0]:
product.qty_to_process = qty["product_qty"]
return res

def _default_quick_uom_id(self):
if self.env.context.get("parent_model", False) == "stock.picking":
return self.uom_id
return super()._default_quick_uom_id()

@api.model
def search(self, args, offset=0, limit=None, order=None, count=False):
if self.env.context.get("in_current_parent"):
picking = self.env["stock.picking"].browse(
self.env.context.get("parent_id")
)
if picking:
args.append(("stock_move_ids.picking_id", "=", picking.id))
return super(ProductProduct, self).search(
args, offset=offset, limit=limit, order=order, count=count
)
Loading