-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d20353
commit d2c3e76
Showing
5 changed files
with
18 additions
and
90 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 |
---|---|---|
@@ -1,74 +0,0 @@ | ||
================================= | ||
Stock Picking Quick Quantity Done | ||
================================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:1b9bb641b86c2b0770a72f33cff550bc94afa3ebc5f5052cfd493f6f57c80dc1 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-grap%2Fgrap--odoo--incubator-lightgray.png?logo=github | ||
:target: https://github.com/grap/grap-odoo-incubator/tree/12.0/stock_picking_quick_quantity_done | ||
:alt: grap/grap-odoo-incubator | ||
|
||
|badge1| |badge2| |badge3| | ||
|
||
This module allows you to quickly indicate the done quantities in pickings. | ||
This is useful for activities (such as grocery stores) where product stock | ||
quantities are not well updated, due to lack of time for example. | ||
This is the same objective as the legacy function "Force availability". | ||
|
||
.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-incubator/12.0/stock_picking_quick_quantity_done/static/description/picking.png | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
This module checks if some "quantities done" in the picking are not equals to | ||
initials demands. If so, "Force availability" button is possible. | ||
User can also set "quantity done" for each line of the picking. | ||
|
||
.. figure:: https://raw.githubusercontent.com/grap/grap-odoo-incubator/12.0/stock_picking_quick_quantity_done/static/description/picking_functionnalities.gif | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/grap/grap-odoo-incubator/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/grap/grap-odoo-incubator/issues/new?body=module:%20stock_picking_quick_quantity_done%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 | ||
~~~~~~~ | ||
|
||
* GRAP | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Quentin DUPONT <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is part of the `grap/grap-odoo-incubator <https://github.com/grap/grap-odoo-incubator/tree/12.0/stock_picking_quick_quantity_done>`_ project on GitHub. | ||
|
||
You are welcome to 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
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
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 |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
# @author Quentin DUPONT ([email protected]) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import _, models | ||
from odoo.exceptions import UserError | ||
from odoo import models | ||
|
||
|
||
class StockPicking(models.Model): | ||
|
@@ -14,10 +13,8 @@ def quick_confirm(self): | |
moves = picking.mapped("move_ids").filtered( | ||
lambda move: move.state not in ("draft", "cancel", "done") | ||
) | ||
if not moves: | ||
raise UserError(_("Nothing to check the availability for.")) | ||
# Fill picking | ||
# Fill picking moves | ||
for move in moves: | ||
move.quick_quantity_done() | ||
# Validate SO | ||
# Validate picking | ||
picking.button_validate() |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# @author Quentin DUPONT <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo.exceptions import UserError | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
|
@@ -42,9 +43,15 @@ def setUp(self): | |
} | ||
) | ||
|
||
def test_confirm_sale_and_picking(self): | ||
def test_001_confirm_sale_and_picking(self): | ||
self.assertEqual(len(self.sale_order_1.picking_ids), 0) | ||
self.assertEqual(self.sale_order_1.action_quick_confirm(), True) | ||
self.assertEqual(len(self.sale_order_1.picking_ids), 1) | ||
for picking in self.sale_order_1.picking_ids: | ||
self.assertEqual(picking.state, "done") | ||
|
||
def test_002_null_value_on_picking(self): | ||
self.sale_order_1.action_confirm() | ||
self.sale_order_1.picking_ids.move_ids_without_package[0].product_uom_qty = 0 | ||
with self.assertRaises(UserError): | ||
self.sale_order_1.action_quick_confirm() |