From 81e697035d639e861665a76b7b584a913499da95 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Thu, 5 Nov 2015 13:46:38 +0100 Subject: [PATCH 01/11] Add 'stock_quant_merge/' from commit '990e069455614dcd0781086e6af1f68ab2d021a0' git-subtree-dir: stock_quant_merge git-subtree-mainline: 3a0b6cfd13b0d63a47629a33103a5965fc22a141 git-subtree-split: 990e069455614dcd0781086e6af1f68ab2d021a0 --- stock_quant_merge/README.rst | 14 +++++++++ stock_quant_merge/__init__.py | 6 ++++ stock_quant_merge/__openerp__.py | 38 ++++++++++++++++++++++++ stock_quant_merge/i18n/es.po | 23 +++++++++++++++ stock_quant_merge/i18n/fr.po | 23 +++++++++++++++ stock_quant_merge/i18n/pt_BR.po | 23 +++++++++++++++ stock_quant_merge/i18n/sl.po | 23 +++++++++++++++ stock_quant_merge/models/__init__.py | 6 ++++ stock_quant_merge/models/stock.py | 43 ++++++++++++++++++++++++++++ 9 files changed, 199 insertions(+) create mode 100644 stock_quant_merge/README.rst create mode 100644 stock_quant_merge/__init__.py create mode 100644 stock_quant_merge/__openerp__.py create mode 100644 stock_quant_merge/i18n/es.po create mode 100644 stock_quant_merge/i18n/fr.po create mode 100644 stock_quant_merge/i18n/pt_BR.po create mode 100644 stock_quant_merge/i18n/sl.po create mode 100644 stock_quant_merge/models/__init__.py create mode 100644 stock_quant_merge/models/stock.py diff --git a/stock_quant_merge/README.rst b/stock_quant_merge/README.rst new file mode 100644 index 000000000..c9dd3c29a --- /dev/null +++ b/stock_quant_merge/README.rst @@ -0,0 +1,14 @@ +Quant merge +=========== + +This module allows to merge diferent quants if they meet some requirements. + + +Credits +======= + +Contributors +------------ +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi \ No newline at end of file diff --git a/stock_quant_merge/__init__.py b/stock_quant_merge/__init__.py new file mode 100644 index 000000000..054c8853d --- /dev/null +++ b/stock_quant_merge/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models diff --git a/stock_quant_merge/__openerp__.py b/stock_quant_merge/__openerp__.py new file mode 100644 index 000000000..b05fb203e --- /dev/null +++ b/stock_quant_merge/__openerp__.py @@ -0,0 +1,38 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +{ + "name": "Stock - Quant merge", + "version": "1.0", + "depends": [ + "stock", + ], + "author": "OdooMRP team," + "AvanzOSC," + "Serv. Tecnol. Avanzados - Pedro M. Baeza", + "website": "http://www.odoomrp.com", + "contributors": [ + "Oihane Crucelaegui ", + "Pedro M. Baeza ", + "Ana Juaristi " + ], + "category": "Warehouse Management", + "summary": "", + "data": [], + "installable": True, +} diff --git a/stock_quant_merge/i18n/es.po b/stock_quant_merge/i18n/es.po new file mode 100644 index 000000000..9388249a7 --- /dev/null +++ b/stock_quant_merge/i18n/es.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-10-09 10:50+0000\n" +"Last-Translator: Pedro M. Baeza \n" +"Language-Team: Spanish (http://www.transifex.com/oca/odoomrp-wip-8-0/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_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Quants" diff --git a/stock_quant_merge/i18n/fr.po b/stock_quant_merge/i18n/fr.po new file mode 100644 index 000000000..99d8ca634 --- /dev/null +++ b/stock_quant_merge/i18n/fr.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-09-10 16:35+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/odoomrp-wip-8-0/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_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Quants" diff --git a/stock_quant_merge/i18n/pt_BR.po b/stock_quant_merge/i18n/pt_BR.po new file mode 100644 index 000000000..0fcf08022 --- /dev/null +++ b/stock_quant_merge/i18n/pt_BR.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-10-09 03:19+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/odoomrp-wip-8-0/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_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Quants" diff --git a/stock_quant_merge/i18n/sl.po b/stock_quant_merge/i18n/sl.po new file mode 100644 index 000000000..f5cfbcebe --- /dev/null +++ b/stock_quant_merge/i18n/sl.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-09-20 19:06+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/odoomrp-wip-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: stock_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Kvant" diff --git a/stock_quant_merge/models/__init__.py b/stock_quant_merge/models/__init__.py new file mode 100644 index 000000000..055886a14 --- /dev/null +++ b/stock_quant_merge/models/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import stock diff --git a/stock_quant_merge/models/stock.py b/stock_quant_merge/models/stock.py new file mode 100644 index 000000000..c2356fdae --- /dev/null +++ b/stock_quant_merge/models/stock.py @@ -0,0 +1,43 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import models, api + + +class StockQuant(models.Model): + _inherit = 'stock.quant' + + @api.multi + def merge_stock_quants(self): + pending_quants = self.filtered(lambda x: True) + for quant2merge in self: + if (quant2merge in pending_quants and + not quant2merge.reservation_id): + quants = self.search( + [('id', '!=', quant2merge.id), + ('product_id', '=', quant2merge.product_id.id), + ('lot_id', '=', quant2merge.lot_id.id), + ('package_id', '=', quant2merge.package_id.id), + ('location_id', '=', quant2merge.location_id.id), + ('reservation_id', '=', False), + ('propagated_from_id', '=', + quant2merge.propagated_from_id.id)]) + cont = 1 + cost = quant2merge.cost + for quant in quants: + if (self._get_latest_move(quant2merge) == + self._get_latest_move(quant)): + quant2merge.sudo().qty += quant.qty + cost += quant.cost + cont += 1 + pending_quants -= quant + quant.sudo().unlink() + quant2merge.sudo().cost = cost / cont + + @api.model + def quants_unreserve(self, move): + quants = move.reserved_quant_ids + super(StockQuant, self).quants_unreserve(move) + quants.merge_stock_quants() From abec66ed955716e025a4eafa3d4a5832df023b5d Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Thu, 26 Nov 2015 12:02:38 +0100 Subject: [PATCH 02/11] Adopt OCA conventions Use OCA's the README template Adapt manifest, add OCA as author Update copyright notices --- stock_quant_merge/README.rst | 50 ++++++++++++++++++++++++++-- stock_quant_merge/__init__.py | 9 ++--- stock_quant_merge/__openerp__.py | 37 ++++++-------------- stock_quant_merge/models/__init__.py | 9 ++--- stock_quant_merge/models/stock.py | 9 ++--- 5 files changed, 73 insertions(+), 41 deletions(-) diff --git a/stock_quant_merge/README.rst b/stock_quant_merge/README.rst index c9dd3c29a..641da82e9 100644 --- a/stock_quant_merge/README.rst +++ b/stock_quant_merge/README.rst @@ -1,8 +1,39 @@ +.. 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 + +=========== Quant merge =========== -This module allows to merge diferent quants if they meet some requirements. +Odoo splits quants each time a reservation is done: this module makes Odoo +merge them back if they still meet the following requirements: +* same product +* same serial number/lot +* same location +* same package + +Usage +===== + +The merge is done automatically when a reservation is undone. No user intervention is needed. + +.. 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/8.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 ======= @@ -11,4 +42,19 @@ Contributors ------------ * Oihane Crucelaegui * Pedro M. Baeza -* Ana Juaristi \ No newline at end of file +* Ana Juaristi + +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_quant_merge/__init__.py b/stock_quant_merge/__init__.py index 054c8853d..d50e8c06d 100644 --- a/stock_quant_merge/__init__.py +++ b/stock_quant_merge/__init__.py @@ -1,6 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 OdooMRP team +# © 2015 AvanzOSC +# © 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models diff --git a/stock_quant_merge/__openerp__.py b/stock_quant_merge/__openerp__.py index b05fb203e..cdf27c184 100644 --- a/stock_quant_merge/__openerp__.py +++ b/stock_quant_merge/__openerp__.py @@ -1,38 +1,21 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## - +# -*- coding: utf-8 -*- +# © 2015 OdooMRP team +# © 2015 AvanzOSC +# © 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Stock - Quant merge", - "version": "1.0", + "version": "8.0.1.0.0", "depends": [ "stock", ], "author": "OdooMRP team," "AvanzOSC," - "Serv. Tecnol. Avanzados - Pedro M. Baeza", + "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Odoo Community Association (OCA)", "website": "http://www.odoomrp.com", - "contributors": [ - "Oihane Crucelaegui ", - "Pedro M. Baeza ", - "Ana Juaristi " - ], "category": "Warehouse Management", - "summary": "", - "data": [], "installable": True, + "license": "AGPL-3", + "images": [], } diff --git a/stock_quant_merge/models/__init__.py b/stock_quant_merge/models/__init__.py index 055886a14..5e5e22c5e 100644 --- a/stock_quant_merge/models/__init__.py +++ b/stock_quant_merge/models/__init__.py @@ -1,6 +1,7 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 OdooMRP team +# © 2015 AvanzOSC +# © 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import stock diff --git a/stock_quant_merge/models/stock.py b/stock_quant_merge/models/stock.py index c2356fdae..5fed1152c 100644 --- a/stock_quant_merge/models/stock.py +++ b/stock_quant_merge/models/stock.py @@ -1,7 +1,8 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- +# © 2015 OdooMRP team +# © 2015 AvanzOSC +# © 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import models, api From 330fcf41cc8e3a4ab78520132d4bfbd053075120 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Thu, 26 Nov 2015 12:43:32 +0100 Subject: [PATCH 03/11] Add an automatic test --- stock_quant_merge/README.rst | 1 + stock_quant_merge/tests/__init__.py | 5 ++ stock_quant_merge/tests/test_merge.py | 70 +++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 stock_quant_merge/tests/__init__.py create mode 100644 stock_quant_merge/tests/test_merge.py diff --git a/stock_quant_merge/README.rst b/stock_quant_merge/README.rst index 641da82e9..b5e48f2cf 100644 --- a/stock_quant_merge/README.rst +++ b/stock_quant_merge/README.rst @@ -43,6 +43,7 @@ Contributors * Oihane Crucelaegui * Pedro M. Baeza * Ana Juaristi +* Lionel Sausin Maintainer ---------- diff --git a/stock_quant_merge/tests/__init__.py b/stock_quant_merge/tests/__init__.py new file mode 100644 index 000000000..b4d071dd8 --- /dev/null +++ b/stock_quant_merge/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2014 Numérigraphe SARL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_merge diff --git a/stock_quant_merge/tests/test_merge.py b/stock_quant_merge/tests/test_merge.py new file mode 100644 index 000000000..fbd3f6d89 --- /dev/null +++ b/stock_quant_merge/tests/test_merge.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# © 2015 Numérigraphe SARL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests.common import TransactionCase + + +class TestMerge(TransactionCase): + """Test the potential quantity on a product with a multi-line BoM""" + + def setUp(self): + super(TestMerge, self).setUp() + + # Get the warehouses + self.wh_main = self.browse_ref('stock.warehouse0') + self.wh_ch = self.browse_ref('stock.stock_warehouse_shop0') + + # Get a product + self.product = self.browse_ref('product.product_product_4') + + # Zero out the inventory of the product + inventory = self.env['stock.inventory'].create( + {'name': 'Remove product for test', + 'location_id': self.ref('stock.stock_location_locations'), + 'filter': 'product', + 'product_id': self.product.id}) + inventory.prepare_inventory() + inventory.reset_real_qty() + inventory.action_done() + + # Make sure we have some products in Chicago + inventory = self.env['stock.inventory'].create( + {'name': 'Test stock available for reservation', + 'location_id': self.wh_ch.lot_stock_id.id, + 'filter': 'none'}) + inventory.prepare_inventory() + self.env['stock.inventory.line'].create({ + 'inventory_id': inventory.id, + 'product_id': self.product.id, + 'location_id': self.wh_ch.lot_stock_id.id, + 'product_qty': 10.0}) + inventory.action_done() + + def test_merge(self): + quant_obj = self.env['stock.quant'] + domain = [('location_id', '=', self.wh_ch.lot_stock_id.id), + ('product_id', '=', self.product.id)] + + quants = quant_obj.search(domain) + self.assertEqual(len(quants), 1, "There should be 1 quant") + + # Make a reservation to split the quant + move = self.env['stock.move'].create( + {'name': 'Test move', + 'product_id': self.product.id, + 'location_id': self.wh_ch.lot_stock_id.id, + 'location_dest_id': self.wh_main.lot_stock_id.id, + 'product_uom_qty': 5.0, + 'product_uom': self.product.uom_id.id}) + move.action_confirm() + move.action_assign() + + quants = quant_obj.search(domain) + self.assertEqual(len(quants), 2, "There should be 2 quants") + + # Cancel the move : the quants should be merged back together + move.action_cancel() + + quants = quant_obj.search(domain) + self.assertEqual(len(quants), 1, "There should be 1 quant") From 7dac9d65c21f2ca5baff7df140a01faed91dfcf4 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Thu, 26 Nov 2015 15:31:30 +0100 Subject: [PATCH 04/11] [IMP] make the merge domain modular MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As explained by Raphaël Valyi in https://github.com/OCA/stock-logistics-warehouse/pull/94#discussion_r45978223 : Some may need to override this domain. Example: in Brazil we will probably separate quants of the same product depending on if it comes from national origin or if it's imported. It's the same product in the MRP for instance. But for fiscal reports we cannot mix quants and we don't want to freak with lots for product origin. In this case we would need to override this domain, but may be there are other use cases. --- stock_quant_merge/models/stock.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/stock_quant_merge/models/stock.py b/stock_quant_merge/models/stock.py index 5fed1152c..27bcaa71b 100644 --- a/stock_quant_merge/models/stock.py +++ b/stock_quant_merge/models/stock.py @@ -10,21 +10,25 @@ from openerp import models, api class StockQuant(models.Model): _inherit = 'stock.quant' + @api.multi + def _mergeable_domain(self): + """Return the quants which may be merged with the current record""" + self.ensure_one() + return [('id', '!=', self.id), + ('product_id', '=', self.product_id.id), + ('lot_id', '=', self.lot_id.id), + ('package_id', '=', self.package_id.id), + ('location_id', '=', self.location_id.id), + ('reservation_id', '=', False), + ('propagated_from_id', '=', self.propagated_from_id.id)] + @api.multi def merge_stock_quants(self): pending_quants = self.filtered(lambda x: True) for quant2merge in self: if (quant2merge in pending_quants and not quant2merge.reservation_id): - quants = self.search( - [('id', '!=', quant2merge.id), - ('product_id', '=', quant2merge.product_id.id), - ('lot_id', '=', quant2merge.lot_id.id), - ('package_id', '=', quant2merge.package_id.id), - ('location_id', '=', quant2merge.location_id.id), - ('reservation_id', '=', False), - ('propagated_from_id', '=', - quant2merge.propagated_from_id.id)]) + quants = self.search(self._mergeable_domain()) cont = 1 cost = quant2merge.cost for quant in quants: From 2105eacc3e38ca4dcf37fff6ff4b10cdb90c84e8 Mon Sep 17 00:00:00 2001 From: Lionel Sausin Date: Thu, 26 Nov 2015 16:21:20 +0100 Subject: [PATCH 05/11] Explain intent of pending_quants and simplify loop condition As suggested by @oihane --- stock_quant_merge/models/stock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stock_quant_merge/models/stock.py b/stock_quant_merge/models/stock.py index 27bcaa71b..5c506abb8 100644 --- a/stock_quant_merge/models/stock.py +++ b/stock_quant_merge/models/stock.py @@ -24,10 +24,10 @@ class StockQuant(models.Model): @api.multi def merge_stock_quants(self): - pending_quants = self.filtered(lambda x: True) - for quant2merge in self: - if (quant2merge in pending_quants and - not quant2merge.reservation_id): + # Get a copy of the recorset + pending_quants = self.browse(self.ids) + for quant2merge in self.filtered(lambda x: not x.reservation_id): + if quant2merge in pending_quants: quants = self.search(self._mergeable_domain()) cont = 1 cost = quant2merge.cost From d41cd6037fd0e723ce557321692a84dd2a664193 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 5 Dec 2015 21:23:03 -0500 Subject: [PATCH 06/11] OCA Transbot updated translations from Transifex --- stock_quant_merge/i18n/en.po | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 stock_quant_merge/i18n/en.po diff --git a/stock_quant_merge/i18n/en.po b/stock_quant_merge/i18n/en.po new file mode 100644 index 000000000..940ab0e04 --- /dev/null +++ b/stock_quant_merge/i18n/en.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-04 01:47+0000\n" +"PO-Revision-Date: 2015-12-03 11:29+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Quants" From 4a32d721ea691924bc0e33ac27c8f8c29134d911 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 12 Dec 2015 11:24:48 +0100 Subject: [PATCH 07/11] [FIX] stock_quant_merge: Fixes #109 --- stock_quant_merge/models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_quant_merge/models/stock.py b/stock_quant_merge/models/stock.py index 5c506abb8..18ec4836f 100644 --- a/stock_quant_merge/models/stock.py +++ b/stock_quant_merge/models/stock.py @@ -28,7 +28,7 @@ class StockQuant(models.Model): pending_quants = self.browse(self.ids) for quant2merge in self.filtered(lambda x: not x.reservation_id): if quant2merge in pending_quants: - quants = self.search(self._mergeable_domain()) + quants = self.search(quant2merge._mergeable_domain()) cont = 1 cost = quant2merge.cost for quant in quants: From d1d8dea30b3d43aa92725bc1b60dddf1548ed6c6 Mon Sep 17 00:00:00 2001 From: oihane Date: Thu, 21 Jan 2016 14:48:04 +0100 Subject: [PATCH 08/11] [IMP] stock_quant_merge: modify context to force unlink change made into core in https://github.com/odoo/odoo/commit/4bd64dc91b11726c154a53662b0de91c29b0d718 in OCB https://github.com/OCA/OCB/commit/4bd64dc91b11726c154a53662b0de91c29b0d718 --- stock_quant_merge/models/stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_quant_merge/models/stock.py b/stock_quant_merge/models/stock.py index 18ec4836f..aaf70c89b 100644 --- a/stock_quant_merge/models/stock.py +++ b/stock_quant_merge/models/stock.py @@ -38,7 +38,7 @@ class StockQuant(models.Model): cost += quant.cost cont += 1 pending_quants -= quant - quant.sudo().unlink() + quant.with_context(force_unlink=True).sudo().unlink() quant2merge.sudo().cost = cost / cont @api.model From 9e7ad31146748e8316c515318ec9c5ff4b82e0fe Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 31 Jan 2016 00:24:23 -0500 Subject: [PATCH 09/11] OCA Transbot updated translations from Transifex --- stock_quant_merge/i18n/de.po | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 stock_quant_merge/i18n/de.po diff --git a/stock_quant_merge/i18n/de.po b/stock_quant_merge/i18n/de.po new file mode 100644 index 000000000..cd2df2bd4 --- /dev/null +++ b/stock_quant_merge/i18n/de.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-01-14 01:38+0000\n" +"PO-Revision-Date: 2015-12-03 11:29+0000\n" +"Last-Translator: <>\n" +"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/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_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Quants" From 6c9056e9b66deb77c6c84c148d9422ea9fa40030 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 13 Mar 2016 06:02:59 -0400 Subject: [PATCH 10/11] OCA Transbot updated translations from Transifex --- stock_quant_merge/i18n/fi.po | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 stock_quant_merge/i18n/fi.po diff --git a/stock_quant_merge/i18n/fi.po b/stock_quant_merge/i18n/fi.po new file mode 100644 index 000000000..32072a33c --- /dev/null +++ b/stock_quant_merge/i18n/fi.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_merge +# +# Translators: +# Miku Laitinen , 2016 +msgid "" +msgstr "" +"Project-Id-Version: stock-logistics-warehouse (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-04 07:59+0000\n" +"PO-Revision-Date: 2016-03-05 08:46+0000\n" +"Last-Translator: Miku Laitinen \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_quant_merge +#: model:ir.model,name:stock_quant_merge.model_stock_quant +msgid "Quants" +msgstr "Määrät" From 745d54502da3c2e6c45af4c1b85dfd44ebd7a672 Mon Sep 17 00:00:00 2001 From: Cyril Gaudin Date: Mon, 21 Mar 2016 14:06:08 +0100 Subject: [PATCH 11/11] [MOV] stock_quant_merge: make module uninstallable --- stock_quant_merge/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_quant_merge/__openerp__.py b/stock_quant_merge/__openerp__.py index cdf27c184..da087b8e2 100644 --- a/stock_quant_merge/__openerp__.py +++ b/stock_quant_merge/__openerp__.py @@ -15,7 +15,7 @@ "Odoo Community Association (OCA)", "website": "http://www.odoomrp.com", "category": "Warehouse Management", - "installable": True, + "installable": False, "license": "AGPL-3", "images": [], }