From 07cdd955377421eb7b7cf89dd9b8455be315ee7f Mon Sep 17 00:00:00 2001 From: Zakaria Makrelouf Date: Wed, 6 Sep 2017 11:52:14 +0100 Subject: [PATCH 01/15] [9.0][IMP]stock_pack_operation_auto_fill: fill operations automatically --- stock_pack_operation_auto_fill/README.rst | 68 +++++++ stock_pack_operation_auto_fill/__init__.py | 1 + stock_pack_operation_auto_fill/__openerp__.py | 19 ++ .../models/__init__.py | 1 + .../models/stock_picking.py | 53 +++++ .../static/description/icon.png | Bin 0 -> 9455 bytes .../tests/__init__.py | 1 + .../tests/test_stock_picking.py | 191 ++++++++++++++++++ .../views/stock_picking.xml | 26 +++ 9 files changed, 360 insertions(+) create mode 100644 stock_pack_operation_auto_fill/README.rst create mode 100644 stock_pack_operation_auto_fill/__init__.py create mode 100644 stock_pack_operation_auto_fill/__openerp__.py create mode 100644 stock_pack_operation_auto_fill/models/__init__.py create mode 100644 stock_pack_operation_auto_fill/models/stock_picking.py create mode 100644 stock_pack_operation_auto_fill/static/description/icon.png create mode 100644 stock_pack_operation_auto_fill/tests/__init__.py create mode 100644 stock_pack_operation_auto_fill/tests/test_stock_picking.py create mode 100644 stock_pack_operation_auto_fill/views/stock_picking.xml diff --git a/stock_pack_operation_auto_fill/README.rst b/stock_pack_operation_auto_fill/README.rst new file mode 100644 index 000000000000..f4946607670b --- /dev/null +++ b/stock_pack_operation_auto_fill/README.rst @@ -0,0 +1,68 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================== +Stock Pack Operation Auto Fill +============================== + +In Odoo, if you schedule to transfer 50 products and only receive 49 products, +you have to change the quantity directly on the picking. As the quantity by +default is 0 for each line, you have to write the received quantity on 49 +lines. + +In this module we have added a button that helps users to fill automatically +the scheduled quantities. Then, the user can just change back +the quantities for the product that hasn't been received yet. + +Usage +===== + +After confirming the picking, click on `Auto fill operations` button. The Operations +matching the following conditions will be filled automatically: + +* The product has no tracking set (Technically `tracking` field should be equal to `none`). + +* The operation has not be processed (i.e `qty_done == 0`). + +* The operation has no package set (i.e `package_id` is empty). + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/154/9.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 smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Zakaria Makrelouf (ACSONE SA/NV) + +Maintainer +---------- + +.. 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. diff --git a/stock_pack_operation_auto_fill/__init__.py b/stock_pack_operation_auto_fill/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/stock_pack_operation_auto_fill/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_pack_operation_auto_fill/__openerp__.py b/stock_pack_operation_auto_fill/__openerp__.py new file mode 100644 index 000000000000..3301cab739cf --- /dev/null +++ b/stock_pack_operation_auto_fill/__openerp__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Stock Pack Operation Auto Fill', + 'summary': """ + Stock pack operation auto fill""", + 'version': '9.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'ACSONE SA/NV,Odoo Community Association (OCA)', + 'website': 'https://acsone.eu/', + 'depends': [ + 'stock' + ], + 'data': [ + 'views/stock_picking.xml', + ], +} diff --git a/stock_pack_operation_auto_fill/models/__init__.py b/stock_pack_operation_auto_fill/models/__init__.py new file mode 100644 index 000000000000..ae4c27227f18 --- /dev/null +++ b/stock_pack_operation_auto_fill/models/__init__.py @@ -0,0 +1 @@ +from . import stock_picking diff --git a/stock_pack_operation_auto_fill/models/stock_picking.py b/stock_pack_operation_auto_fill/models/stock_picking.py new file mode 100644 index 000000000000..83d1ee01cd84 --- /dev/null +++ b/stock_pack_operation_auto_fill/models/stock_picking.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import api, fields, models, _ +from openerp.exceptions import UserError + + +class StockPicking(models.Model): + + _inherit = 'stock.picking' + + action_pack_op_auto_fill_allowed = fields.Boolean( + compute='_compute_action_pack_operation_auto_fill_allowed', + readonly=True, + ) + + @api.depends('state', 'pack_operation_ids') + def _compute_action_pack_operation_auto_fill_allowed(self): + """ The auto fill button is allowed only in availabe or partially + available state, and the picking have pack operations. + """ + for rec in self: + rec.action_pack_op_auto_fill_allowed = \ + rec.state in ['partially_available', 'assigned'] and \ + rec.pack_operation_ids + + @api.multi + def _check_action_pack_operation_auto_fill_allowed(self): + if any(not r.action_pack_op_auto_fill_allowed for r in self): + raise UserError( + _("Filling the operations automatically is not possible, " + "perhaps the pickings aren't in the right state " + "(Partially available or available).")) + + @api.multi + def action_pack_operation_auto_fill(self): + """ Fill automatically pack operation for products with the following + conditions: + - there is no tracking set on the product (i.e tracking is none). + this condition can be checked by the field `lots_visible` on the + pack operation model. + - the package is not required, the package is required if the + the no product is set on the operation. + - the operation has no qty_done yet. + """ + self._check_action_pack_operation_auto_fill_allowed() + operations = self.mapped('pack_operation_ids') + operations_to_auto_fill = operations.filtered( + lambda op: not op.lots_visible and op.product_id and + not op.qty_done) + for op in operations_to_auto_fill: + op.qty_done = op.product_qty diff --git a/stock_pack_operation_auto_fill/static/description/icon.png b/stock_pack_operation_auto_fill/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary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Y>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/stock_pack_operation_auto_fill/tests/__init__.py b/stock_pack_operation_auto_fill/tests/__init__.py new file mode 100644 index 000000000000..438bdb918c8e --- /dev/null +++ b/stock_pack_operation_auto_fill/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_picking diff --git a/stock_pack_operation_auto_fill/tests/test_stock_picking.py b/stock_pack_operation_auto_fill/tests/test_stock_picking.py new file mode 100644 index 000000000000..266260303cc7 --- /dev/null +++ b/stock_pack_operation_auto_fill/tests/test_stock_picking.py @@ -0,0 +1,191 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp.tests.common import TransactionCase +from openerp.exceptions import UserError + + +class TestStockPicking(TransactionCase): + + def setUp(self): + super(TestStockPicking, self).setUp() + + # models + self.picking_model = self.env['stock.picking'] + self.move_model = self.env['stock.move'] + + # warehouse and picking types + self.warehouse = self.env.ref('stock.stock_warehouse_shop0') + self.picking_type_in = self.env.ref('stock.chi_picking_type_in') + self.picking_type_out = self.env.ref('stock.chi_picking_type_out') + self.supplier_location = self.env.ref('stock.stock_location_suppliers') + + # products + self.product_9 = self.env.ref('product.product_product_9') + self.product_8 = self.env.ref('product.product_product_8') + self.product_10 = self.env.ref('product.product_product_10') + self.product_11 = self.env.ref('product.product_product_11') + + # supplier + self.supplier = self.env.ref('base.res_partner_1') + + self.picking = self.picking_model.with_context( + default_picking_type_id=self.picking_type_in.id).create({ + 'partner_id': self.supplier.id, + 'picking_type_id': self.picking_type_in.id, + 'location_id': self.supplier_location.id}) + + def test_compute_action_pack_operation_auto_fill_allowed(self): + + self.move_model.create( + dict(product_id=self.product_9.id, + picking_id=self.picking.id, + name=self.product_9.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_9.uom_id.id)) + + # the auto fill action isn't available when picking is in draft + # state. + self.assertEqual(self.picking.state, 'draft') + self.assertFalse(self.picking.action_pack_op_auto_fill_allowed) + + # the auto fill action isn't available if no pack operation is + # created. + self.picking.state = 'assigned' + self.assertFalse(self.picking.action_pack_op_auto_fill_allowed) + + # The auto fill action is available when picking is assigned and + # the picking have already pack operations. + self.picking.action_confirm() + self.assertTrue(self.picking.action_pack_op_auto_fill_allowed) + + def test_check_action_pack_operation_auto_fill_allowed(self): + + self.move_model.create( + dict(product_id=self.product_9.id, + picking_id=self.picking.id, + name=self.product_9.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_9.uom_id.id)) + + # the auto fill action isn't available when picking is in draft + # state. + self.assertEqual(self.picking.state, 'draft') + with self.cr.savepoint(), self.assertRaises(UserError): + self.picking.action_pack_operation_auto_fill() + + # the auto fill action isn't available if no pack operation is + # created. + self.picking.state = 'assigned' + with self.cr.savepoint(), self.assertRaises(UserError): + self.picking.action_pack_operation_auto_fill() + + # The auto fill action is available when picking is assigned and + # the picking have already pack operations. + self.picking.action_confirm() + self.picking.action_pack_operation_auto_fill() + + def test_action_pack_operation_auto_fill(self): + + # set tracking on the products + self.picking_type_in.use_create_lots = True + self.product_9.tracking = 'none' + self.product_11.tracking = 'none' + self.product_8.tracking = 'lot' + self.product_10.tracking = 'serial' + + self.move_model.create( + dict(product_id=self.product_8.id, + picking_id=self.picking.id, + name=self.product_8.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_8.uom_id.id)) + + self.move_model.create( + dict(product_id=self.product_9.id, + picking_id=self.picking.id, + name=self.product_9.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_9.uom_id.id)) + + self.move_model.create( + dict(product_id=self.product_11.id, + picking_id=self.picking.id, + name=self.product_11.display_name + ' pack', + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_11.uom_id.id)) + + self.move_model.create( + dict(product_id=self.product_10.id, + picking_id=self.picking.id, + name=self.product_10.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_10.uom_id.id)) + + self.picking.action_confirm() + self.assertEqual(self.picking.state, 'assigned') + self.assertEqual(len(self.picking.pack_operation_ids), 4) + + # At this point for each move we have an operation created. + product_8_op = self.picking.pack_operation_ids.filtered( + lambda p: p.product_id == self.product_8) + self.assertTrue(product_8_op) + + product_9_op = self.picking.pack_operation_ids.filtered( + lambda p: p.product_id == self.product_9) + self.assertTrue(product_9_op) + + product_11_op = self.picking.pack_operation_ids.filtered( + lambda p: p.product_id == self.product_11) + self.assertTrue(product_11_op) + + # replace the product_id with a pack in for the product_11_op + # operation + pack = self.env['stock.quant.package'].create({ + 'quant_ids': [(0, 0, { + 'product_id': self.product_11.id, + 'qty': 1, + 'location_id': self.supplier_location.id, + 'product_uom_id': self.product_11.uom_id.id})]}) + + product_11_op.write( + {'product_id': False, + 'package_id': pack.id}) + + product_10_op = self.picking.pack_operation_ids.filtered( + lambda p: p.product_id == self.product_10) + self.assertTrue(product_10_op) + + # Try to fill all the operation automatically. + # The expected result is only opertions with product_id set and + # the product_id.tracking == none, have a qty_done set. + self.picking.action_pack_operation_auto_fill() + self.assertFalse(product_8_op.qty_done) + self.assertTrue(product_9_op.qty_done) + self.assertFalse(product_11_op.qty_done) + self.assertFalse(product_10_op.qty_done) diff --git a/stock_pack_operation_auto_fill/views/stock_picking.xml b/stock_pack_operation_auto_fill/views/stock_picking.xml new file mode 100644 index 000000000000..0c235442ff55 --- /dev/null +++ b/stock_pack_operation_auto_fill/views/stock_picking.xml @@ -0,0 +1,26 @@ + + + + + + + stock.picking.form (in stock_pack_operation_auto_fill) + stock.picking + + + + + From 6f36224a916b6bb10fd19e3f1975663df8b1ec78 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 9 Dec 2017 14:44:56 +0100 Subject: [PATCH 04/15] OCA Transbot updated translations from Transifex --- stock_pack_operation_auto_fill/i18n/de.po | 49 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/es.po | 49 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/fr.po | 49 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/it.po | 49 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/nl_NL.po | 49 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/pt.po | 49 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/pt_BR.po | 49 ++++++++++++++++++++ 7 files changed, 343 insertions(+) create mode 100644 stock_pack_operation_auto_fill/i18n/de.po create mode 100644 stock_pack_operation_auto_fill/i18n/es.po create mode 100644 stock_pack_operation_auto_fill/i18n/fr.po create mode 100644 stock_pack_operation_auto_fill/i18n/it.po create mode 100644 stock_pack_operation_auto_fill/i18n/nl_NL.po create mode 100644 stock_pack_operation_auto_fill/i18n/pt.po create mode 100644 stock_pack_operation_auto_fill/i18n/pt_BR.po diff --git a/stock_pack_operation_auto_fill/i18n/de.po b/stock_pack_operation_auto_fill/i18n/de.po new file mode 100644 index 000000000000..e8e26d51dd75 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/de.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Lieferung vornehmen" diff --git a/stock_pack_operation_auto_fill/i18n/es.po b/stock_pack_operation_auto_fill/i18n/es.po new file mode 100644 index 000000000000..67f361816b75 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/es.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Transferir" diff --git a/stock_pack_operation_auto_fill/i18n/fr.po b/stock_pack_operation_auto_fill/i18n/fr.po new file mode 100644 index 000000000000..030048aae304 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/fr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Transfert" diff --git a/stock_pack_operation_auto_fill/i18n/it.po b/stock_pack_operation_auto_fill/i18n/it.po new file mode 100644 index 000000000000..8674f45f3a24 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/it.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Trasferisci" diff --git a/stock_pack_operation_auto_fill/i18n/nl_NL.po b/stock_pack_operation_auto_fill/i18n/nl_NL.po new file mode 100644 index 000000000000..815fb595d137 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/nl_NL.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Verplaats" diff --git a/stock_pack_operation_auto_fill/i18n/pt.po b/stock_pack_operation_auto_fill/i18n/pt.po new file mode 100644 index 000000000000..ddc13c4645a7 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/pt.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# Pedro Castro Silva , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-18 03:48+0000\n" +"PO-Revision-Date: 2017-12-18 03:48+0000\n" +"Last-Translator: Pedro Castro Silva , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Transferência" diff --git a/stock_pack_operation_auto_fill/i18n/pt_BR.po b/stock_pack_operation_auto_fill/i18n/pt_BR.po new file mode 100644 index 000000000000..6a5f9f964e50 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/pt_BR.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-03 03:55+0000\n" +"PO-Revision-Date: 2017-12-03 03:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action pack op auto fill allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "Auto fill operations" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Transferir" From 93b3ff3af09a6dac465198af88cb01be4a5a81aa Mon Sep 17 00:00:00 2001 From: Luis Triana Date: Tue, 16 Jan 2018 18:50:29 -0600 Subject: [PATCH 05/15] [MIG]stock_pack_operation_auto_fill: Migration to 11.0 --- stock_pack_operation_auto_fill/README.rst | 14 ++++++++++++-- stock_pack_operation_auto_fill/__init__.py | 2 ++ stock_pack_operation_auto_fill/__manifest__.py | 3 +-- stock_pack_operation_auto_fill/i18n/es.po | 8 ++++++-- .../models/__init__.py | 2 ++ .../models/stock_picking.py | 9 ++++----- .../tests/__init__.py | 2 ++ .../tests/test_stock_picking.py | 18 ++++++++---------- .../views/stock_picking.xml | 9 ++------- 9 files changed, 39 insertions(+), 28 deletions(-) diff --git a/stock_pack_operation_auto_fill/README.rst b/stock_pack_operation_auto_fill/README.rst index f4946607670b..c639b092cb7e 100644 --- a/stock_pack_operation_auto_fill/README.rst +++ b/stock_pack_operation_auto_fill/README.rst @@ -29,7 +29,7 @@ matching the following conditions will be filled automatically: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/154/9.0 + :target: https://runbot.odoo-community.org/runbot/154/11.0 Bug Tracker =========== @@ -45,12 +45,22 @@ Credits Images ------ -* Odoo Community Association: `Icon `_. +* Odoo Community Association: `Icon `_. Contributors ------------ * Zakaria Makrelouf (ACSONE SA/NV) +* Luis Triana (Jarsa Sistemas de S.A. de C.V.) + +Do not contact contributors directly about support or help with technical issues. + +Funders +------- + +The development of this module has been financially supported by: + +* ACSONE SA/NV Maintainer ---------- diff --git a/stock_pack_operation_auto_fill/__init__.py b/stock_pack_operation_auto_fill/__init__.py index 0650744f6bc6..69f7babdfb1a 100644 --- a/stock_pack_operation_auto_fill/__init__.py +++ b/stock_pack_operation_auto_fill/__init__.py @@ -1 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import models diff --git a/stock_pack_operation_auto_fill/__manifest__.py b/stock_pack_operation_auto_fill/__manifest__.py index 1ded71dbd530..536267f1b786 100644 --- a/stock_pack_operation_auto_fill/__manifest__.py +++ b/stock_pack_operation_auto_fill/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -6,7 +5,7 @@ 'name': 'Stock Pack Operation Auto Fill', 'summary': """ Stock pack operation auto fill""", - 'version': '10.0.1.0.1', + 'version': '11.0.1.0.1', 'license': 'AGPL-3', 'author': 'ACSONE SA/NV,Odoo Community Association (OCA)', 'website': 'https://acsone.eu/', diff --git a/stock_pack_operation_auto_fill/i18n/es.po b/stock_pack_operation_auto_fill/i18n/es.po index 67f361816b75..c4d40d271fd9 100644 --- a/stock_pack_operation_auto_fill/i18n/es.po +++ b/stock_pack_operation_auto_fill/i18n/es.po @@ -21,12 +21,12 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed msgid "Action pack op auto fill allowed" -msgstr "" +msgstr "Acción de auto-relleno disponible" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "Auto fill operations" -msgstr "" +msgstr "Auto rellenar operaciones" #. module: stock_pack_operation_auto_fill #: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 @@ -35,6 +35,8 @@ msgid "" "Filling the operations automatically is not possible, perhaps the pickings " "aren't in the right state (Partially available or available)." msgstr "" +"Llenar las operaciosn de forma automática no es posible, posiblemente los movimientos " +"no están en el estado correcto (Parcialmente disponible o Disponible)." #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view @@ -42,6 +44,8 @@ msgid "" "This button will automatically fill all operations that have no tracking set" " on the product, no processed qty and no selected package." msgstr "" +"Este botón va a llenar todas las operaciones de forma automática, si no tienen activada la trazabilidad" +" en el producto, ninguna cantidad procesada y ningún paquete seleccionado." #. module: stock_pack_operation_auto_fill #: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking diff --git a/stock_pack_operation_auto_fill/models/__init__.py b/stock_pack_operation_auto_fill/models/__init__.py index ae4c27227f18..d2fe3ff3ac24 100644 --- a/stock_pack_operation_auto_fill/models/__init__.py +++ b/stock_pack_operation_auto_fill/models/__init__.py @@ -1 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import stock_picking diff --git a/stock_pack_operation_auto_fill/models/stock_picking.py b/stock_pack_operation_auto_fill/models/stock_picking.py index 7ca30748f143..3a3e843888ba 100644 --- a/stock_pack_operation_auto_fill/models/stock_picking.py +++ b/stock_pack_operation_auto_fill/models/stock_picking.py @@ -1,8 +1,7 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models from odoo.exceptions import UserError @@ -15,7 +14,7 @@ class StockPicking(models.Model): readonly=True, ) - @api.depends('state', 'pack_operation_ids') + @api.depends('state', 'move_line_ids') def _compute_action_pack_operation_auto_fill_allowed(self): """ The auto fill button is allowed only in availabe or partially available state, and the picking have pack operations. @@ -23,7 +22,7 @@ def _compute_action_pack_operation_auto_fill_allowed(self): for rec in self: rec.action_pack_op_auto_fill_allowed = \ rec.state in ['partially_available', 'assigned'] and \ - rec.pack_operation_ids + rec.move_line_ids @api.multi def _check_action_pack_operation_auto_fill_allowed(self): @@ -45,7 +44,7 @@ def action_pack_operation_auto_fill(self): - the operation has no qty_done yet. """ self._check_action_pack_operation_auto_fill_allowed() - operations = self.mapped('pack_operation_ids') + operations = self.mapped('move_line_ids') operations_to_auto_fill = operations.filtered( lambda op: not op.lots_visible and op.product_id and not op.qty_done) diff --git a/stock_pack_operation_auto_fill/tests/__init__.py b/stock_pack_operation_auto_fill/tests/__init__.py index 438bdb918c8e..a8a5619c6a17 100644 --- a/stock_pack_operation_auto_fill/tests/__init__.py +++ b/stock_pack_operation_auto_fill/tests/__init__.py @@ -1 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import test_stock_picking diff --git a/stock_pack_operation_auto_fill/tests/test_stock_picking.py b/stock_pack_operation_auto_fill/tests/test_stock_picking.py index 192e807f47ae..da05ce7eeb67 100644 --- a/stock_pack_operation_auto_fill/tests/test_stock_picking.py +++ b/stock_pack_operation_auto_fill/tests/test_stock_picking.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2017 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -149,18 +148,18 @@ def test_action_pack_operation_auto_fill(self): self.picking.action_confirm() self.assertEqual(self.picking.state, 'assigned') - self.assertEqual(len(self.picking.pack_operation_ids), 4) + self.assertEqual(len(self.picking.move_line_ids), 4) # At this point for each move we have an operation created. - product_8_op = self.picking.pack_operation_ids.filtered( + product_8_op = self.picking.move_line_ids.filtered( lambda p: p.product_id == self.product_8) self.assertTrue(product_8_op) - product_9_op = self.picking.pack_operation_ids.filtered( + product_9_op = self.picking.move_line_ids.filtered( lambda p: p.product_id == self.product_9) self.assertTrue(product_9_op) - product_11_op = self.picking.pack_operation_ids.filtered( + product_11_op = self.picking.move_line_ids.filtered( lambda p: p.product_id == self.product_11) self.assertTrue(product_11_op) @@ -169,15 +168,14 @@ def test_action_pack_operation_auto_fill(self): pack = self.env['stock.quant.package'].create({ 'quant_ids': [(0, 0, { 'product_id': self.product_11.id, - 'qty': 1, + 'quantity': 1, 'location_id': self.supplier_location.id, 'product_uom_id': self.product_11.uom_id.id})]}) product_11_op.write( - {'product_id': False, - 'package_id': pack.id}) + {'package_id': pack.id}) - product_10_op = self.picking.pack_operation_ids.filtered( + product_10_op = self.picking.move_line_ids.filtered( lambda p: p.product_id == self.product_10) self.assertTrue(product_10_op) @@ -187,5 +185,5 @@ def test_action_pack_operation_auto_fill(self): self.picking.action_pack_operation_auto_fill() self.assertFalse(product_8_op.qty_done) self.assertTrue(product_9_op.qty_done) - self.assertFalse(product_11_op.qty_done) + self.assertTrue(product_11_op.qty_done) self.assertFalse(product_10_op.qty_done) diff --git a/stock_pack_operation_auto_fill/views/stock_picking.xml b/stock_pack_operation_auto_fill/views/stock_picking.xml index ea3433e5a8dd..f8f80ca29bb3 100644 --- a/stock_pack_operation_auto_fill/views/stock_picking.xml +++ b/stock_pack_operation_auto_fill/views/stock_picking.xml @@ -1,24 +1,19 @@ - - - stock.picking.form (in stock_pack_operation_auto_fill) stock.picking - - From 8cb2effd298fd110132c47e2a50dc18466abc66e Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 3 Mar 2018 16:34:28 +0100 Subject: [PATCH 06/15] OCA Transbot updated translations from Transifex --- stock_pack_operation_auto_fill/i18n/cs_CZ.po | 53 ++++++++++++++++++++ stock_pack_operation_auto_fill/i18n/es.po | 30 +++++------ stock_pack_operation_auto_fill/i18n/fr.po | 27 ++++++---- 3 files changed, 86 insertions(+), 24 deletions(-) create mode 100644 stock_pack_operation_auto_fill/i18n/cs_CZ.po diff --git a/stock_pack_operation_auto_fill/i18n/cs_CZ.po b/stock_pack_operation_auto_fill/i18n/cs_CZ.po new file mode 100644 index 000000000000..c308940482e4 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/cs_CZ.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-28 08:51+0000\n" +"PO-Revision-Date: 2018-02-28 08:51+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: cs_CZ\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action Pack Op Auto Fill Allowed" +msgstr "Možnost automatického vyplnění akce pack op" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "AutoFill" +msgstr "Automatické vyplňování" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:31 +#, python-format +msgid "" +"Filling the operations automatically is not possible, perhaps the pickings " +"aren't in the right state (Partially available or available)." +msgstr "" +"Automatické vyplňování operací není možné, sběrnice pravděpodobně nejsou ve " +"správném stavu (částečně dostupné nebo dostupné)." + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "" +"This button will automatically fill all operations that have no tracking set" +" on the product, no processed qty and no selected package." +msgstr "" +"Toto tlačítko automaticky vyplní všechny operace, které nemají na produktu " +"žádný sledovací soubor, žádné zpracované množství a žádný vybraný balíček." + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "Převod" diff --git a/stock_pack_operation_auto_fill/i18n/es.po b/stock_pack_operation_auto_fill/i18n/es.po index c4d40d271fd9..26681a517c0b 100644 --- a/stock_pack_operation_auto_fill/i18n/es.po +++ b/stock_pack_operation_auto_fill/i18n/es.po @@ -3,14 +3,14 @@ # * stock_pack_operation_auto_fill # # Translators: -# OCA Transbot , 2017 +# OCA Transbot , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-03 03:55+0000\n" -"PO-Revision-Date: 2017-12-03 03:55+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-28 08:51+0000\n" +"PO-Revision-Date: 2018-02-28 08:51+0000\n" +"Last-Translator: OCA Transbot , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,23 +20,24 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" -msgstr "Acción de auto-relleno disponible" +msgid "Action Pack Op Auto Fill Allowed" +msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" -msgstr "Auto rellenar operaciones" +msgid "AutoFill" +msgstr "" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:31 #, python-format msgid "" "Filling the operations automatically is not possible, perhaps the pickings " "aren't in the right state (Partially available or available)." msgstr "" -"Llenar las operaciosn de forma automática no es posible, posiblemente los movimientos " -"no están en el estado correcto (Parcialmente disponible o Disponible)." +"Llenar las operaciosn de forma automática no es posible, posiblemente los " +"movimientos no están en el estado correcto (Parcialmente disponible o " +"Disponible)." #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view @@ -44,8 +45,9 @@ msgid "" "This button will automatically fill all operations that have no tracking set" " on the product, no processed qty and no selected package." msgstr "" -"Este botón va a llenar todas las operaciones de forma automática, si no tienen activada la trazabilidad" -" en el producto, ninguna cantidad procesada y ningún paquete seleccionado." +"Este botón va a llenar todas las operaciones de forma automática, si no " +"tienen activada la trazabilidad en el producto, ninguna cantidad procesada y" +" ningún paquete seleccionado." #. module: stock_pack_operation_auto_fill #: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking diff --git a/stock_pack_operation_auto_fill/i18n/fr.po b/stock_pack_operation_auto_fill/i18n/fr.po index 030048aae304..da42b66d2988 100644 --- a/stock_pack_operation_auto_fill/i18n/fr.po +++ b/stock_pack_operation_auto_fill/i18n/fr.po @@ -3,14 +3,15 @@ # * stock_pack_operation_auto_fill # # Translators: -# OCA Transbot , 2017 +# OCA Transbot , 2018 +# Quentin THEURET , 2018 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-12-03 03:55+0000\n" -"PO-Revision-Date: 2017-12-03 03:55+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"POT-Creation-Date: 2018-02-28 08:51+0000\n" +"PO-Revision-Date: 2018-02-28 08:51+0000\n" +"Last-Translator: Quentin THEURET , 2018\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,21 +21,24 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" -msgstr "" +msgid "Action Pack Op Auto Fill Allowed" +msgstr "Action Pack Op Auto Fill Allowed" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" -msgstr "" +msgid "AutoFill" +msgstr "Remplissage automatique" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:31 #, python-format msgid "" "Filling the operations automatically is not possible, perhaps the pickings " "aren't in the right state (Partially available or available)." msgstr "" +"Remplir les opérations automatiquement n'est pas possible, peut-être que les" +" opérations de stock ne sont pas dans le bon état (partiellement disponible " +"ou disponible)" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view @@ -42,6 +46,9 @@ msgid "" "This button will automatically fill all operations that have no tracking set" " on the product, no processed qty and no selected package." msgstr "" +"Ce bouton va automatiquement remplir toutes les opérations qui n'ont pas de " +"suivi renseigné sur le produit, pas de quantité traitée et pas de paquet " +"sélectionné." #. module: stock_pack_operation_auto_fill #: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking From dff3eca071de9b51efa3d426a4293129655a9a8c Mon Sep 17 00:00:00 2001 From: SaraiOsorio Date: Wed, 14 Feb 2018 10:45:04 -0600 Subject: [PATCH 07/15] [FIX][stock_pack_operation_auto_fill] - Wrong qty done when use different UoM. --- .../models/stock_picking.py | 3 +- .../tests/test_stock_picking.py | 33 ++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/stock_pack_operation_auto_fill/models/stock_picking.py b/stock_pack_operation_auto_fill/models/stock_picking.py index 3a3e843888ba..53961b9eaa91 100644 --- a/stock_pack_operation_auto_fill/models/stock_picking.py +++ b/stock_pack_operation_auto_fill/models/stock_picking.py @@ -1,4 +1,5 @@ # Copyright 2017 ACSONE SA/NV +# Copyright 2018 JARSA Sistemas S.A. de C.V. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models @@ -49,4 +50,4 @@ def action_pack_operation_auto_fill(self): lambda op: not op.lots_visible and op.product_id and not op.qty_done) for op in operations_to_auto_fill: - op.qty_done = op.product_qty + op.qty_done = op.product_uom_qty diff --git a/stock_pack_operation_auto_fill/tests/test_stock_picking.py b/stock_pack_operation_auto_fill/tests/test_stock_picking.py index da05ce7eeb67..a5699a29fbc0 100644 --- a/stock_pack_operation_auto_fill/tests/test_stock_picking.py +++ b/stock_pack_operation_auto_fill/tests/test_stock_picking.py @@ -21,10 +21,11 @@ def setUp(self): self.supplier_location = self.env.ref('stock.stock_location_suppliers') # products - self.product_9 = self.env.ref('product.product_product_9') self.product_8 = self.env.ref('product.product_product_8') + self.product_9 = self.env.ref('product.product_product_9') self.product_10 = self.env.ref('product.product_product_10') self.product_11 = self.env.ref('product.product_product_11') + self.product_12 = self.env.ref('product.product_product_12') # supplier self.supplier = self.env.ref('base.res_partner_1') @@ -34,6 +35,7 @@ def setUp(self): 'partner_id': self.supplier.id, 'picking_type_id': self.picking_type_in.id, 'location_id': self.supplier_location.id}) + self.dozen = self.env.ref('product.product_uom_dozen') def test_compute_action_pack_operation_auto_fill_allowed(self): @@ -97,10 +99,10 @@ def test_action_pack_operation_auto_fill(self): # set tracking on the products self.picking_type_in.use_create_lots = True - self.product_9.tracking = 'none' - self.product_11.tracking = 'none' self.product_8.tracking = 'lot' + self.product_9.tracking = 'none' self.product_10.tracking = 'serial' + self.product_11.tracking = 'none' self.move_model.create( dict(product_id=self.product_8.id, @@ -124,6 +126,17 @@ def test_action_pack_operation_auto_fill(self): default_location_dest_id.id, product_uom=self.product_9.uom_id.id)) + self.move_model.create( + dict(product_id=self.product_10.id, + picking_id=self.picking.id, + name=self.product_10.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_10.uom_id.id)) + self.move_model.create( dict(product_id=self.product_11.id, picking_id=self.picking.id, @@ -136,19 +149,19 @@ def test_action_pack_operation_auto_fill(self): product_uom=self.product_11.uom_id.id)) self.move_model.create( - dict(product_id=self.product_10.id, + dict(product_id=self.product_12.id, picking_id=self.picking.id, - name=self.product_10.display_name, + name=self.product_12.display_name, picking_type_id=self.picking_type_in.id, product_uom_qty=1.0, location_id=self.supplier_location.id, location_dest_id=self.picking_type_in. default_location_dest_id.id, - product_uom=self.product_10.uom_id.id)) + product_uom=self.dozen.id)) self.picking.action_confirm() self.assertEqual(self.picking.state, 'assigned') - self.assertEqual(len(self.picking.move_line_ids), 4) + self.assertEqual(len(self.picking.move_line_ids), 5) # At this point for each move we have an operation created. product_8_op = self.picking.move_line_ids.filtered( @@ -163,6 +176,9 @@ def test_action_pack_operation_auto_fill(self): lambda p: p.product_id == self.product_11) self.assertTrue(product_11_op) + product_12_op = self.picking.move_line_ids.filtered( + lambda p: p.product_id == self.product_12) + # replace the product_id with a pack in for the product_11_op # operation pack = self.env['stock.quant.package'].create({ @@ -185,5 +201,6 @@ def test_action_pack_operation_auto_fill(self): self.picking.action_pack_operation_auto_fill() self.assertFalse(product_8_op.qty_done) self.assertTrue(product_9_op.qty_done) - self.assertTrue(product_11_op.qty_done) self.assertFalse(product_10_op.qty_done) + self.assertTrue(product_11_op.qty_done) + self.assertEqual(product_12_op.product_uom_qty, product_12_op.qty_done) From 840e8a3cc313166ef899a6fa98554374681837fa Mon Sep 17 00:00:00 2001 From: oca-travis Date: Sat, 23 Jun 2018 23:25:20 +0000 Subject: [PATCH 08/15] [UPD] Update stock_pack_operation_auto_fill.pot --- stock_pack_operation_auto_fill/i18n/cs_CZ.po | 13 +++--- stock_pack_operation_auto_fill/i18n/de.po | 12 +++--- stock_pack_operation_auto_fill/i18n/es.po | 14 +++---- stock_pack_operation_auto_fill/i18n/fr.po | 14 +++---- stock_pack_operation_auto_fill/i18n/it.po | 12 +++--- stock_pack_operation_auto_fill/i18n/nl_NL.po | 15 +++---- stock_pack_operation_auto_fill/i18n/pt.po | 12 +++--- stock_pack_operation_auto_fill/i18n/pt_BR.po | 15 +++---- .../i18n/stock_pack_operation_auto_fill.pot | 41 +++++++++++++++++++ 9 files changed, 96 insertions(+), 52 deletions(-) create mode 100644 stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot diff --git a/stock_pack_operation_auto_fill/i18n/cs_CZ.po b/stock_pack_operation_auto_fill/i18n/cs_CZ.po index c308940482e4..66bde292bae8 100644 --- a/stock_pack_operation_auto_fill/i18n/cs_CZ.po +++ b/stock_pack_operation_auto_fill/i18n/cs_CZ.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # Lukáš Spurný , 2018 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2018-02-28 08:51+0000\n" "PO-Revision-Date: 2018-02-28 08:51+0000\n" "Last-Translator: Lukáš Spurný , 2018\n" -"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: cs_CZ\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: stock_pack_operation_auto_fill @@ -29,7 +30,7 @@ msgid "AutoFill" msgstr "Automatické vyplňování" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:31 +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 #, python-format msgid "" "Filling the operations automatically is not possible, perhaps the pickings " @@ -41,8 +42,8 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" "Toto tlačítko automaticky vyplní všechny operace, které nemají na produktu " "žádný sledovací soubor, žádné zpracované množství a žádný vybraný balíček." diff --git a/stock_pack_operation_auto_fill/i18n/de.po b/stock_pack_operation_auto_fill/i18n/de.po index e8e26d51dd75..9c45f8fad2c1 100644 --- a/stock_pack_operation_auto_fill/i18n/de.po +++ b/stock_pack_operation_auto_fill/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,20 +12,20 @@ msgstr "" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" +msgid "Action Pack Op Auto Fill Allowed" msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" +msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill @@ -39,8 +39,8 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" #. module: stock_pack_operation_auto_fill diff --git a/stock_pack_operation_auto_fill/i18n/es.po b/stock_pack_operation_auto_fill/i18n/es.po index 26681a517c0b..a18d4b95e7bd 100644 --- a/stock_pack_operation_auto_fill/i18n/es.po +++ b/stock_pack_operation_auto_fill/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # OCA Transbot , 2018 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2018-02-28 08:51+0000\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_pack_operation_auto_fill @@ -29,7 +29,7 @@ msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:31 +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 #, python-format msgid "" "Filling the operations automatically is not possible, perhaps the pickings " @@ -42,12 +42,12 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" "Este botón va a llenar todas las operaciones de forma automática, si no " -"tienen activada la trazabilidad en el producto, ninguna cantidad procesada y" -" ningún paquete seleccionado." +"tienen activada la trazabilidad en el producto, ninguna cantidad procesada y " +"ningún paquete seleccionado." #. module: stock_pack_operation_auto_fill #: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking diff --git a/stock_pack_operation_auto_fill/i18n/fr.po b/stock_pack_operation_auto_fill/i18n/fr.po index da42b66d2988..1762ec863945 100644 --- a/stock_pack_operation_auto_fill/i18n/fr.po +++ b/stock_pack_operation_auto_fill/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # OCA Transbot , 2018 # Quentin THEURET , 2018 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2018-02-28 08:51+0000\n" "Last-Translator: Quentin THEURET , 2018\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_pack_operation_auto_fill @@ -30,21 +30,21 @@ msgid "AutoFill" msgstr "Remplissage automatique" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:31 +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 #, python-format msgid "" "Filling the operations automatically is not possible, perhaps the pickings " "aren't in the right state (Partially available or available)." msgstr "" -"Remplir les opérations automatiquement n'est pas possible, peut-être que les" -" opérations de stock ne sont pas dans le bon état (partiellement disponible " +"Remplir les opérations automatiquement n'est pas possible, peut-être que les " +"opérations de stock ne sont pas dans le bon état (partiellement disponible " "ou disponible)" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" "Ce bouton va automatiquement remplir toutes les opérations qui n'ont pas de " "suivi renseigné sur le produit, pas de quantité traitée et pas de paquet " diff --git a/stock_pack_operation_auto_fill/i18n/it.po b/stock_pack_operation_auto_fill/i18n/it.po index 8674f45f3a24..f66c6d6fb25b 100644 --- a/stock_pack_operation_auto_fill/i18n/it.po +++ b/stock_pack_operation_auto_fill/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,20 +12,20 @@ msgstr "" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" +msgid "Action Pack Op Auto Fill Allowed" msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" +msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill @@ -39,8 +39,8 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" #. module: stock_pack_operation_auto_fill diff --git a/stock_pack_operation_auto_fill/i18n/nl_NL.po b/stock_pack_operation_auto_fill/i18n/nl_NL.po index 815fb595d137..6ce200b609c0 100644 --- a/stock_pack_operation_auto_fill/i18n/nl_NL.po +++ b/stock_pack_operation_auto_fill/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,21 +11,22 @@ msgstr "" "POT-Creation-Date: 2017-12-03 03:55+0000\n" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" +msgid "Action Pack Op Auto Fill Allowed" msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" +msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill @@ -39,8 +40,8 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" #. module: stock_pack_operation_auto_fill diff --git a/stock_pack_operation_auto_fill/i18n/pt.po b/stock_pack_operation_auto_fill/i18n/pt.po index ddc13c4645a7..07a707aae008 100644 --- a/stock_pack_operation_auto_fill/i18n/pt.po +++ b/stock_pack_operation_auto_fill/i18n/pt.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # Pedro Castro Silva , 2017 msgid "" @@ -12,20 +12,20 @@ msgstr "" "PO-Revision-Date: 2017-12-18 03:48+0000\n" "Last-Translator: Pedro Castro Silva , 2017\n" "Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" +msgid "Action Pack Op Auto Fill Allowed" msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" +msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill @@ -39,8 +39,8 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" #. module: stock_pack_operation_auto_fill diff --git a/stock_pack_operation_auto_fill/i18n/pt_BR.po b/stock_pack_operation_auto_fill/i18n/pt_BR.po index 6a5f9f964e50..9f959ede4ac4 100644 --- a/stock_pack_operation_auto_fill/i18n/pt_BR.po +++ b/stock_pack_operation_auto_fill/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * stock_pack_operation_auto_fill -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,21 +11,22 @@ msgstr "" "POT-Creation-Date: 2017-12-03 03:55+0000\n" "PO-Revision-Date: 2017-12-03 03:55+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed -msgid "Action pack op auto fill allowed" +msgid "Action Pack Op Auto Fill Allowed" msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view -msgid "Auto fill operations" +msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill @@ -39,8 +40,8 @@ msgstr "" #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" -"This button will automatically fill all operations that have no tracking set" -" on the product, no processed qty and no selected package." +"This button will automatically fill all operations that have no tracking set " +"on the product, no processed qty and no selected package." msgstr "" #. module: stock_pack_operation_auto_fill diff --git a/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot b/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot new file mode 100644 index 000000000000..a9a9f8fff4c2 --- /dev/null +++ b/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_pack_operation_auto_fill +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.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_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed +msgid "Action Pack Op Auto Fill Allowed" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "AutoFill" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#, python-format +msgid "Filling the operations automatically is not possible, perhaps the pickings aren't in the right state (Partially available or available)." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view +msgid "This button will automatically fill all operations that have no tracking set on the product, no processed qty and no selected package." +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking +msgid "Transfer" +msgstr "" + From 55f206b3afab10b5a0e98f38daa744b5af054fda Mon Sep 17 00:00:00 2001 From: Sergio Teruel Albert Date: Wed, 20 Jun 2018 00:25:38 +0200 Subject: [PATCH 09/15] [11.0][IMP] stock_pack_operation_auto_fill: Merge module stock_picking_transfer_lot_autoassign --- stock_pack_operation_auto_fill/README.rst | 142 +++++++++++++----- .../__manifest__.py | 15 +- stock_pack_operation_auto_fill/i18n/es.po | 35 ++++- .../migrations/11.0.2.0.0/post-migrate.py | 19 +++ .../models/__init__.py | 2 + .../models/stock_move.py | 25 +++ .../models/stock_picking.py | 25 +-- .../models/stock_picking_type.py | 16 ++ .../readme/CONFIGURE.rst | 12 ++ .../readme/CONTRIBUTORS.rst | 7 + .../readme/DESCRIPTION.rst | 24 +++ .../readme/USAGE.rst | 20 +++ .../static/description/icon.png | Bin 9455 -> 5538 bytes .../tests/__init__.py | 2 +- ...ing.py => test_stock_picking_auto_fill.py} | 124 ++++++++++++++- .../views/stock_picking.xml | 3 +- .../views/stock_picking_type_views.xml | 16 ++ 17 files changed, 421 insertions(+), 66 deletions(-) create mode 100644 stock_pack_operation_auto_fill/migrations/11.0.2.0.0/post-migrate.py create mode 100644 stock_pack_operation_auto_fill/models/stock_move.py create mode 100644 stock_pack_operation_auto_fill/models/stock_picking_type.py create mode 100644 stock_pack_operation_auto_fill/readme/CONFIGURE.rst create mode 100644 stock_pack_operation_auto_fill/readme/CONTRIBUTORS.rst create mode 100644 stock_pack_operation_auto_fill/readme/DESCRIPTION.rst create mode 100644 stock_pack_operation_auto_fill/readme/USAGE.rst rename stock_pack_operation_auto_fill/tests/{test_stock_picking.py => test_stock_picking_auto_fill.py} (62%) create mode 100644 stock_pack_operation_auto_fill/views/stock_picking_type_views.xml diff --git a/stock_pack_operation_auto_fill/README.rst b/stock_pack_operation_auto_fill/README.rst index c639b092cb7e..99b63504aa01 100644 --- a/stock_pack_operation_auto_fill/README.rst +++ b/stock_pack_operation_auto_fill/README.rst @@ -1,78 +1,142 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ============================== Stock Pack Operation Auto Fill ============================== -In Odoo, if you schedule to transfer 50 products and only receive 49 products, -you have to change the quantity directly on the picking. As the quantity by -default is 0 for each line, you have to write the received quantity on 49 -lines. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/11.0/stock_pack_operation_auto_fill + :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-11-0/stock-logistics-workflow-11-0-stock_pack_operation_auto_fill + :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/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module alow auto fill quantities in picking operations and autoassignment +lots quantities. + +In Odoo, if you schedule to transfer 50 product quantities and only receive 49 +quantities, you have to change the quantity directly on the picking. +As the quantity by default is 0 for each line, you have to write the received +quantity on 49 lines. In this module we have added a button that helps users to fill automatically -the scheduled quantities. Then, the user can just change back -the quantities for the product that hasn't been received yet. +the scheduled quantities. Then, the user can just change back the quantities +for the product that hasn't been received yet. + +Products with lots +================== +When working with lots, it's very uncomfortable to introduce the quantity, +lot by lot, when transferring pickings from your warehouse (outgoing or +internal). + +This module automatically assigns the reserved quantity as the done one, so +that you only have to change it in case of divergence, but having the +possibility of transferring directly. + +Also this module adds a button in backorder confirmation wizard to auto +complete to do quantities for products without lots. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +#. Make sure you have selected the proper removal strategy on your product + categories. +#. Configure the product on the page "Inventory", field "Tracking" with one of + these values: "By Unique Serial Number" or "By Lots" if you want autoassign + lots. +#. Check in Operation type if you want auto assign quantities, by default if + you want assign quantities done to reserved quantities you must push the + button "Auto Fill" when the picking is in ready state and has move lines +#. Check in Operation type if you do not want auto assign lots quantities with + "Avoid auto-assignment of lots". Usage ===== -After confirming the picking, click on `Auto fill operations` button. The Operations -matching the following conditions will be filled automatically: +Set options in operation types, you can set 'Auto fill operation' what make +autoassignment button invisible and fill the quantities in operations for lines +and 'Avoid Autoassignment Lots' what allow fill manually the lots quantities. -* The product has no tracking set (Technically `tracking` field should be equal to `none`). +Products without tracking lots +============================== +After confirming the picking, click on `Auto fill operations` button. The +Operations matching the following conditions will be filled automatically: * The operation has not be processed (i.e `qty_done == 0`). +* The operation has no package set (i.e `package_id` is empty). -* The operation has no package set (i.e `package_id` is empty). - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/154/11.0 +Product with lots +================= +#. Create an outgoing or an internal picking. +#. Include one product with lots and with enough stock. +#. Click on "Mark as Todo" button, and then on "Reserve". +#. Clicking on the icon with the three items bullet list on the "Operations" + tab you will see that the quantities have been auto-assigned on the "Done" + column. 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. +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 ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* ACSONE SA/NV Contributors ------------- +~~~~~~~~~~~~ * Zakaria Makrelouf (ACSONE SA/NV) * Luis Triana (Jarsa Sistemas de S.A. de C.V.) +* `Tecnativa `_: + * Pedro M. Baeza + * Vicent Cubells + * Sergio Teruel + * David Vidal -Do not contact contributors directly about support or help with technical issues. - -Funders -------- - -The development of this module has been financially supported by: +Maintainers +~~~~~~~~~~~ -* ACSONE SA/NV - -Maintainer ----------- +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-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_pack_operation_auto_fill/__manifest__.py b/stock_pack_operation_auto_fill/__manifest__.py index 536267f1b786..669fba61132d 100644 --- a/stock_pack_operation_auto_fill/__manifest__.py +++ b/stock_pack_operation_auto_fill/__manifest__.py @@ -1,18 +1,21 @@ # Copyright 2017 ACSONE SA/NV +# Copyright 2018 Tecnativa - Sergio Teruel # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Stock Pack Operation Auto Fill', - 'summary': """ - Stock pack operation auto fill""", - 'version': '11.0.1.0.1', + 'summary': "Stock pack operation auto fill", + 'version': '11.0.2.0.0', 'license': 'AGPL-3', - 'author': 'ACSONE SA/NV,Odoo Community Association (OCA)', - 'website': 'https://acsone.eu/', + 'author': 'ACSONE SA/NV,' + 'Tecnativa,' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/stock-logistics-workflow/', 'depends': [ - 'stock' + 'stock', ], 'data': [ 'views/stock_picking.xml', + 'views/stock_picking_type_views.xml', ], } diff --git a/stock_pack_operation_auto_fill/i18n/es.po b/stock_pack_operation_auto_fill/i18n/es.po index a18d4b95e7bd..06ad998fc114 100644 --- a/stock_pack_operation_auto_fill/i18n/es.po +++ b/stock_pack_operation_auto_fill/i18n/es.po @@ -8,28 +8,40 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-02-28 08:51+0000\n" -"PO-Revision-Date: 2018-02-28 08:51+0000\n" +"POT-Creation-Date: 2018-06-13 17:12+0200\n" +"PO-Revision-Date: 2018-06-13 17:13+0200\n" "Last-Translator: OCA Transbot , 2018\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" +"Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.7.1\n" #. module: stock_pack_operation_auto_fill #: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_action_pack_op_auto_fill_allowed msgid "Action Pack Op Auto Fill Allowed" msgstr "" +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_auto_fill_operation +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_type_auto_fill_operation +msgid "Auto fill operations" +msgstr "Autocompletar operaciones" + #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "AutoFill" -msgstr "" +msgstr "Autocompletar" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_type_avoid_lot_assignment +msgid "Avoid auto-assignment of lots" +msgstr "Evitar asignación automática de lotes" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:37 #, python-format msgid "" "Filling the operations automatically is not possible, perhaps the pickings " @@ -39,6 +51,16 @@ msgstr "" "movimientos no están en el estado correcto (Parcialmente disponible o " "Disponible)." +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_move +msgid "Stock Move" +msgstr "Movimiento de stock" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking_type +msgid "The operation type determines the picking view" +msgstr "" + #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "" @@ -53,3 +75,6 @@ msgstr "" #: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking msgid "Transfer" msgstr "Transferir" + +#~ msgid "The picking type determines the picking view" +#~ msgstr "El tipo de albarán determina la vista de albarán" diff --git a/stock_pack_operation_auto_fill/migrations/11.0.2.0.0/post-migrate.py b/stock_pack_operation_auto_fill/migrations/11.0.2.0.0/post-migrate.py new file mode 100644 index 000000000000..bef7cf278aab --- /dev/null +++ b/stock_pack_operation_auto_fill/migrations/11.0.2.0.0/post-migrate.py @@ -0,0 +1,19 @@ +# Copyright 2018 Sergio Teruel +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from openupgradelib import openupgrade +from openupgradelib import openupgrade_tools + + +@openupgrade.migrate() +def migrate(env, version): + # If exists the column and is False so the user wants automatic assignment + if openupgrade_tools.column_exists( + env.cr, 'stock_picking_type', 'avoid_internal_assignment'): + openupgrade.logged_query( + env.cr, """ + UPDATE stock_picking_type + SET auto_fill_operation = True, + avoid_lot_assignment = False + WHERE NOT avoid_internal_assignment""" + ) diff --git a/stock_pack_operation_auto_fill/models/__init__.py b/stock_pack_operation_auto_fill/models/__init__.py index d2fe3ff3ac24..e0277fb6483d 100644 --- a/stock_pack_operation_auto_fill/models/__init__.py +++ b/stock_pack_operation_auto_fill/models/__init__.py @@ -1,3 +1,5 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import stock_move from . import stock_picking +from . import stock_picking_type diff --git a/stock_pack_operation_auto_fill/models/stock_move.py b/stock_pack_operation_auto_fill/models/stock_move.py new file mode 100644 index 000000000000..dc1b02aa7bc8 --- /dev/null +++ b/stock_pack_operation_auto_fill/models/stock_move.py @@ -0,0 +1,25 @@ +# Copyright 2017 Pedro M. Baeza +# Copyright 2018 David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockMove(models.Model): + _inherit = 'stock.move' + + def _prepare_move_line_vals(self, quantity=None, reserved_quant=None): + """Auto-assign as done the quantity proposed for the lots""" + self.ensure_one() + res = super(StockMove, self)._prepare_move_line_vals( + quantity, reserved_quant, + ) + if not self.picking_id.auto_fill_operation: + return res + elif (self.picking_id.picking_type_id.avoid_lot_assignment and + res.get('lot_id')): + return res + res.update({ + 'qty_done': res.get('product_uom_qty', 0.0), + }) + return res diff --git a/stock_pack_operation_auto_fill/models/stock_picking.py b/stock_pack_operation_auto_fill/models/stock_picking.py index 53961b9eaa91..c19536311b2b 100644 --- a/stock_pack_operation_auto_fill/models/stock_picking.py +++ b/stock_pack_operation_auto_fill/models/stock_picking.py @@ -14,16 +14,20 @@ class StockPicking(models.Model): compute='_compute_action_pack_operation_auto_fill_allowed', readonly=True, ) + auto_fill_operation = fields.Boolean( + related='picking_type_id.auto_fill_operation', + string='Auto fill operations', + readonly=True, + ) @api.depends('state', 'move_line_ids') def _compute_action_pack_operation_auto_fill_allowed(self): - """ The auto fill button is allowed only in availabe or partially - available state, and the picking have pack operations. + """ The auto fill button is allowed only in ready state, and the + picking have pack operations. """ for rec in self: - rec.action_pack_op_auto_fill_allowed = \ - rec.state in ['partially_available', 'assigned'] and \ - rec.move_line_ids + rec.action_pack_op_auto_fill_allowed = ( + rec.state == 'assigned' and rec.move_line_ids) @api.multi def _check_action_pack_operation_auto_fill_allowed(self): @@ -37,17 +41,16 @@ def _check_action_pack_operation_auto_fill_allowed(self): def action_pack_operation_auto_fill(self): """ Fill automatically pack operation for products with the following conditions: - - there is no tracking set on the product (i.e tracking is none). - this condition can be checked by the field `lots_visible` on the - pack operation model. - the package is not required, the package is required if the the no product is set on the operation. - the operation has no qty_done yet. """ self._check_action_pack_operation_auto_fill_allowed() operations = self.mapped('move_line_ids') - operations_to_auto_fill = operations.filtered( - lambda op: not op.lots_visible and op.product_id and - not op.qty_done) + operations_to_auto_fill = operations.filtered(lambda op: ( + op.product_id and not op.qty_done and + (not op.lots_visible or + not op.picking_id.picking_type_id.avoid_lot_assignment) + )) for op in operations_to_auto_fill: op.qty_done = op.product_uom_qty diff --git a/stock_pack_operation_auto_fill/models/stock_picking_type.py b/stock_pack_operation_auto_fill/models/stock_picking_type.py new file mode 100644 index 000000000000..d0b9395393d3 --- /dev/null +++ b/stock_pack_operation_auto_fill/models/stock_picking_type.py @@ -0,0 +1,16 @@ +# Copyright 2017 Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockPickingType(models.Model): + _inherit = 'stock.picking.type' + + auto_fill_operation = fields.Boolean( + string="Auto fill operations", + ) + avoid_lot_assignment = fields.Boolean( + string="Avoid auto-assignment of lots", + default=True, + ) diff --git a/stock_pack_operation_auto_fill/readme/CONFIGURE.rst b/stock_pack_operation_auto_fill/readme/CONFIGURE.rst new file mode 100644 index 000000000000..0781f37e7c42 --- /dev/null +++ b/stock_pack_operation_auto_fill/readme/CONFIGURE.rst @@ -0,0 +1,12 @@ +To configure this module, you need to: + +#. Make sure you have selected the proper removal strategy on your product + categories. +#. Configure the product on the page "Inventory", field "Tracking" with one of + these values: "By Unique Serial Number" or "By Lots" if you want autoassign + lots. +#. Check in Operation type if you want auto assign quantities, by default if + you want assign quantities done to reserved quantities you must push the + button "Auto Fill" when the picking is in ready state and has move lines +#. Check in Operation type if you do not want auto assign lots quantities with + "Avoid auto-assignment of lots". diff --git a/stock_pack_operation_auto_fill/readme/CONTRIBUTORS.rst b/stock_pack_operation_auto_fill/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..4c9f7c604d7c --- /dev/null +++ b/stock_pack_operation_auto_fill/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Zakaria Makrelouf (ACSONE SA/NV) +* Luis Triana (Jarsa Sistemas de S.A. de C.V.) +* `Tecnativa `_: + * Pedro M. Baeza + * Vicent Cubells + * Sergio Teruel + * David Vidal diff --git a/stock_pack_operation_auto_fill/readme/DESCRIPTION.rst b/stock_pack_operation_auto_fill/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..17f505f46925 --- /dev/null +++ b/stock_pack_operation_auto_fill/readme/DESCRIPTION.rst @@ -0,0 +1,24 @@ +This module alow auto fill quantities in picking operations and autoassignment +lots quantities. + +In Odoo, if you schedule to transfer 50 product quantities and only receive 49 +quantities, you have to change the quantity directly on the picking. +As the quantity by default is 0 for each line, you have to write the received +quantity on 49 lines. + +In this module we have added a button that helps users to fill automatically +the scheduled quantities. Then, the user can just change back the quantities +for the product that hasn't been received yet. + +Products with lots +================== +When working with lots, it's very uncomfortable to introduce the quantity, +lot by lot, when transferring pickings from your warehouse (outgoing or +internal). + +This module automatically assigns the reserved quantity as the done one, so +that you only have to change it in case of divergence, but having the +possibility of transferring directly. + +Also this module adds a button in backorder confirmation wizard to auto +complete to do quantities for products without lots. diff --git a/stock_pack_operation_auto_fill/readme/USAGE.rst b/stock_pack_operation_auto_fill/readme/USAGE.rst new file mode 100644 index 000000000000..796cb757f592 --- /dev/null +++ b/stock_pack_operation_auto_fill/readme/USAGE.rst @@ -0,0 +1,20 @@ +Set options in operation types, you can set 'Auto fill operation' what make +autoassignment button invisible and fill the quantities in operations for lines +and 'Avoid Autoassignment Lots' what allow fill manually the lots quantities. + +Products without tracking lots +============================== +After confirming the picking, click on `Auto fill operations` button. The +Operations matching the following conditions will be filled automatically: + +* The operation has not be processed (i.e `qty_done == 0`). +* The operation has no package set (i.e `package_id` is empty). + +Product with lots +================= +#. Create an outgoing or an internal picking. +#. Include one product with lots and with enough stock. +#. Click on "Mark as Todo" button, and then on "Reserve". +#. Clicking on the icon with the three items bullet list on the "Operations" + tab you will see that the quantities have been auto-assigned on the "Done" + column. diff --git a/stock_pack_operation_auto_fill/static/description/icon.png b/stock_pack_operation_auto_fill/static/description/icon.png index 3a0328b516c4980e8e44cdb63fd945757ddd132d..1f1849da9ba4e48a766a392a05abdd7409b0ddbf 100644 GIT binary patch literal 5538 zcma)AcT`i$`b9wzL=aIxr6^oLklqPRA%KAN7CM6T-a_b#f)puHdR6I!-V;is_ugAV z6ELBdP!k^azWd($>$iS));eeQthK*6v(7m)-?w*!rn=G{@<-%EL_~L#UjenRdhDOq zt?O5JQafD8RY&Y8r>uMH)~&fEjm4|sT`vWYmyWBAm(LpyYa$&xZ!a%v537)2G9sb} zGRnZ0x{%qe1>YCp!8z)CKu6 zql^1h1`c6CcSO{Pb@xf6UeIW}K+i#gzh*TQ)GJV5SN}ELXs!ooELP8su!4xBgSQBRG7R2IvQ6L zVqe!}!R-e~8faz33mV~sE$5y)!B#1tS)b!9LDyL#$)GgZ139Sc z+YFe(89@?<&ZDNMcopan=goqX3NJ)_)VCJsn38mIZPI3aW0R}gipuIcws^!V*5?mk zowG9Hv3VD}1Vmr)PmMaBZO-BDR{bCb?M2)mE&(5P9CQ*)=ind1+=~En!e{%fR_EV^2TO8XMLb)AI;ZFFAUu(4^J{UQ3 zmLk=8rlk8Y4~Fy3<)9yH$F=dlkD}H^_XavpaxA8L^Q9WijR9B?u=LW2V}Lb^N@Q33 zabv5Db|&CpF)}!#@Gx0mU>{RBJ#XZGOzqkz);AQ{S8WU_rj#bda=C7r)nT1Hoa zI?uunTp8vn_kf9|ecidY{SP8Yns3WyZnsVu25iF{VUEf9GMvJS>(s+&vy_KNV_{8Xg z$6`IpE_bmf=(ZholhFmmem2Xr85!Fi4u#Pgk0}94DHe|u>I>*ZPdKcOmoY+871%E5 z^H|1nDV?r(v~8&O6~oC|Yhk8bO+IE2qhlcVHE*Ea02Qt=*)*%uKH430j-4+PI?5m* z8Wi~WBo#WD;aU|pdIf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5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I diff --git a/stock_pack_operation_auto_fill/tests/__init__.py b/stock_pack_operation_auto_fill/tests/__init__.py index a8a5619c6a17..51bcbc7d9fa0 100644 --- a/stock_pack_operation_auto_fill/tests/__init__.py +++ b/stock_pack_operation_auto_fill/tests/__init__.py @@ -1,3 +1,3 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from . import test_stock_picking +from . import test_stock_picking_auto_fill diff --git a/stock_pack_operation_auto_fill/tests/test_stock_picking.py b/stock_pack_operation_auto_fill/tests/test_stock_picking_auto_fill.py similarity index 62% rename from stock_pack_operation_auto_fill/tests/test_stock_picking.py rename to stock_pack_operation_auto_fill/tests/test_stock_picking_auto_fill.py index a5699a29fbc0..700a7cfb4a46 100644 --- a/stock_pack_operation_auto_fill/tests/test_stock_picking.py +++ b/stock_pack_operation_auto_fill/tests/test_stock_picking_auto_fill.py @@ -19,6 +19,7 @@ def setUp(self): self.picking_type_in = self.env.ref('stock.chi_picking_type_in') self.picking_type_out = self.env.ref('stock.chi_picking_type_out') self.supplier_location = self.env.ref('stock.stock_location_suppliers') + self.customer_location = self.env.ref('stock.stock_location_customers') # products self.product_8 = self.env.ref('product.product_product_8') @@ -29,12 +30,22 @@ def setUp(self): # supplier self.supplier = self.env.ref('base.res_partner_1') + # customer + self.customer = self.env.ref('base.res_partner_12') self.picking = self.picking_model.with_context( default_picking_type_id=self.picking_type_in.id).create({ 'partner_id': self.supplier.id, 'picking_type_id': self.picking_type_in.id, 'location_id': self.supplier_location.id}) + self.picking_out = self.picking_model.with_context( + default_picking_type_id=self.picking_type_out.id + ).create({ + 'partner_id': self.customer.id, + 'picking_type_id': self.picking_type_out.id, + 'location_id': self.picking_type_out.default_location_src_id.id, + 'location_dest_id': self.customer_location.id, + }) self.dozen = self.env.ref('product.product_uom_dozen') def test_compute_action_pack_operation_auto_fill_allowed(self): @@ -196,11 +207,118 @@ def test_action_pack_operation_auto_fill(self): self.assertTrue(product_10_op) # Try to fill all the operation automatically. - # The expected result is only opertions with product_id set and + # The expected result is only operations with product_id set and # the product_id.tracking == none, have a qty_done set. self.picking.action_pack_operation_auto_fill() self.assertFalse(product_8_op.qty_done) - self.assertTrue(product_9_op.qty_done) + self.assertEqual(product_9_op.product_uom_qty, product_9_op.qty_done) self.assertFalse(product_10_op.qty_done) - self.assertTrue(product_11_op.qty_done) + self.assertEqual(product_11_op.product_uom_qty, product_11_op.qty_done) self.assertEqual(product_12_op.product_uom_qty, product_12_op.qty_done) + + def test_action_auto_transfer(self): + # set tracking on the products + self.picking_type_in.auto_fill_operation = True + self.product_8.tracking = 'lot' + self.product_9.tracking = 'none' + + self.move_model.create( + dict(product_id=self.product_8.id, + picking_id=self.picking.id, + name=self.product_8.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_8.uom_id.id)) + + self.move_model.create( + dict(product_id=self.product_9.id, + picking_id=self.picking.id, + name=self.product_9.display_name, + picking_type_id=self.picking_type_in.id, + product_uom_qty=1.0, + location_id=self.supplier_location.id, + location_dest_id=self.picking_type_in. + default_location_dest_id.id, + product_uom=self.product_9.uom_id.id)) + + self.picking.action_assign() + + self.assertEqual(self.picking.state, 'assigned') + self.assertEqual(len(self.picking.move_line_ids), 2) + + # At this point for each move we have an operation created. + product_8_op = self.picking.move_line_ids.filtered( + lambda p: p.product_id == self.product_8) + self.assertTrue(product_8_op) + + product_9_op = self.picking.move_line_ids.filtered( + lambda p: p.product_id == self.product_9) + self.assertTrue(product_9_op) + + # Try to fill all the operation automatically. + # The expected result is only opertions with product_id set and + self.assertTrue(product_8_op.qty_done) + self.assertTrue(product_9_op.qty_done) + + def test_action_auto_transfer_avoid_assign_lots(self): + # set tracking on the products + self.picking_type_out.auto_fill_operation = True + self.picking_type_out.avoid_lot_assignment = True + self.product_8.tracking = 'lot' + self.product_9.tracking = 'none' + self.lot8 = self.env['stock.production.lot'].create({ + 'product_id': self.product_8.id, + 'name': 'Lot 1', + }) + self.quant8 = self.env['stock.quant'].create({ + 'product_id': self.product_8.id, + 'location_id': self.picking_out.location_id.id, + 'quantity': 6, + 'lot_id': self.lot8.id, + }) + self.quant9 = self.env['stock.quant'].create({ + 'product_id': self.product_9.id, + 'location_id': self.picking_out.location_id.id, + 'quantity': 10, + }) + self.move_model.create({ + 'product_id': self.product_8.id, + 'picking_id': self.picking_out.id, + 'name': self.product_8.display_name, + 'picking_type_id': self.picking_type_out.id, + 'product_uom_qty': 1.0, + 'location_id': self.picking_type_out.default_location_src_id.id, + 'location_dest_id': self.customer_location.id, + 'product_uom': self.product_8.uom_id.id, + }) + + self.move_model.create({ + 'product_id': self.product_9.id, + 'picking_id': self.picking_out.id, + 'name': self.product_9.display_name, + 'picking_type_id': self.picking_type_out.id, + 'product_uom_qty': 10.0, + 'location_id': self.picking_type_out.default_location_src_id.id, + 'location_dest_id': self.customer_location.id, + 'product_uom': self.product_9.uom_id.id, + }) + + self.picking_out.action_confirm() + self.picking_out.action_assign() + self.assertEqual(self.picking_out.state, 'assigned') + self.assertEqual(len(self.picking_out.move_line_ids), 2) + # At this point for each move we have an operation created. + product_8_op = self.picking_out.move_line_ids.filtered( + lambda p: p.product_id == self.product_8) + self.assertTrue(product_8_op) + product_9_op = self.picking_out.move_line_ids.filtered( + lambda p: p.product_id == self.product_9) + self.assertTrue(product_9_op) + + # Try to fill all the operation automatically. + # The expected result is only opertions with product_id set and + self.assertFalse(product_8_op.qty_done) + self.assertTrue(product_9_op.qty_done) diff --git a/stock_pack_operation_auto_fill/views/stock_picking.xml b/stock_pack_operation_auto_fill/views/stock_picking.xml index f8f80ca29bb3..d1a5b62a3432 100644 --- a/stock_pack_operation_auto_fill/views/stock_picking.xml +++ b/stock_pack_operation_auto_fill/views/stock_picking.xml @@ -10,9 +10,10 @@ type="object" class="btn btn-primary" string="AutoFill" - attrs="{'invisible': [('action_pack_op_auto_fill_allowed','=', False)]}" + attrs="{'invisible': ['|', ('action_pack_op_auto_fill_allowed','=', False), ('auto_fill_operation', '=', True)]}" help="This button will automatically fill all operations that have no tracking set on the product, no processed qty and no selected package."/> + diff --git a/stock_pack_operation_auto_fill/views/stock_picking_type_views.xml b/stock_pack_operation_auto_fill/views/stock_picking_type_views.xml new file mode 100644 index 000000000000..8499dee599a1 --- /dev/null +++ b/stock_pack_operation_auto_fill/views/stock_picking_type_views.xml @@ -0,0 +1,16 @@ + + + + + stock.picking.type.assignment + stock.picking.type + + + + + + + + + + From 7ac27e597dc573214dc402706e2fa8a2b65d2ae4 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 20 Sep 2018 20:09:42 +0000 Subject: [PATCH 10/15] [UPD] Update stock_pack_operation_auto_fill.pot --- .../i18n/stock_pack_operation_auto_fill.pot | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot b/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot index a9a9f8fff4c2..d51c24b867b0 100644 --- a/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot +++ b/stock_pack_operation_auto_fill/i18n/stock_pack_operation_auto_fill.pot @@ -18,17 +18,38 @@ msgstr "" msgid "Action Pack Op Auto Fill Allowed" msgstr "" +#. module: stock_pack_operation_auto_fill +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_auto_fill_operation +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_type_auto_fill_operation +msgid "Auto fill operations" +msgstr "" + #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "AutoFill" msgstr "" #. module: stock_pack_operation_auto_fill -#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:32 +#: model:ir.model.fields,field_description:stock_pack_operation_auto_fill.field_stock_picking_type_avoid_lot_assignment +msgid "Avoid auto-assignment of lots" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: code:addons/stock_pack_operation_auto_fill/models/stock_picking.py:36 #, python-format msgid "Filling the operations automatically is not possible, perhaps the pickings aren't in the right state (Partially available or available)." msgstr "" +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: stock_pack_operation_auto_fill +#: model:ir.model,name:stock_pack_operation_auto_fill.model_stock_picking_type +msgid "The operation type determines the picking view" +msgstr "" + #. module: stock_pack_operation_auto_fill #: model:ir.ui.view,arch_db:stock_pack_operation_auto_fill.stock_picking_form_view msgid "This button will automatically fill all operations that have no tracking set on the product, no processed qty and no selected package." From 8276013b673c8344527aafd4c80b21f850b31bda Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Fri, 21 Sep 2018 05:36:11 +0200 Subject: [PATCH 11/15] [UPD] README.rst --- stock_pack_operation_auto_fill/README.rst | 1 + .../static/description/index.html | 482 ++++++++++++++++++ 2 files changed, 483 insertions(+) create mode 100644 stock_pack_operation_auto_fill/static/description/index.html diff --git a/stock_pack_operation_auto_fill/README.rst b/stock_pack_operation_auto_fill/README.rst index 99b63504aa01..f327d3391529 100644 --- a/stock_pack_operation_auto_fill/README.rst +++ b/stock_pack_operation_auto_fill/README.rst @@ -112,6 +112,7 @@ Authors ~~~~~~~ * ACSONE SA/NV +* Tecnativa Contributors ~~~~~~~~~~~~ diff --git a/stock_pack_operation_auto_fill/static/description/index.html b/stock_pack_operation_auto_fill/static/description/index.html new file mode 100644 index 000000000000..8217d8e0f85a --- /dev/null +++ b/stock_pack_operation_auto_fill/static/description/index.html @@ -0,0 +1,482 @@ + + + + + + +Stock Pack Operation Auto Fill + + + + + + From e0e8b773c534030b808e0c9d53de1e100827f9f5 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 29 Oct 2018 18:08:33 +0100 Subject: [PATCH 12/15] [FIX] stock_pack_operation_auto_fill: Autofill button permissions Only stock users should be able to process done quantities. --- stock_pack_operation_auto_fill/__manifest__.py | 2 +- stock_pack_operation_auto_fill/views/stock_picking.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stock_pack_operation_auto_fill/__manifest__.py b/stock_pack_operation_auto_fill/__manifest__.py index 669fba61132d..cbe316883772 100644 --- a/stock_pack_operation_auto_fill/__manifest__.py +++ b/stock_pack_operation_auto_fill/__manifest__.py @@ -5,7 +5,7 @@ { 'name': 'Stock Pack Operation Auto Fill', 'summary': "Stock pack operation auto fill", - 'version': '11.0.2.0.0', + 'version': '11.0.2.0.1', 'license': 'AGPL-3', 'author': 'ACSONE SA/NV,' 'Tecnativa,' diff --git a/stock_pack_operation_auto_fill/views/stock_picking.xml b/stock_pack_operation_auto_fill/views/stock_picking.xml index d1a5b62a3432..17870a4e9dcd 100644 --- a/stock_pack_operation_auto_fill/views/stock_picking.xml +++ b/stock_pack_operation_auto_fill/views/stock_picking.xml @@ -3,6 +3,7 @@ stock.picking.form (in stock_pack_operation_auto_fill) stock.picking +
+

Stock Pack Operation Auto Fill

+ + +

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

+

This module alow auto fill quantities in picking operations and autoassignment +lots quantities.

+

In Odoo, if you schedule to transfer 50 product quantities and only receive 49 +quantities, you have to change the quantity directly on the picking. +As the quantity by default is 0 for each line, you have to write the received +quantity on 49 lines.

+

In this module we have added a button that helps users to fill automatically +the scheduled quantities. Then, the user can just change back the quantities +for the product that hasn’t been received yet.

+
+

Products with lots

+

When working with lots, it’s very uncomfortable to introduce the quantity, +lot by lot, when transferring pickings from your warehouse (outgoing or +internal).

+

This module automatically assigns the reserved quantity as the done one, so +that you only have to change it in case of divergence, but having the +possibility of transferring directly.

+

Also this module adds a button in backorder confirmation wizard to auto +complete to do quantities for products without lots.

+

Table of contents

+
+
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Make sure you have selected the proper removal strategy on your product +categories.
  2. +
  3. Configure the product on the page “Inventory”, field “Tracking” with one of +these values: “By Unique Serial Number” or “By Lots” if you want autoassign +lots.
  4. +
  5. Check in Operation type if you want auto assign quantities, by default if +you want assign quantities done to reserved quantities you must push the +button “Auto Fill” when the picking is in ready state and has move lines
  6. +
  7. Check in Operation type if you do not want auto assign lots quantities with +“Avoid auto-assignment of lots”.
  8. +
+
+
+

Usage

+

Set options in operation types, you can set ‘Auto fill operation’ what make +autoassignment button invisible and fill the quantities in operations for lines +and ‘Avoid Autoassignment Lots’ what allow fill manually the lots quantities.

+
+
+

Products without tracking lots

+

After confirming the picking, click on Auto fill operations button. The +Operations matching the following conditions will be filled automatically:

+
    +
  • The operation has not be processed (i.e qty_done == 0).
  • +
  • The operation has no package set (i.e package_id is empty).
  • +
+
+
+

Product with lots

+
    +
  1. Create an outgoing or an internal picking.
  2. +
  3. Include one product with lots and with enough stock.
  4. +
  5. Click on “Mark as Todo” button, and then on “Reserve”.
  6. +
  7. Clicking on the icon with the three items bullet list on the “Operations” +tab you will see that the quantities have been auto-assigned on the “Done” +column.
  8. +
+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
  • Tecnativa
  • +
+
+
+

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

+

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

+
+
+