diff --git a/stock_request_kanban/README.rst b/stock_request_kanban/README.rst index b998d251f..472815c46 100644 --- a/stock_request_kanban/README.rst +++ b/stock_request_kanban/README.rst @@ -1,10 +1,29 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html - :alt: License: LGPL-3 +==================== +Stock Request kanban +==================== -==================== -Stock Request Kanban -==================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_request_kanban + :alt: OCA/stock-logistics-warehouse +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_request_kanban + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| On most companies there is products that must be purchased often but cannot be stored as a usual product because no consumption moves are made. @@ -15,18 +34,40 @@ products. It is created following the concept of lean kanban cards. +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +If you don't need to check the CRC of the kanban card, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.crc' and set it value to 0 + +If you want to change the format of the QR, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.barcode_format' and set + the format of the barcode + Usage ===== Creation --------- +~~~~~~~~ + * Go to 'Stock Requests / Stock Requests Kanban' and create a new Kanban. * Indicate a product, quantity and location. * Press 'Save'. * Print the kanban and put it in the storage of the product Request kanban --------------- +~~~~~~~~~~~~~~ This should be used if you want to create the kanban when the card is consumed. @@ -36,7 +77,7 @@ This should be used if you want to create the kanban when the card is consumed. * The stock request is created Request kanban batch --------------------- +~~~~~~~~~~~~~~~~~~~~ This should be used when you will store the cards and create request orders for kanbans later. @@ -46,38 +87,43 @@ for kanbans later. * Press the scan button * Scan all the pending kanban cards -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/11.0 - - Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of -trouble, please check there if your issue has already been reported. If you -spotted it first, help us smash it by providing detailed and welcomed feedback. +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Creu Blanca +* Eficent + Contributors ------------- +~~~~~~~~~~~~ * Enric Tobella -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_request_kanban/__manifest__.py b/stock_request_kanban/__manifest__.py index cd71167fd..0a3eb4813 100644 --- a/stock_request_kanban/__manifest__.py +++ b/stock_request_kanban/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Stock Request kanban', - 'version': '11.0.1.0.1', + 'version': '11.0.1.2.0', 'category': 'Reporting', 'website': 'https://github.com/OCA/stock-logistics-warehouse', 'author': 'Creu Blanca, Eficent, Odoo Community Association (OCA)', diff --git a/stock_request_kanban/models/stock_request_kanban.py b/stock_request_kanban/models/stock_request_kanban.py index a1969f369..1c0fc0cc9 100644 --- a/stock_request_kanban/models/stock_request_kanban.py +++ b/stock_request_kanban/models/stock_request_kanban.py @@ -22,10 +22,16 @@ class StockRequestKanban(models.Model): @api.model def get_barcode_format(self): - return 'Standard39' + return self.env['ir.config_parameter'].sudo().get_param( + 'stock_request_kanban.barcode_format', default='Standard39' + ) @api.model def _recompute_barcode(self, barcode): + if self.env['ir.config_parameter'].sudo().get_param( + 'stock_request_kanban.crc', default='1' + ) == '0': + return barcode bcc = getCodes()[self.get_barcode_format()](value=barcode[:-1]) bcc.validate() bcc.encode() diff --git a/stock_request_kanban/readme/CONFIGURE.rst b/stock_request_kanban/readme/CONFIGURE.rst new file mode 100644 index 000000000..e6216f228 --- /dev/null +++ b/stock_request_kanban/readme/CONFIGURE.rst @@ -0,0 +1,12 @@ +If you don't need to check the CRC of the kanban card, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.crc' and set it value to 0 + +If you want to change the format of the QR, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.barcode_format' and set + the format of the barcode diff --git a/stock_request_kanban/readme/CONTRIBUTORS.rst b/stock_request_kanban/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..93ec993e0 --- /dev/null +++ b/stock_request_kanban/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Enric Tobella diff --git a/stock_request_kanban/readme/DESCRIPTION.rst b/stock_request_kanban/readme/DESCRIPTION.rst new file mode 100644 index 000000000..2d6f42c31 --- /dev/null +++ b/stock_request_kanban/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +On most companies there is products that must be purchased often but cannot be +stored as a usual product because no consumption moves are made. +Usually, they are stored as consumables or putaway rules are defined. +In both cases, reordering rules cannot be used. +This module allows to use stock request as reordering rules for this kind of +products. + +It is created following the concept of lean kanban cards. diff --git a/stock_request_kanban/readme/USAGE.rst b/stock_request_kanban/readme/USAGE.rst new file mode 100644 index 000000000..446f62544 --- /dev/null +++ b/stock_request_kanban/readme/USAGE.rst @@ -0,0 +1,28 @@ +Creation +~~~~~~~~ + +* Go to 'Stock Requests / Stock Requests Kanban' and create a new Kanban. +* Indicate a product, quantity and location. +* Press 'Save'. +* Print the kanban and put it in the storage of the product + +Request kanban +~~~~~~~~~~~~~~ + +This should be used if you want to create the kanban when the card is consumed. + +* Once the product is consumed, take the card +* Go to 'Stock Requests / Order Kanban Card' +* Scan the card +* The stock request is created + +Request kanban batch +~~~~~~~~~~~~~~~~~~~~ + +This should be used when you will store the cards and create request orders +for kanbans later. + +* Once the product is consumed, take the card and store it +* Create a store request order +* Press the scan button +* Scan all the pending kanban cards diff --git a/stock_request_kanban/report/stock_request_kanban_templates.xml b/stock_request_kanban/report/stock_request_kanban_templates.xml index e85e66bbb..7ba023505 100644 --- a/stock_request_kanban/report/stock_request_kanban_templates.xml +++ b/stock_request_kanban/report/stock_request_kanban_templates.xml @@ -57,7 +57,7 @@
-
diff --git a/stock_request_kanban/static/description/index.html b/stock_request_kanban/static/description/index.html new file mode 100644 index 000000000..f8c6feb48 --- /dev/null +++ b/stock_request_kanban/static/description/index.html @@ -0,0 +1,482 @@ + + + + + + +Stock Request kanban + + + +
+

Stock Request kanban

+ + +

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

On most companies there is products that must be purchased often but cannot be +stored as a usual product because no consumption moves are made. +Usually, they are stored as consumables or putaway rules are defined. +In both cases, reordering rules cannot be used. +This module allows to use stock request as reordering rules for this kind of +products.

+

It is created following the concept of lean kanban cards.

+

Table of contents

+ +
+

Configuration

+

If you don’t need to check the CRC of the kanban card, you should:

+
    +
  • Access on Development mode
  • +
  • Access ‘Settings / Technical / Parameters / System Parameters’
  • +
  • Create a parameter with name ‘stock_request_kanban.crc’ and set it value to 0
  • +
+

If you want to change the format of the QR, you should:

+
    +
  • Access on Development mode
  • +
  • Access ‘Settings / Technical / Parameters / System Parameters’
  • +
  • Create a parameter with name ‘stock_request_kanban.barcode_format’ and set +the format of the barcode
  • +
+
+
+

Usage

+
+

Creation

+
    +
  • Go to ‘Stock Requests / Stock Requests Kanban’ and create a new Kanban.
  • +
  • Indicate a product, quantity and location.
  • +
  • Press ‘Save’.
  • +
  • Print the kanban and put it in the storage of the product
  • +
+
+
+

Request kanban

+

This should be used if you want to create the kanban when the card is consumed.

+
    +
  • Once the product is consumed, take the card
  • +
  • Go to ‘Stock Requests / Order Kanban Card’
  • +
  • Scan the card
  • +
  • The stock request is created
  • +
+
+
+

Request kanban batch

+

This should be used when you will store the cards and create request orders +for kanbans later.

+
    +
  • Once the product is consumed, take the card and store it
  • +
  • Create a store request order
  • +
  • Press the scan button
  • +
  • Scan all the pending kanban cards
  • +
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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-warehouse project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_request_kanban/tests/test_kanban.py b/stock_request_kanban/tests/test_kanban.py index 3977788b2..4a44eac64 100644 --- a/stock_request_kanban/tests/test_kanban.py +++ b/stock_request_kanban/tests/test_kanban.py @@ -61,6 +61,8 @@ class TestKanban(TestBaseKanban): 'company_id': self.main_company.id, 'propagate': 'False', }) + self.env['ir.config_parameter'].set_param( + 'stock_request_kanban.crc', '1') def test_onchanges(self): kanban = self.env['stock.request.kanban'].new({}) @@ -143,6 +145,11 @@ class TestKanban(TestBaseKanban): 'product_uom_id': self.product.uom_id.id, 'product_uom_qty': 1, }) + kanban_3 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) wizard = self.env['wizard.stock.request.kanban'].with_context( ).create({}) with self.assertRaises(ValidationError): @@ -162,3 +169,15 @@ class TestKanban(TestBaseKanban): self.assertTrue(self.env['stock.request'].search( [('kanban_id', '=', kanban_2.id)]) ) + with self.assertRaises(ValidationError): + wizard.on_barcode_scanned(kanban_3.name) + self.assertFalse(self.env['stock.request'].search( + [('kanban_id', '=', kanban_3.id)]) + ) + self.env['ir.config_parameter'].set_param( + 'stock_request_kanban.crc', '0') + wizard.on_barcode_scanned(kanban_3.name) + self.assertEqual(wizard.status_state, 0) + self.assertTrue(self.env['stock.request'].search( + [('kanban_id', '=', kanban_3.id)]) + )