diff --git a/stock_move_packaging/__init__.py b/stock_move_packaging/__init__.py deleted file mode 100644 index c2c2ebef6..000000000 --- a/stock_move_packaging/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -import stock -import wizard - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_move_packaging/__openerp__.py b/stock_move_packaging/__openerp__.py deleted file mode 100644 index 0eb3b3f33..000000000 --- a/stock_move_packaging/__openerp__.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -{ - "name" : "Move Stock Packaging", - "version" : "1.0", - "author" : "Julius Network Solutions", - "description" : """ - -Presentation: - -This module allows to move packing with a wizard -and adds fields for source location and destination location in History. - -""", - "website" : "http://www.julius.fr", - "depends" : [ - "stock", - "stock_tracking_extended", - ], - "category" : "Customs/Stock", - "init_xml" : [], - "demo_xml" : [], - "images" : ['images/Move packaging.png'], - "update_xml" : [ - 'stock_view.xml', - 'wizard/move_pack_view.xml', - ], - 'test': [], - 'installable': True, - 'active': False, - 'certificate': '', -} diff --git a/stock_move_packaging/i18n/fr.po b/stock_move_packaging/i18n/fr.po deleted file mode 100644 index 262bb3c13..000000000 --- a/stock_move_packaging/i18n/fr.po +++ /dev/null @@ -1,97 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * stock_move_packaging -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.3\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-12-19 10:47+0000\n" -"PO-Revision-Date: 2011-12-19 10:47+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_move_packaging -#: code:addons/stock_move_packaging/wizard/move_pack.py:58 -#, python-format -msgid "You cannot move this pack because there is a none closed pack inside of it: %s." -msgstr "Vous ne pouvez pas déplacer ce colis car il y a un pack non fermé à l'intérieur de celui-ci: %s." - -#. module: stock_move_packaging -#: field:stock.move.packaging,pack_id:0 -msgid "Pack to move" -msgstr "Colis à deplacer" - -#. module: stock_move_packaging -#: model:ir.model,name:stock_move_packaging.model_stock_tracking_history -msgid "stock.tracking.history" -msgstr "stock.tracking.history" - -#. module: stock_move_packaging -#: field:stock.tracking.history,location_id:0 -msgid "Source Location" -msgstr "Stockage source" - -#. module: stock_move_packaging -#: field:stock.tracking.history,location_dest_id:0 -msgid "Destination Location" -msgstr "Stockage de destination" - -#. module: stock_move_packaging -#: model:ir.module.module,description:stock_move_packaging.module_meta_information -msgid " This module allows to move packing with a wizard " -msgstr " Ce module permet de déplacer les colis avec un assistant " - -#. module: stock_move_packaging -#: code:addons/stock_move_packaging/wizard/move_pack.py:55 -#, python-format -msgid "You cannot move this pack because it's inside of an other pack: %s." -msgstr "Vous ne pouvez pas déplacer ce colis, car il est à l'intérieur d'un autre colis: %s." - -#. module: stock_move_packaging -#: model:ir.actions.act_window,name:stock_move_packaging.move_pack -#: view:stock.move.packaging:0 -msgid "Move Pack" -msgstr "Mouvement de colis" - -#. module: stock_move_packaging -#: model:ir.model,name:stock_move_packaging.model_stock_move_packaging -msgid "stock.move.packaging" -msgstr "stock.move.packaging" - -#. module: stock_move_packaging -#: code:addons/stock_move_packaging/wizard/move_pack.py:55 -#: code:addons/stock_move_packaging/wizard/move_pack.py:58 -#, python-format -msgid "Warning!" -msgstr "Attention!" - -#. module: stock_move_packaging -#: field:stock.move.packaging,location_dest_id:0 -msgid "Destination location" -msgstr "Stockage de Destination" - -#. module: stock_move_packaging -#: view:stock.move.packaging:0 -msgid "Cancel" -msgstr "Annuler" - -#. module: stock_move_packaging -#: view:stock.move.packaging:0 -msgid "Move it" -msgstr "Déplacer" - -#. module: stock_move_packaging -#: view:stock.tracking:0 -msgid "Move pack" -msgstr "Déplacer le colis" - -#. module: stock_move_packaging -#: model:ir.module.module,shortdesc:stock_move_packaging.module_meta_information -msgid "Move Stock Packaging" -msgstr "Mouvement de stocks de colis" - diff --git a/stock_move_packaging/images/Move packaging.png b/stock_move_packaging/images/Move packaging.png deleted file mode 100644 index 0c041adb3..000000000 Binary files a/stock_move_packaging/images/Move packaging.png and /dev/null differ diff --git a/stock_move_packaging/stock.py b/stock_move_packaging/stock.py deleted file mode 100644 index 0ea08bb8c..000000000 --- a/stock_move_packaging/stock.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -from osv import fields, osv -from tools.translate import _ - -class stock_tracking_history(osv.osv): - - _inherit = "stock.tracking.history" - - def _get_types(self, cr, uid, context={}): - res = super(stock_tracking_history, self)._get_types(cr, uid, context) - if not res: - res = [] - res = res + [('move','Move')] - return res - - _columns = { - 'type': fields.selection(_get_types, 'Type'), - 'location_id': fields.many2one('stock.location', 'Source Location'), - 'location_dest_id': fields.many2one('stock.location', 'Destination Location'), -# 'move_ids': fields.one2many('stock.move', 'pack_history_id', 'Associated moves'), - } - -stock_tracking_history() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_move_packaging/stock_view.xml b/stock_move_packaging/stock_view.xml deleted file mode 100755 index 10244ac65..000000000 --- a/stock_move_packaging/stock_view.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - stock.tracking.history.tree - stock.tracking.history - tree - - - - - - - - - - - stock.tracking.history.form - stock.tracking.history - form - - - - - - - - - - diff --git a/stock_move_packaging/wizard/__init__.py b/stock_move_packaging/wizard/__init__.py deleted file mode 100644 index 685cee2f9..000000000 --- a/stock_move_packaging/wizard/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -import move_pack - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_move_packaging/wizard/move_pack.py b/stock_move_packaging/wizard/move_pack.py deleted file mode 100644 index c59aa82f4..000000000 --- a/stock_move_packaging/wizard/move_pack.py +++ /dev/null @@ -1,105 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -from osv import fields, osv -from tools.translate import _ -import time - -class stock_move_packaging(osv.osv_memory): - - _name = "stock.move.packaging" - - _columns = { - 'pack_id': fields.many2one('stock.tracking', 'Pack to move', required=True), - 'location_dest_id': fields.many2one('stock.location', 'Destination location', required=True), - } - - _defaults = { - 'pack_id': lambda s,cr,uid,c: c.get('active_id',False), - } - - def move_pack(self, cr, uid, ids, context=None): - barcode_obj = self.pool.get('tr.barcode') - tracking_obj = self.pool.get('stock.tracking') - move_obj = self.pool.get('stock.move') - history_obj = self.pool.get('stock.tracking.history') - picking_obj = self.pool.get('stock.picking') - - if context == None: - context = {} - - context.update({'from_pack':True}) - for obj in self.browse(cr, uid, ids): - pack = obj.pack_id - if not pack or not obj.location_dest_id: - continue - if pack.parent_id: - raise osv.except_osv(_('Warning!'),_('You cannot move this pack because it\'s inside of an other pack: %s.') % (pack.parent_id.name)) - for child in pack.child_ids: - if child.state != 'close': - raise osv.except_osv(_('Warning!'),_('You cannot move this pack because there is a none closed pack inside of it: %s.') % (child.name)) - current_type = pack.location_id.usage - dest_type = obj.location_dest_id.usage - - pick_type = 'out' - if type == 'internal': - pick_type = 'internal' - elif type == 'supplier': - pick_type = 'in' - elif type == 'customer': - pick_type = 'out' - date = time.strftime('%Y-%m-%d %H:%M:%S'), - pick_id = picking_obj.create(cr, uid, { - 'type': pick_type, - 'auto_picking': 'draft', - 'company_id': self.pool.get('res.company')._company_default_get(cr, uid, 'stock.company', context=context), - 'address_id': obj.location_dest_id.address_id and obj.location_dest_id.address_id.id or False, - 'invoice_state': 'none', - 'date': date, - 'state': 'done', - }) - - child_packs = tracking_obj.hierarchy_ids(pack) - for child_pack in child_packs: - hist_id = history_obj.create(cr, uid, { - 'tracking_id': child_pack.id, - 'type': 'move', - 'location_id': child_pack.location_id.id, - 'location_dest_id': obj.location_dest_id.id, - }) - - for move in child_pack.current_move_ids: - defaults = { - 'location_id': move.location_dest_id.id, - 'location_dest_id': obj.location_dest_id.id, - 'picking_id': pick_id, - 'state': 'done', - 'date': date, - 'date_expected': date, - } - new_id = move_obj.copy(cr, uid, move.id, default=defaults, context=context) - move_obj.write(cr, uid, [move.id], {'pack_history_id': hist_id, 'move_dest_id': new_id}) - tracking_obj.write(cr, uid, [child_pack.id], {'location_id': obj.location_dest_id.id}) - return {'type': 'ir.actions.act_window_close'} - -stock_move_packaging() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_move_packaging/wizard/move_pack_view.xml b/stock_move_packaging/wizard/move_pack_view.xml deleted file mode 100755 index 9b112050b..000000000 --- a/stock_move_packaging/wizard/move_pack_view.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - Move Pack - stock.move.packaging - form - -
- - - - - - -
- -
-
diff --git a/stock_tracking_add_move/__init__.py b/stock_tracking_add_move/__init__.py deleted file mode 100644 index c2c2ebef6..000000000 --- a/stock_tracking_add_move/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -import stock -import wizard - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_tracking_add_move/__openerp__.py b/stock_tracking_add_move/__openerp__.py deleted file mode 100644 index cb42e11e7..000000000 --- a/stock_tracking_add_move/__openerp__.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -{ - "name" : "Stock tracking add moves", - "version" : "1.0", - "author" : "Julius Network Solutions", - "description" : """ - -Presentation: - -This module add a wizard to fill in packaging. -This wizard is used to add or remove an object from a package. -Adding to the historical movements and parent objects - -""", - "website" : "http://www.julius.fr", - "depends" : [ - "stock", - "stock_tracking_extended", - "tr_barcode", - ], - "category" : "Customs/Stock", - "init_xml" : [], - "demo_xml" : [], - "images" : ['images/Add move.png'], - "update_xml" : [ - 'wizard/add_move_view.xml', - 'stock_view.xml', - "security/ir.model.access.csv", - ], - 'test': [], - 'installable': True, - 'active': False, - 'certificate': '', -} diff --git a/stock_tracking_add_move/i18n/fr.po b/stock_tracking_add_move/i18n/fr.po deleted file mode 100644 index 59ed5fa13..000000000 --- a/stock_tracking_add_move/i18n/fr.po +++ /dev/null @@ -1,145 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * stock_tracking_add_move -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.3\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-12-19 10:45+0000\n" -"PO-Revision-Date: 2011-12-19 10:45+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_tracking_add_move -#: field:stock.packaging.move,pack_id:0 -msgid "Pack to move" -msgstr "Colis à déplacer" - -#. module: stock_tracking_add_move -#: model:ir.module.module,description:stock_tracking_add_move.module_meta_information -msgid " This module add a wizard to fill in packaging " -msgstr " Ce module ajoute un assistant pour remplir les colis " - -#. module: stock_tracking_add_move -#: field:stock.scan.to.validate,type:0 -msgid "Type" -msgstr "Type" - -#. module: stock_tracking_add_move -#: view:stock.packaging.move:0 -msgid "Add Move" -msgstr "Ajouter des mouvements" - -#. module: stock_tracking_add_move -#: selection:stock.scan.to.validate,type:0 -msgid "To remove" -msgstr "A supprimer" - -#. module: stock_tracking_add_move -#: field:stock.scan.to.validate,tracking_id:0 -msgid "Parent" -msgstr "Parent" - -#. module: stock_tracking_add_move -#: model:ir.model,name:stock_tracking_add_move.model_stock_tracking -msgid "Packs" -msgstr "Colis" - -#. module: stock_tracking_add_move -#: sql_constraint:stock.scan.to.validate:0 -msgid "This barcode is already in the list to add or to remove !" -msgstr "Ce code-barres est déjà dans la liste à ajouter ou à enlever !" - -#. module: stock_tracking_add_move -#: constraint:stock.tracking:0 -msgid "Bad parent type selection. Please try again." -msgstr "Mauvais choix du type de parent. S'il vous plaît essayez de nouveau." - -#. module: stock_tracking_add_move -#: field:stock.scan.to.validate,barcode_id:0 -msgid "Barcode" -msgstr "code-barres" - -#. module: stock_tracking_add_move -#: selection:stock.scan.to.validate,type:0 -#: field:stock.tracking,to_add:0 -msgid "To add" -msgstr "A ajouter" - -#. module: stock_tracking_add_move -#: field:stock.tracking.history,parent_id:0 -msgid "Parent pack" -msgstr "Colis parent" - -#. module: stock_tracking_add_move -#: model:ir.actions.act_window,name:stock_tracking_add_move.pack_remove_move -#: view:stock.tracking:0 -msgid "Remove object" -msgstr "Retirer l'objet" - -#. module: stock_tracking_add_move -#: model:ir.module.module,shortdesc:stock_tracking_add_move.module_meta_information -msgid "Stock tracking add moves" -msgstr "Le suivi du stock ajoute des mouvements" - -#. module: stock_tracking_add_move -#: model:ir.actions.act_window,name:stock_tracking_add_move.pack_add_move -#: view:stock.tracking:0 -msgid "Add object" -msgstr "Ajouter un objet" - -#. module: stock_tracking_add_move -#: model:ir.model,name:stock_tracking_add_move.model_stock_tracking_history -msgid "stock.tracking.history" -msgstr "stock.tracking.history" - -#. module: stock_tracking_add_move -#: view:stock.packaging.move:0 -msgid "Remove Move" -msgstr "Retirer mouvement" - -#. module: stock_tracking_add_move -#: model:ir.model,name:stock_tracking_add_move.model_stock_packaging_move -msgid "stock.packaging.move" -msgstr "stock.packaging.move" - -#. module: stock_tracking_add_move -#: view:stock.scan.to.validate:0 -#: field:stock.tracking,to_remove:0 -msgid "To validate" -msgstr "Valider" - -#. module: stock_tracking_add_move -#: model:ir.model,name:stock_tracking_add_move.model_stock_scan_to_validate -msgid "stock.scan.to.validate" -msgstr "stock.scan.to.validate" - -#. module: stock_tracking_add_move -#: field:stock.packaging.move,reference:0 -msgid "Reference" -msgstr "Référence" - -#. module: stock_tracking_add_move -#: code:addons/stock_tracking_add_move/stock.py:97 -#: code:addons/stock_tracking_add_move/stock.py:142 -#, python-format -msgid "Barcode Not found!" -msgstr "Code-barres introuvable!" - -#. module: stock_tracking_add_move -#: code:addons/stock_tracking_add_move/stock.py:97 -#: code:addons/stock_tracking_add_move/stock.py:142 -#, python-format -msgid "Warning!" -msgstr "Attention!" - -#. module: stock_tracking_add_move -#: view:stock.packaging.move:0 -msgid "Cancel" -msgstr "Annuler" - diff --git a/stock_tracking_add_move/images/Add move.png b/stock_tracking_add_move/images/Add move.png deleted file mode 100644 index fcf1ad612..000000000 Binary files a/stock_tracking_add_move/images/Add move.png and /dev/null differ diff --git a/stock_tracking_add_move/security/ir.model.access.csv b/stock_tracking_add_move/security/ir.model.access.csv deleted file mode 100644 index faa142595..000000000 --- a/stock_tracking_add_move/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_stock_scan_to_validate_user","stock.scan.to.validate user","model_stock_scan_to_validate","stock.group_stock_user",1,1,1,1 -"access_stock_scan_to_validate_manager","stock.scan.to.validate manager","model_stock_scan_to_validate","stock.group_stock_manager",1,1,1,1 diff --git a/stock_tracking_add_move/stock.py b/stock_tracking_add_move/stock.py deleted file mode 100644 index a6acda152..000000000 --- a/stock_tracking_add_move/stock.py +++ /dev/null @@ -1,203 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -from osv import fields, osv -from tools.translate import _ - -class stock_tracking(osv.osv): - - _inherit = 'stock.tracking' - - _columns = { - 'parent_id': fields.many2one('stock.tracking', 'Parent', readonly=True), - 'child_ids': fields.one2many('stock.tracking', 'parent_id', 'Children', readonly=True), - 'to_add': fields.one2many('stock.scan.to.validate', 'tracking_id', 'To add', domain=[('type','=','in')]), - 'to_remove': fields.one2many('stock.scan.to.validate', 'tracking_id', 'To validate', domain=[('type','=','out')]), - } - - def add_validation(self, cr, uid, ids, barcode_ids, context=None): - - barcode_obj = self.pool.get('tr.barcode') - tracking_obj = self.pool.get('stock.tracking') - move_obj = self.pool.get('stock.move') - product_obj = self.pool.get('product.product') - history_obj = self.pool.get('stock.tracking.history') - validate_obj = self.pool.get('stock.scan.to.validate') - - if context == None: - context = {} - if barcode_ids: - for obj in self.browse(cr, uid, ids): - barcode = barcode_obj.browse(cr, uid, barcode_ids[0]) - model = barcode.res_model - res_id = barcode.res_id - - if model == 'stock.tracking': - '''Pack Case''' - pack = tracking_obj.browse(cr, uid, res_id) - ''' We can only add a closed pack ''' - if pack.state == 'close': - tracking_obj.write(cr, uid, res_id, {'parent_id': obj.id,}) - history_obj.create(cr, uid, {'type': 'pack_in', - 'tracking_id': res_id, - 'parent_id': obj.id, - }) - tracking_obj.write(cr, uid, pack.id, {'location_id': obj.location_id and obj.location_id.id or False,}) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - for move_data in pack.move_ids: - if move_data.location_dest_id != tracking_obj.browse(cr, uid, obj.id).location_id: - new_move_id = move_obj.create(cr, uid, {'name': move_data.name, - 'state': 'draft', - 'product_id': move_data.product_id.id, - 'product_uom': move_data.product_uom.id, - 'prodlot_id': move_data.prodlot_id.id, - 'location_id': move_data.location_dest_id.id, - 'location_dest_id': obj.location_id.id, - }) - elif model == 'stock.production.lot': - '''Production-lot Case''' - pack = tracking_obj.browse(cr, uid, obj.id) - move_ids = move_obj.search(cr, uid, [('state', '=', 'done'), - ('prodlot_id', '=', res_id), - ('date', '<=', pack.date) -# ('tracking_id', '=', False), -# ('location_dest_id', '=', pack.location_id and pack.location_id.id or False) - ], order='date desc', limit=1) - if move_ids: - move_data = move_obj.browse(cr, uid, move_ids[0]) - if move_data.location_dest_id != pack.location_id: - new_move_id = move_obj.create(cr, uid, {'name': move_data.name, - 'state': 'draft', - 'product_id': move_data.product_id.id, - 'product_uom': move_data.product_uom.id, - 'prodlot_id': move_data.prodlot_id.id, - 'location_id': move_data.location_dest_id.id, - 'location_dest_id': obj.location_id.id, - }) - move_obj.write(cr, uid, new_move_id, {'tracking_id': obj.id}) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - else: - move_obj.write(cr, uid, move_ids, {'tracking_id': obj.id}) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - - elif model == 'product.product': - '''Product Case''' - pack = tracking_obj.browse(cr, uid, obj.id) - product_data = product_obj.browse(cr, uid,res_id) - move_id = move_obj.create(cr, uid, { - 'name': product_data.name, - 'product_id': product_data.id, - 'product_uom': product_data.uom_id.id, - 'location_id': pack.location_id.id, - 'location_dest_id': pack.location_id.id, - 'tracking_id': obj.id, - 'state': 'draft', - }) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - - '''Call for a function who will display serial code list and product list in the pack layout''' - tracking_obj.get_products(cr, uid, ids, context=None) - tracking_obj.get_serials(cr, uid, ids, context=None) - else: - raise osv.except_osv(_('Warning!'),_('Barcode Not found!')) - return {} - - def remove_validation(self, cr, uid, ids, barcode_ids, context=None): - barcode_obj = self.pool.get('tr.barcode') - tracking_obj = self.pool.get('stock.tracking') - move_obj = self.pool.get('stock.move') - product_obj = self.pool.get('product.product') - history_obj = self.pool.get('stock.tracking.history') - validate_obj = self.pool.get('stock.scan.to.validate') - - if context == None: - context = {} - if barcode_ids: - for obj in self.browse(cr, uid, ids): - barcode = barcode_obj.browse(cr, uid, barcode_ids[0]) - model = barcode.res_model - res_id = barcode.res_id - '''Pack Case''' - if model == 'stock.tracking': - pack = tracking_obj.browse(cr, uid, res_id) - tracking_obj.write(cr, uid, res_id, {'parent_id': False}) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - elif model == 'stock.production.lot': - pack = tracking_obj.browse(cr, uid, obj.id) - move_ids = move_obj.search(cr, uid, [ - ('prodlot_id', '=', res_id), - ], limit=1) - if move_ids: - move_obj.write(cr, uid, move_ids, {'tracking_id': False}) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - elif model == 'product.product': - pack = tracking_obj.browse(cr, uid, obj.id) - product_data = product_obj.browse(cr, uid,res_id) - move_ids = move_obj.search(cr, uid, [ - ('product_id', '=', product_data.id), - ], limit=1) - if move_ids: - move_obj.write(cr, uid, move_ids, {'tracking_id': False}) - tracking_obj.write(cr, uid, obj.id, {'modified': True}) - - '''Call for a function who will display serial code list and product list in the pack layout''' - tracking_obj.get_serials(cr, uid, ids, context=None) - tracking_obj.get_products(cr, uid, ids, context=None) - else: - raise osv.except_osv(_('Warning!'),_('Barcode Not found!')) - return {} - -stock_tracking() - -class stock_scan_to_validate(osv.osv): - - _name = 'stock.scan.to.validate' - _columns = { - 'tracking_id': fields.many2one('stock.tracking', 'Parent', readonly=True), - 'type': fields.selection([('in','To add'),('out','To remove')], 'Type', readonly=True), - 'barcode_id': fields.many2one('tr.barcode', 'Barcode', readonly=True), - } - - _sql_constraints = [ - ('tracking_barcode_unique', 'unique (tracking_id,barcode_id)', 'This barcode is already in the list to add or to remove !') - ] - -stock_scan_to_validate() - -class stock_tracking_history(osv.osv): - - _inherit = "stock.tracking.history" - - def _get_types(self, cr, uid, context={}): - res = super(stock_tracking_history, self)._get_types(cr, uid, context) - if not res: - res = [] - res = res + [('pack_in','Add parent'),('pack_out','Unlink parent')] - return res - - _columns = { - 'type': fields.selection(_get_types, 'Type'), - 'parent_id': fields.many2one('stock.tracking', 'Parent pack'), - } - -stock_tracking_history() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/stock_tracking_add_move/stock_view.xml b/stock_tracking_add_move/stock_view.xml deleted file mode 100644 index 6fe728f64..000000000 --- a/stock_tracking_add_move/stock_view.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - stock.scan.to.validate.tree - stock.scan.to.validate - tree - - - - - - - - - - - - stock.tracking.history.tree - stock.tracking.history - tree - - - - - - - - - - stock.tracking.history.form - stock.tracking.history - form - - - - - - - - - - diff --git a/stock_tracking_add_move/wizard/__init__.py b/stock_tracking_add_move/wizard/__init__.py deleted file mode 100644 index 507b428d2..000000000 --- a/stock_tracking_add_move/wizard/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -import add_move - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_tracking_add_move/wizard/add_move.py b/stock_tracking_add_move/wizard/add_move.py deleted file mode 100644 index 2af7268ec..000000000 --- a/stock_tracking_add_move/wizard/add_move.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -from osv import fields, osv -from tools.translate import _ - -class stock_packaging_move(osv.osv_memory): - - _name = "stock.packaging.move" - - _columns = { - 'reference': fields.char('Reference', size=128, required=True), - 'pack_id': fields.many2one('stock.tracking', 'Pack to move', required=True), - } - - _defaults = { - 'pack_id': lambda s,cr,uid,c: c.get('active_id',False), - } - - def add_move(self, cr, uid, ids, context=None): - '''Init''' - barcode_obj = self.pool.get('tr.barcode') - tracking_obj = self.pool.get('stock.tracking') - if context == None: - context = {} - - '''Get parent id''' - parent_id = context.get('active_id',False) - for obj in self.browse(cr, uid, ids): - ref = obj.reference - barcode_ids = barcode_obj.search(cr, uid, [('code', '=', ref)], limit=1) - if not barcode_ids: - reference2 = ref - while len(reference2.split('-')) > 1: - reference2 = reference2.replace('-','') - barcode_ids = barcode_obj.search(cr, uid, [('code2', '=', reference2)], limit=1) - ''' Call for the adding function ''' - tracking_obj.add_validation(cr, uid, [parent_id], barcode_ids, context=None) - return {'type': 'ir.actions.act_window_close'} - - def remove_move(self, cr, uid, ids, context=None): - '''Init''' - barcode_obj = self.pool.get('tr.barcode') - tracking_obj = self.pool.get('stock.tracking') - move_obj = self.pool.get('stock.move') - to_validate_obj = self.pool.get('stock.scan.to.validate') - if context == None: - context = {} - - '''Get parent id''' - parent_id = context.get('active_id',False) - for obj in self.browse(cr, uid, ids): - ref = obj.reference - barcode_ids = barcode_obj.search(cr, uid, [('code', '=', ref)], limit=1) - ''' Call for the removal function ''' - tracking_obj.remove_validation(cr, uid, [parent_id], barcode_ids, context=None) - return {'type': 'ir.actions.act_window_close'} - -stock_packaging_move() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_tracking_add_move/wizard/add_move_view.xml b/stock_tracking_add_move/wizard/add_move_view.xml deleted file mode 100755 index 7caaf8991..000000000 --- a/stock_tracking_add_move/wizard/add_move_view.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - Add object - stock.packaging.move - form - -
- - - - - - - - -
- -
-
diff --git a/stock_tracking_extended/__init__.py b/stock_tracking_extended/__init__.py deleted file mode 100644 index e55343a5d..000000000 --- a/stock_tracking_extended/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -import stock_tracking - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/stock_tracking_extended/__openerp__.py b/stock_tracking_extended/__openerp__.py deleted file mode 100644 index 61dbebccd..000000000 --- a/stock_tracking_extended/__openerp__.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -{ - "name" : "Stock Tracking extended", - "version" : "1.0", - "author" : "Julius Network Solutions", - "description" : """ - -Presentation: - -This module allows to define and identify package in parent or child - -""", - "website" : "http://www.julius.fr", - "depends" : [ - "stock", - ], - "category" : "Stock", - "init_xml" : [], - "demo_xml" : [], - "images" : ['images/Tracking extended.png'], - "update_xml" : [ - 'stock_tracking_view.xml', - 'inventory_sequence.xml', - "security/ir.model.access.csv", - ], - 'test': [], - 'installable': True, - 'active': False, - 'certificate': '', -} diff --git a/stock_tracking_extended/i18n/fr.po b/stock_tracking_extended/i18n/fr.po deleted file mode 100644 index 450a79053..000000000 --- a/stock_tracking_extended/i18n/fr.po +++ /dev/null @@ -1,279 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * stock_tracking_extended -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 6.0.3\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2011-12-19 10:42+0000\n" -"PO-Revision-Date: 2011-12-19 10:42+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_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_stock_production_lot -msgid "Production lot" -msgstr "Numéro de série" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_product_stock_tracking -msgid "product.stock.tracking" -msgstr "product.stock.tracking" - -#. module: stock_tracking_extended -#: field:product.ul,capacity_index:0 -msgid "Capacity index" -msgstr "Indice de capacité" - -#. module: stock_tracking_extended -#: constraint:stock.move:0 -msgid "You must assign a production lot for this product" -msgstr "Vous devez affecter un numéro de série pour ce produit." - -#. module: stock_tracking_extended -#: field:stock.tracking,state:0 -msgid "State" -msgstr "Statut" - -#. module: stock_tracking_extended -#: field:stock.production.lot,tracking_id:0 -msgid "pack" -msgstr "Colis" - -#. module: stock_tracking_extended -#: field:stock.tracking,location_id:0 -msgid "Location" -msgstr "Stockage" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Serial Code" -msgstr "Numéro de série" - -#. module: stock_tracking_extended -#: sql_constraint:stock.production.lot:0 -msgid "The combination of serial number and internal reference must be unique !" -msgstr "La combinaison du numéro de série et de la référence interne doit être unique !" - -#. module: stock_tracking_extended -#: field:stock.tracking.history,type:0 -msgid "Type" -msgstr "Type" - -#. module: stock_tracking_extended -#: code:addons/stock_tracking_extended/stock_tracking.py:118 -#, python-format -msgid "You can't re-open this pack because there is at least one not closed child" -msgstr "Vous ne pouvez pas ré-ouvrir ce colis parce qu'il y a au moins un colis enfant non fermé" - -#. module: stock_tracking_extended -#: field:product.stock.tracking,product_id:0 -#: field:serial.stock.tracking,product_id:0 -msgid "Product" -msgstr "Produit" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_product_category -msgid "Product Category" -msgstr "Catégorie de produits" - -#. module: stock_tracking_extended -#: field:stock.tracking,parent_id:0 -msgid "Parent" -msgstr "Parent" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_stock_tracking -msgid "Packs" -msgstr "Colis" - -#. module: stock_tracking_extended -#: constraint:stock.move:0 -msgid "You try to assign a lot which is not from the same product" -msgstr "Vous essayez d'affecter un lot qui appartient à une autre référence." - -#. module: stock_tracking_extended -#: constraint:stock.tracking:0 -msgid "Bad parent type selection. Please try again." -msgstr "Mauvais choix du type parent. Veuillez ressayez à nouveau." - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Reset Open" -msgstr "Ré-ouvrir" - -#. module: stock_tracking_extended -#: field:product.stock.tracking,quantity:0 -#: field:serial.stock.tracking,quantity:0 -msgid "Quantity" -msgstr "Quantité" - -#. module: stock_tracking_extended -#: code:addons/stock_tracking_extended/stock_tracking.py:113 -#: code:addons/stock_tracking_extended/stock_tracking.py:118 -#: code:addons/stock_tracking_extended/stock_tracking.py:131 -#, python-format -msgid "Not allowed !" -msgstr "Non autorisé !" - -#. module: stock_tracking_extended -#: field:stock.tracking,current_move_ids:0 -msgid "Current moves" -msgstr "Mouvements actuels" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -#: field:stock.tracking,history_ids:0 -#: view:stock.tracking.history:0 -msgid "History" -msgstr "Historique" - -#. module: stock_tracking_extended -#: model:ir.module.module,description:stock_tracking_extended.module_meta_information -msgid " This Module allows to have parent/child packaging " -msgstr " Ce module permet d'avoir des colis parent/enfant " - -#. module: stock_tracking_extended -#: field:product.category,tracked:0 -msgid "Need a serial code ?" -msgstr "Suivre les numéros de série ?" - -#. module: stock_tracking_extended -#: field:product.stock.tracking,tracking_id:0 -#: field:serial.stock.tracking,tracking_id:0 -msgid "Tracking" -msgstr "Suivi" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Downstream traceability" -msgstr "Traçabilité aval" - -#. module: stock_tracking_extended -#: field:stock.tracking,ul_id:0 -msgid "Logistic unit" -msgstr "Unité logistique" - -#. module: stock_tracking_extended -#: model:ir.actions.act_window,name:stock_tracking_extended.action_stock_tracking_tree -#: model:ir.ui.menu,name:stock_tracking_extended.menu_action_stock_tracking_tree -msgid "Packs Structure" -msgstr "Structure de colis" - -#. module: stock_tracking_extended -#: field:stock.tracking,child_serial_ids:0 -msgid "Child Serials" -msgstr "Numéros de séries enfants" - -#. module: stock_tracking_extended -#: code:addons/stock_tracking_extended/stock_tracking.py:131 -#, python-format -msgid "You can't close this pack because there is at least one not closed child" -msgstr "Vous ne pouvez pas fermer ce colis parce qu'il y a au moins un enfant non fermé" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_stock_tracking_history -msgid "stock.tracking.history" -msgstr "stock.tracking.history" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Update product list" -msgstr "MàJ de la liste de produit" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Child Packs" -msgstr "Colis enfants" - -#. module: stock_tracking_extended -#: view:product.stock.tracking:0 -#: view:serial.stock.tracking:0 -#: view:stock.tracking:0 -#: field:stock.tracking,product_ids:0 -#: field:stock.tracking,serial_ids:0 -msgid "Products" -msgstr "Produits" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Update Serial list" -msgstr "MàJ de la liste des NS" - -#. module: stock_tracking_extended -#: field:stock.tracking.history,tracking_id:0 -msgid "Pack" -msgstr "Colis" - -#. module: stock_tracking_extended -#: model:ir.module.module,shortdesc:stock_tracking_extended.module_meta_information -msgid "Stock Packaging extended" -msgstr "Gestion des colis étendu" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_stock_move -msgid "Stock Move" -msgstr "Mouvement de stock" - -#. module: stock_tracking_extended -#: field:stock.tracking,child_product_ids:0 -msgid "Child Products" -msgstr "Produits enfants" - -#. module: stock_tracking_extended -#: constraint:product.category:0 -msgid "Error ! You can not create recursive categories." -msgstr "Erreur ! Vous ne pouvez pas créer de catégories récursives" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_product_ul -msgid "Shipping Unit" -msgstr "Unité de livraison" - -#. module: stock_tracking_extended -#: code:addons/stock_tracking_extended/stock_tracking.py:113 -#, python-format -msgid "You can't re-open this pack because the parent pack is close" -msgstr "Vous ne pouvez pas ré-ouvrir ce colis, car le colis parent est fermé" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_serial_stock_tracking -msgid "serial.stock.tracking" -msgstr "serial.stock.tracking" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -#: selection:stock.tracking,state:0 -msgid "Close" -msgstr "Fermer" - -#. module: stock_tracking_extended -#: field:serial.stock.tracking,serial_id:0 -msgid "Serial" -msgstr "Numéro de Série" - -#. module: stock_tracking_extended -#: view:stock.tracking:0 -msgid "Stock Moves" -msgstr "Mouvements de stocks" - -#. module: stock_tracking_extended -#: selection:stock.tracking,state:0 -msgid "Open" -msgstr "Ouvert" - -#. module: stock_tracking_extended -#: field:stock.tracking,child_ids:0 -msgid "Children" -msgstr "Enfant" - -#. module: stock_tracking_extended -#: model:ir.model,name:stock_tracking_extended.model_stock_inventory -msgid "Inventory" -msgstr "Inventaire" - diff --git a/stock_tracking_extended/images/Tracking extended.png b/stock_tracking_extended/images/Tracking extended.png deleted file mode 100644 index ffc9d8319..000000000 Binary files a/stock_tracking_extended/images/Tracking extended.png and /dev/null differ diff --git a/stock_tracking_extended/inventory_sequence.xml b/stock_tracking_extended/inventory_sequence.xml deleted file mode 100644 index d6bf3fc64..000000000 --- a/stock_tracking_extended/inventory_sequence.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - Inventory Order - stock.inventory - - - - Inventory Order - stock.inventory - INV - 3 - - - - diff --git a/stock_tracking_extended/security/ir.model.access.csv b/stock_tracking_extended/security/ir.model.access.csv deleted file mode 100644 index 2df41ec2e..000000000 --- a/stock_tracking_extended/security/ir.model.access.csv +++ /dev/null @@ -1,10 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_product_stock_tracking_user","product.stock.tracking user","model_product_stock_tracking","stock.group_stock_user",1,1,1,1 -"access_product_stock_tracking_manager","product.stock.tracking manager","model_product_stock_tracking","stock.group_stock_manager",1,1,1,1 -"access_product_stock_tracking_all","product.stock.tracking all","model_product_stock_tracking",,1,0,0,0 -"access_serial_stock_tracking_user","serial.stock.tracking user","model_serial_stock_tracking","stock.group_stock_user",1,1,1,1 -"access_serial_stock_tracking_manager","serial.stock.tracking manager","model_serial_stock_tracking","stock.group_stock_manager",1,1,1,1 -"access_serial_stock_tracking_all","serial.stock.tracking all","model_serial_stock_tracking",,1,0,0,0 -"access_stock_tracking_history_user","serial.stock.tracking user","model_stock_tracking_history","stock.group_stock_user",1,1,1,1 -"access_stock_tracking_history_manager","serial.stock.tracking manager","model_stock_tracking_history","stock.group_stock_manager",1,1,1,1 -"access_stock_tracking_history_all","serial.stock.tracking all","model_stock_tracking_history",,1,0,0,0 diff --git a/stock_tracking_extended/stock_tracking.py b/stock_tracking_extended/stock_tracking.py deleted file mode 100644 index b21774485..000000000 --- a/stock_tracking_extended/stock_tracking.py +++ /dev/null @@ -1,330 +0,0 @@ - # -*- coding: utf-8 -*- -################################################################################# -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2011 Julius Network Solutions SARL -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License -# along with this program. If not, see . -# -################################################################################# - -from datetime import datetime -from osv import fields, osv -from tools.translate import _ -import netsvc - -class one2many_special(fields.one2many): - def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): - if not values: - values = {} - res = {} - location_ids = [] - for id in ids: - res[id] = [] - location_id = obj.pool.get('stock.tracking').read(cr, user, id, ['location_id'])['location_id'] - if location_id and location_id[0] and location_id[0] not in location_ids: - location_ids.append(location_id[0]) - ids2 = obj.pool.get(self._obj).search(cr, user, self._domain + [(self._fields_id, 'in', ids), ('location_dest_id', 'in', location_ids)], limit=self._limit) - for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'): - res[r[self._fields_id]].append( r['id'] ) - return res - -class stock_tracking(osv.osv): - - _inherit = 'stock.tracking' - - def hierarchy_ids(self, tracking): - result_list = [tracking] - for child in tracking.child_ids: - result_list.extend(self.hierarchy_ids(child)) - return result_list - - def _get_child_products(self, cr, uid, ids, field_name, arg, context=None): - packs = self.browse(cr, uid, ids) - res = {} - for pack in packs: - res[pack.id] = [] - childs = self.hierarchy_ids(pack) - for child in childs: - for prod in child.product_ids: - res[pack.id].append(prod.id) - return res - - def _get_child_serials(self, cr, uid, ids, field_name, arg, context=None): - packs = self.browse(cr, uid, ids) - res = {} - for pack in packs: - res[pack.id] = [] - childs = self.hierarchy_ids(pack) - for child in childs: - for serial in child.serial_ids: - res[pack.id].append(serial.id) - return res - - _columns = { - 'parent_id': fields.many2one('stock.tracking', 'Parent'), - 'child_ids': fields.one2many('stock.tracking', 'parent_id', 'Children', readonly=True), - 'ul_id': fields.many2one('product.ul', 'Logistic unit', readonly=True, states={'open':[('readonly',False)]}), - 'location_id': fields.many2one('stock.location', 'Location', required=True, readonly=True, states={'open':[('readonly',False)]}), - 'state': fields.selection([('open','Open'),('close','Close')], 'State', readonly=True), - 'product_ids': fields.one2many('product.stock.tracking', 'tracking_id', 'Products', readonly=True), - 'child_product_ids': fields.function(_get_child_products, method=True, type='one2many', obj='product.stock.tracking', string='Child Products'), - 'history_ids': fields.one2many('stock.tracking.history', 'tracking_id', 'History'), - 'current_move_ids': one2many_special('stock.move', 'tracking_id', 'Current moves', domain=[('pack_history_id', '=', False)], readonly=True), - 'name': fields.char('Pack Reference', size=64, required=True, readonly=True, states={'open':[('readonly',False)]}), - 'date': fields.datetime('Creation Date', required=True, readonly=True, states={'open':[('readonly',False)]}), - 'serial_ids': fields.one2many('serial.stock.tracking', 'tracking_id', 'Products', readonly=True), - 'child_serial_ids': fields.function(_get_child_serials, method=True, type='one2many', obj='serial.stock.tracking', string='Child Serials'), - } - - def _check_parent_id(self, cr, uid, ids, context=None): - lines = self.browse(cr, uid, ids, context=context) - - if lines[0].parent_id: - if lines[0].ul_id.capacity_index > lines[0].parent_id.ul_id.capacity_index: - return False - return True - - _constraints = [(_check_parent_id, 'Bad parent type selection. Please try again.',['parent_id'] ),] - - _defaults = { - 'state': 'open', - 'location_id': lambda x, y, z, c: c and c.get('location_id') or False, - } - - def reset_open(self, cr, uid, ids, context=None): - pack_ids = self.browse(cr, uid, ids, context) - for pack in pack_ids: - allowed = True - if pack.parent_id: - if pack.parent_id and pack.parent_id != 'open': - self.write(cr, uid, [pack.parent_id.id], {'state': 'open'}) -# allowed = False -# raise osv.except_osv(_('Not allowed !'),_('You can\'t re-open this pack because the parent pack is close')) - if allowed: - for child in pack.child_ids: - if child.state == 'open': - allowed = False - raise osv.except_osv(_('Not allowed !'),_('You can\'t re-open this pack because there is at least one not closed child')) - break - if allowed: - self.write(cr, uid, [pack.id], {'state': 'open'}) - return True - - def set_close(self, cr, uid, ids, context=None): - pack_ids = self.browse(cr, uid, ids, context) - for pack in pack_ids: - allowed = True - for child in pack.child_ids: - if child.state == 'open': - allowed = False - raise osv.except_osv(_('Not allowed !'),_('You can\'t close this pack because there is at least one not closed child')) - break -# if allowed: -# self.write(cr, uid, [pack.id], {'state': 'close'}) - return True - - def get_products(self, cr, uid, ids, context=None): - pack_ids = self.browse(cr, uid, ids, context) - stock_track = self.pool.get('product.stock.tracking') - for pack in pack_ids: - childs = self.hierarchy_ids(pack) - for child in childs: - product_ids = [x.id for x in child.product_ids] - stock_track.unlink(cr, uid, product_ids) - product_list = {} - for x in child.current_move_ids: - if x.location_dest_id.id == child.location_id.id: - if x.product_id.id not in product_list.keys(): - product_list.update({x.product_id.id:x.product_qty}) - else: - product_list[x.product_id.id] += x.product_qty - for product in product_list.keys(): - stock_track.create(cr, uid, {'product_id': product, 'quantity': product_list[product], 'tracking_id': child.id}) - return True - - def get_serials(self, cr, uid, ids, context=None): - pack_ids = self.browse(cr, uid, ids, context) - serial_track = self.pool.get('serial.stock.tracking') - serial_obj = self.pool.get('stock.production.lot') - for pack in pack_ids: - childs = self.hierarchy_ids(pack) - for child in childs: - serial_ids = [x.id for x in child.serial_ids] - serial_track.unlink(cr, uid, serial_ids) - serial_list = {} - for x in child.current_move_ids: - if x.location_dest_id.id == child.location_id.id: - if x.prodlot_id.id not in serial_list.keys(): - serial_list.update({x.prodlot_id.id:x.product_qty}) - else: - serial_list[x.prodlot_id.id] += x.product_qty - for serial in serial_list.keys(): - if serial: - serial_track.create(cr, uid, {'serial_id': serial, 'quantity': serial_list[serial], 'tracking_id': child.id}) - serial_obj.write(cr, uid, [serial], {'tracking_id': child.id}) - return True - -stock_tracking() - -class product_ul(osv.osv): - _inherit = "product.ul" - _description = "Shipping Unit" - _columns = { - 'capacity_index': fields.integer('Capacity index'), - } - _order = 'capacity_index' -product_ul() - -class product_stock_tracking(osv.osv): - - _name = 'product.stock.tracking' - - _columns = { - 'product_id': fields.many2one('product.product', 'Product'), - 'quantity': fields.float('Quantity'), - 'tracking_id': fields.many2one('stock.tracking', 'Tracking'), -# 'tracking_history_id': fields.many2one('stock.tracking.history', 'Tracking History'), - } - -product_stock_tracking() - -class serial_stock_tracking(osv.osv): - - _name = 'serial.stock.tracking' - - _order = 'tracking_id,serial_id' - - _columns = { - 'serial_id': fields.many2one('stock.production.lot', 'Serial'), - 'product_id': fields.related('serial_id', 'product_id', type='many2one', relation='product.product', string='Product'), - 'quantity': fields.float('Quantity'), - 'tracking_id': fields.many2one('stock.tracking', 'Tracking'), -# 'tracking_history_id': fields.many2one('stock.tracking.history', 'Tracking History'), - } - -serial_stock_tracking() - -class stock_tracking_history(osv.osv): - - _name = "stock.tracking.history" - - def _get_types(self, cr, uid, context={}): -# res = [('pack_in','Add parent'),('pack_out','Unlink parent'),('move','Move')] - res = [] - return res - -# def hierarchy_ids(self, tracking): -# result_list = [tracking] -# for child in tracking.child_ids: -# result_list.extend(self.hierarchy_ids(child)) -# return result_list -# -# def _get_child_products(self, cr, uid, ids, field_name, arg, context=None): -# packs = self.browse(cr, uid, ids) -# res = {} -# for pack in packs: -# res[pack.id] = [] -# childs = self.hierarchy_ids(pack) -# for child in childs: -# for prod in child.product_ids: -# res[pack.id].append(prod.id) -# return res - - _columns = { - 'tracking_id': fields.many2one('stock.tracking', 'Pack', required=True), - 'type': fields.selection(_get_types, 'Type'), -# 'product_ids': fields.one2many('product.stock.tracking', 'tracking_history_id', 'Products'), -# 'child_product_ids': fields.function(_get_child_products, method=True, type='one2many', obj='product.stock.tracking', string='Child Products'), -# 'parent_hist_id': fields.many2one('stock.tracking.history', 'Parent history pack'), -# 'child_ids': fields.one2many('stock.tracking.history', 'parent_hist_id', 'Child history pack'), - } - - _rec_name = "tracking_id" - -stock_tracking_history() - -'''Add a field in order to store the current pack in a production lot''' -class stock_production_lot(osv.osv): - _inherit = 'stock.production.lot' - _columns = { - 'tracking_id': fields.many2one('stock.tracking', 'pack'), - } - -stock_production_lot() - -class product_category(osv.osv): - _inherit = 'product.category' - _columns = { - 'tracked': fields.boolean('Need a serial code ?'), - } -product_category() - -class stock_inventory(osv.osv): - _inherit = 'stock.inventory' - _defaults = { - 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'stock.inventory') or '/' - } -stock_inventory() - -class stock_move(osv.osv): - _inherit = 'stock.move' - _columns = { - 'move_ori_id': fields.many2one('stock.move', 'Origin Move', select=True), -# 'cancel_cascade': fields.boolean('Cancel Cascade', help='If checked, when this move is cancelled, cancel the linked move too') - } - - def write(self, cr, uid, ids, vals, context=None): - result = super(stock_move,self).write(cr, uid, ids, vals, context) - if not isinstance(ids, list): - ids = [ids] - for id in ids: - state = self.browse(cr, uid, id, context).state - move_ori_id = self.browse(cr, uid, id, context).move_ori_id - if state == 'done' and move_ori_id: - self.write(cr, uid, [move_ori_id.id], {'state':'done'}, context) - return result - - def create(self, cr, uid, vals, context=None): - production_lot_obj = self.pool.get('stock.production.lot') - stock_tracking_obj = self.pool.get('stock.tracking') - if vals.get('prodlot_id',False): - production_lot_data = production_lot_obj.browse(cr, uid, vals['prodlot_id']) - last_production_lot_move_id = self.search(cr, uid, [('prodlot_id', '=', production_lot_data.id)], limit=1, order='date') - if last_production_lot_move_id: - last_production_lot_move = self.browse(cr,uid,last_production_lot_move_id[0]) - if last_production_lot_move.tracking_id: - ids = [last_production_lot_move.tracking_id.id] - stock_tracking_obj.reset_open(cr, uid, ids, context=None) - - return super(stock_move,self).create(cr, uid, vals, context) - -stock_move() - -class split_in_production_lot(osv.osv_memory): - _inherit = "stock.move.split" - _columns = { - 'use_exist' : fields.boolean('Existing Lots', invisible=True), - } - _defaults = { - 'use_exist': lambda *a: True, - } - def default_get(self, cr, uid, fields, context=None): - res = super(split_in_production_lot, self).default_get(cr, uid, fields, context) - res.update({'use_exist': True}) - return res - -split_in_production_lot() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/stock_tracking_extended/stock_tracking_view.xml b/stock_tracking_extended/stock_tracking_view.xml deleted file mode 100644 index f107daa4e..000000000 --- a/stock_tracking_extended/stock_tracking_view.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - product.category.property.form.inherit - product.category - form - - - - - - - - - - stock.tracking.tree.inherit - stock.tracking - tree - - - - - - - - - - - - - stock.tracking.tree.inherit - stock.tracking - tree - - - - - - - - - - - stock.tracking.form.inherit - stock.tracking - form - - - - - - - - - - - -
- - - -