diff --git a/stock_quant_manual_assign/README.rst b/stock_quant_manual_assign/README.rst index 5deca3a5f..c2bbb2134 100644 --- a/stock_quant_manual_assign/README.rst +++ b/stock_quant_manual_assign/README.rst @@ -1,5 +1,5 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :target: http://www.gnu.org/licenses/agpl :alt: License: AGPL-3 =============================== @@ -14,12 +14,17 @@ Usage To use this module, you need to: #. Select a stock move or a stock picking. +#. Click on the tab "Initial Demand". +#. Click on the line which you need to select quants. #. Open the wizard with the button "Manual Quants". -#. Select the quants to assign (reserve). +#. Select the quants to assign (reserve), then Confirm. +#. Close the stock move line windows (which is popup by step 3). +#. Click on the tab "Operations" +#. Click on the "Recompute" to update the stock move info. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/9.0 + :target: https://runbot.odoo-community.org/runbot/153/10.0 Bug Tracker =========== @@ -32,6 +37,11 @@ help us smashing it by providing a detailed and welcomed feedback. Credits ======= +Images +------ + +* Odoo Community Association: `Icon `_. + Contributors ------------ @@ -39,6 +49,7 @@ Contributors * Pedro M. Baeza * Ana Juaristi * Oihane Crucelaegui +* Fanha Giang Maintainer ---------- diff --git a/stock_quant_manual_assign/__manifest__.py b/stock_quant_manual_assign/__manifest__.py index fa107679f..2dc9015d0 100644 --- a/stock_quant_manual_assign/__manifest__.py +++ b/stock_quant_manual_assign/__manifest__.py @@ -1,19 +1,20 @@ # -*- coding: utf-8 -*- -# (c) 2015 Mikel Arregi - AvanzOSC -# (c) 2016 Tecnativa - Pedro M. Baeza -# (c) 2017 Eficent - Jordi Ballester +# Copyright 2015 Mikel Arregi - AvanzOSC +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Eficent - Jordi Ballester # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Stock - Manual Quant Assignment", - "version": "9.0.1.0.0", + "version": "10.0.1.0.0", "category": "Warehouse Management", "license": "AGPL-3", "author": "AvanzOSC, " "Tecnativa, " "Eficent, " + "Fanha Giang, " "Odoo Community Association (OCA)", - "website": "http://www.odoomrp.com", + "website": "https://odoo-community.org", "depends": [ "stock", ], diff --git a/stock_quant_manual_assign/models/stock_picking.py b/stock_quant_manual_assign/models/stock_picking.py index 656107d96..0502d9d8e 100644 --- a/stock_quant_manual_assign/models/stock_picking.py +++ b/stock_quant_manual_assign/models/stock_picking.py @@ -2,7 +2,7 @@ # (c) 2015 Mikel Arregi - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from openerp import fields, models +from odoo import fields, models class StockMove(models.Model): diff --git a/stock_quant_manual_assign/static/description/step1.png b/stock_quant_manual_assign/static/description/step1.png new file mode 100644 index 000000000..8472953fa Binary files /dev/null and b/stock_quant_manual_assign/static/description/step1.png differ diff --git a/stock_quant_manual_assign/static/description/step2.png b/stock_quant_manual_assign/static/description/step2.png new file mode 100644 index 000000000..d6e7765f8 Binary files /dev/null and b/stock_quant_manual_assign/static/description/step2.png differ diff --git a/stock_quant_manual_assign/static/description/step3.png b/stock_quant_manual_assign/static/description/step3.png new file mode 100644 index 000000000..198c79eed Binary files /dev/null and b/stock_quant_manual_assign/static/description/step3.png differ diff --git a/stock_quant_manual_assign/static/description/step4.png b/stock_quant_manual_assign/static/description/step4.png new file mode 100644 index 000000000..e800754ed Binary files /dev/null and b/stock_quant_manual_assign/static/description/step4.png differ diff --git a/stock_quant_manual_assign/tests/test_stock_quant_manual_assign.py b/stock_quant_manual_assign/tests/test_stock_quant_manual_assign.py index a07300e08..19c9cdb88 100644 --- a/stock_quant_manual_assign/tests/test_stock_quant_manual_assign.py +++ b/stock_quant_manual_assign/tests/test_stock_quant_manual_assign.py @@ -2,8 +2,8 @@ # (c) 2015 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -import openerp.tests.common as common -from openerp import exceptions +import odoo.tests.common as common +from odoo import exceptions class TestStockQuantManualAssign(common.TransactionCase): diff --git a/stock_quant_manual_assign/views/stock_move_view.xml b/stock_quant_manual_assign/views/stock_move_view.xml index c015de1aa..873802d2e 100644 --- a/stock_quant_manual_assign/views/stock_move_view.xml +++ b/stock_quant_manual_assign/views/stock_move_view.xml @@ -31,4 +31,4 @@ - \ No newline at end of file + diff --git a/stock_quant_manual_assign/wizard/assign_manual_quants.py b/stock_quant_manual_assign/wizard/assign_manual_quants.py index 1347b0fcb..ff0205381 100644 --- a/stock_quant_manual_assign/wizard/assign_manual_quants.py +++ b/stock_quant_manual_assign/wizard/assign_manual_quants.py @@ -3,9 +3,9 @@ # (c) 2015 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from openerp import api, exceptions, fields, models, _ -import openerp.addons.decimal_precision as dp -from openerp.tools.float_utils import float_compare +from odoo import _, api, exceptions, fields, models +import odoo.addons.decimal_precision as dp +from odoo.tools.float_utils import float_compare class AssignManualQuants(models.TransientModel): @@ -14,13 +14,13 @@ class AssignManualQuants(models.TransientModel): @api.multi @api.constrains('quants_lines') def check_qty(self): - precision_digits = dp.get_precision('Product Unit of Measure' - )(self.env.cr)[1] + precision_digits = self.env[ + 'decimal.precision'].precision_get('Product Unit of Measure') move = self.env['stock.move'].browse(self.env.context['active_id']) - for record in self.filtered(lambda x: x.quants_lines): + for record in self.filtered('quants_lines'): if float_compare(record.lines_qty, move.product_qty, precision_digits=precision_digits) > 0: - raise exceptions.Warning( + raise exceptions.UserError( _('Quantity is higher than the needed one')) @api.depends('quants_lines', 'quants_lines.qty') @@ -51,11 +51,9 @@ class AssignManualQuants(models.TransientModel): move.picking_id.recompute_pack_op = True for quant_id in move.reserved_quant_ids.ids: move.write({'reserved_quant_ids': [[3, quant_id]]}) - for line in self.quants_lines: - if line.selected: - quants.append([line.quant, line.qty]) - self.pool['stock.quant'].quants_reserve( - self.env.cr, self.env.uid, quants, move, context=self.env.context) + for line in self.quants_lines.filtered('selected'): + quants.append([line.quant, line.qty]) + self.env['stock.quant'].quants_reserve(quants, move) return {} @api.model @@ -73,6 +71,7 @@ class AssignManualQuants(models.TransientModel): quants_lines = [{ 'quant': x.id, 'lot_id': x.lot_id.id, + 'in_date': x.in_date, 'package_id': x.package_id.id, 'selected': x in move.reserved_quant_ids, 'qty': x.qty if x in move.reserved_quant_ids else 0, @@ -112,6 +111,8 @@ class AssignManualQuantsLines(models.TransientModel): comodel_name='stock.production.lot', string='Lot', related='quant.lot_id', readonly=True, groups="stock.group_production_lot") + in_date = fields.Date( + string='Incoming Date', readonly=True) package_id = fields.Many2one( comodel_name='stock.quant.package', string='Package', related='quant.package_id', readonly=True, diff --git a/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml b/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml index da9c66d3b..cd5c28c80 100644 --- a/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml +++ b/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml @@ -10,6 +10,7 @@ + @@ -32,4 +33,4 @@ - \ No newline at end of file +