From 0713250276fc63ba2f1ee43e60446c96ef08b29d Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 30 Jul 2014 16:50:58 +0200 Subject: [PATCH] [MOD] Cambios realizados --- .../__openerp__.py | 13 +- .../i18n/en_US.po | 118 ------------------ .../i18n/es.po | 17 +-- .../stock_inventory_preparation_filters.pot | 5 - .../models/stock_inventory.py | 48 +++---- 5 files changed, 42 insertions(+), 159 deletions(-) delete mode 100644 stock_inventory_preparation_filters/i18n/en_US.po diff --git a/stock_inventory_preparation_filters/__openerp__.py b/stock_inventory_preparation_filters/__openerp__.py index 51ba4604f..470d306cd 100644 --- a/stock_inventory_preparation_filters/__openerp__.py +++ b/stock_inventory_preparation_filters/__openerp__.py @@ -28,10 +28,19 @@ ], "category": "Custom Module", "website": "http://www.odoomrp.com", - "complexity": "normal", "summary": "More filters for inventory adjustments", "description": """ - This module adds more filters to the inventory adjustments + More preparation filters for inventories + ======================================== + + Includes more options for making an inventory out of: + + * Multiple products. + * Products of a category. + * Multiple lots + + It also allows to make an inventory based on scanned products, adding a + line with product code and quantity """, "data": [ "views/stock_inventory_view.xml", diff --git a/stock_inventory_preparation_filters/i18n/en_US.po b/stock_inventory_preparation_filters/i18n/en_US.po deleted file mode 100644 index 73aebd936..000000000 --- a/stock_inventory_preparation_filters/i18n/en_US.po +++ /dev/null @@ -1,118 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * stock_inventory_preparation_filters -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0rc1\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-07-30 08:58+0000\n" -"PO-Revision-Date: 2014-07-30 08:58+0000\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_inventory_preparation_filters -#: view:stock.inventory:0 -#: field:stock.inventory,empty_line_ids:0 -msgid "Capture Lines" -msgstr "Capture Lines" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory,categ_ids:0 -msgid "Categories" -msgstr "Categories" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,create_uid:0 -msgid "Created by" -msgstr "Created by" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,create_date:0 -msgid "Created on" -msgstr "Created on" - -#. module: stock_inventory_preparation_filters -#: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:66 -#, python-format -msgid "Empty list" -msgstr "Empty list" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,id:0 -msgid "ID" -msgstr "ID" - -#. module: stock_inventory_preparation_filters -#: model:ir.model,name:stock_inventory_preparation_filters.model_stock_inventory -#: field:stock.inventory.line.empty,inventory_id:0 -msgid "Inventory" -msgstr "Inventory" - -#. module: stock_inventory_preparation_filters -#: view:stock.inventory:0 -msgid "Inventory Details" -msgstr "Inventory Details" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,write_uid:0 -msgid "Last Updated by" -msgstr "Last Updated by" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,write_date:0 -msgid "Last Updated on" -msgstr "Last Updated on" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory,lot_ids:0 -msgid "Lots" -msgstr "Lots" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,product_code:0 -msgid "Product Code" -msgstr "Product Code" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory,product_ids:0 -msgid "Products" -msgstr "Products" - -#. module: stock_inventory_preparation_filters -#: field:stock.inventory.line.empty,product_qty:0 -msgid "Quantity" -msgstr "Quantity" - -#. module: stock_inventory_preparation_filters -#: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:61 -#, python-format -msgid "Selected Categories" -msgstr "Selected Categories" - -#. module: stock_inventory_preparation_filters -#: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:65 -#, python-format -msgid "Selected Lots" -msgstr "Selected Lots" - -#. module: stock_inventory_preparation_filters -#: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:62 -#, python-format -msgid "Selected Products" -msgstr "Selected Products" - -#. module: stock_inventory_preparation_filters -#: model:ir.model,name:stock_inventory_preparation_filters.model_stock_inventory_line_empty -msgid "stock.inventory.line.empty" -msgstr "stock.inventory.line.empty" - -#. module: stock_inventory_preparation_filters -#: view:stock.inventory:0 -msgid "{'invisible':[('state','=','draft')]}" -msgstr "{'invisible':[('state','=','draft')]}" - diff --git a/stock_inventory_preparation_filters/i18n/es.po b/stock_inventory_preparation_filters/i18n/es.po index 807b1a1b3..baa74a0f9 100644 --- a/stock_inventory_preparation_filters/i18n/es.po +++ b/stock_inventory_preparation_filters/i18n/es.po @@ -40,7 +40,7 @@ msgstr "Creado el" #: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:66 #, python-format msgid "Empty list" -msgstr "Lista Vacia" +msgstr "Lista vacĂ­a" #. module: stock_inventory_preparation_filters #: field:stock.inventory.line.empty,id:0 @@ -56,7 +56,7 @@ msgstr "Inventario" #. module: stock_inventory_preparation_filters #: view:stock.inventory:0 msgid "Inventory Details" -msgstr "Detalles del Inventario" +msgstr "Detalles del inventario" #. module: stock_inventory_preparation_filters #: field:stock.inventory.line.empty,write_uid:0 @@ -76,7 +76,7 @@ msgstr "Lotes" #. module: stock_inventory_preparation_filters #: field:stock.inventory.line.empty,product_code:0 msgid "Product Code" -msgstr "Codigo de Producto" +msgstr "Codigo de producto" #. module: stock_inventory_preparation_filters #: field:stock.inventory,product_ids:0 @@ -92,27 +92,22 @@ msgstr "Cantidad" #: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:61 #, python-format msgid "Selected Categories" -msgstr "Categorias Seleccionadas" +msgstr "Categorias seleccionadas" #. module: stock_inventory_preparation_filters #: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:65 #, python-format msgid "Selected Lots" -msgstr "Lotes Seleccionados" +msgstr "Lotes seleccionados" #. module: stock_inventory_preparation_filters #: code:addons/stock_inventory_preparation_filters/models/stock_inventory.py:62 #, python-format msgid "Selected Products" -msgstr "Productos Seleccionados" +msgstr "Productos seleccionados" #. module: stock_inventory_preparation_filters #: model:ir.model,name:stock_inventory_preparation_filters.model_stock_inventory_line_empty msgid "stock.inventory.line.empty" msgstr "stock.inventory.line.empty" -#. module: stock_inventory_preparation_filters -#: view:stock.inventory:0 -msgid "{'invisible':[('state','=','draft')]}" -msgstr "{'invisible':[('state','=','draft')]}" - diff --git a/stock_inventory_preparation_filters/i18n/stock_inventory_preparation_filters.pot b/stock_inventory_preparation_filters/i18n/stock_inventory_preparation_filters.pot index 1fef11c8b..4a7f7738d 100644 --- a/stock_inventory_preparation_filters/i18n/stock_inventory_preparation_filters.pot +++ b/stock_inventory_preparation_filters/i18n/stock_inventory_preparation_filters.pot @@ -111,8 +111,3 @@ msgstr "" msgid "stock.inventory.line.empty" msgstr "" -#. module: stock_inventory_preparation_filters -#: view:stock.inventory:0 -msgid "{'invisible':[('state','=','draft')]}" -msgstr "" - diff --git a/stock_inventory_preparation_filters/models/stock_inventory.py b/stock_inventory_preparation_filters/models/stock_inventory.py index b410d5e5e..0bfd9d2bb 100644 --- a/stock_inventory_preparation_filters/models/stock_inventory.py +++ b/stock_inventory_preparation_filters/models/stock_inventory.py @@ -123,32 +123,34 @@ class StockInventory(orm.Model): tmp_lines = {} empty_line_obj = self.pool['stock.inventory.line.empty'] - for empty_line in inventory.empty_line_ids: - if empty_line.product_code in tmp_lines: - tmp_lines[empty_line.product_code] += empty_line.product_qty + for line in inventory.empty_line_ids: + if line.product_code in tmp_lines: + tmp_lines[line.product_code] += line.product_qty else: - tmp_lines[empty_line.product_code] = empty_line.product_qty - empty_line_obj.unlink(cr, uid, empty_line.id, context=context) + tmp_lines[line.product_code] = line.product_qty + empty_line_obj.unlink(cr, uid, inventory.empty_line_ids.ids, + context=context) for product_code in tmp_lines.keys(): - product_id = product_obj.search( + product_ids = product_obj.search( cr, uid, [('default_code', '=', product_code)], - context=context)[0] - product = product_obj.browse(cr, uid, product_id, - context=context) - fake_inventory = StockInventoryFake(inventory, product=product) - values = super(StockInventory, self)._get_inventory_lines( - cr, uid, fake_inventory, context=context) - if values: - values[0]['product_qty'] = tmp_lines[product_code] - tmp_lines.pop(product_code) - else: - empty_line_obj.create( - cr, uid, { - 'product_code': product_code, - 'product_qty': tmp_lines[product_code], - 'inventory_id': inventory.id, - }, context=context) - vals += values + context=context) + if product_ids: + product = product_obj.browse(cr, uid, product_ids[0], + context=context) + fake_inventory = StockInventoryFake(inventory, + product=product) + values = super(StockInventory, self)._get_inventory_lines( + cr, uid, fake_inventory, context=context) + if values: + values[0]['product_qty'] = tmp_lines[product_code] + else: + empty_line_obj.create( + cr, uid, { + 'product_code': product_code, + 'product_qty': tmp_lines[product_code], + 'inventory_id': inventory.id, + }, context=context) + vals += values return vals