[DEL] Remove the following module and move them to this project : https://launchpad.net/stock-logistic-tracking : stock_move_packaging,stock_tracking_add_move, stock_tracking_extended, stock_tracking_reopen

This commit is contained in:
Joel Grand-Guillaume
2012-11-05 14:34:50 +01:00
parent 47b8868164
commit 0b3b038359
33 changed files with 0 additions and 2391 deletions

View File

@@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
import stock
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,51 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
{
"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': '',
}

View File

@@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

View File

@@ -1,45 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
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:

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_tracking_history_tree" model="ir.ui.view">
<field name="name">stock.tracking.history.tree</field>
<field name="model">stock.tracking.history</field>
<field name="type">tree</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_history_tree"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="location_id"/>
<field name="location_dest_id"/>
</field>
</field>
</record>
<record id="view_tracking_history_form" model="ir.ui.view">
<field name="name">stock.tracking.history.form</field>
<field name="model">stock.tracking.history</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_history_form"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="location_id"/>
<field name="location_dest_id"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
import move_pack
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,105 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
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:

View File

@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_move_pack" model="ir.ui.view">
<field name="name">Move Pack</field>
<field name="model">stock.move.packaging</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Move Pack">
<group width="660" height="275">
<group colspan="4">
<field name="pack_id" colspan="2"/>
<field name="location_dest_id" colspan="2"/>
<button icon='gtk-cancel' special="cancel"
string="Cancel" />
<button name="move_pack" string="Move it"
type="object" icon="gtk-ok"/>
</group>
</group>
</form>
</field>
</record>
<record id="move_pack" model="ir.actions.act_window">
<field name="name">Move Pack</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move.packaging</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="view_tracking_form_move_inherit" model="ir.ui.view">
<field name="name">stock.tracking.form.inherit</field>
<field name="model">stock.tracking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_form_inherit"/>
<field name="arch" type="xml">
<button name="set_close" position="after">
<button name="%(move_pack)d" states="close" string="Move pack" colspan="2" type="action" icon="gtk-ok"/>
</button>
</field>
</record>
</data>
</openerp>

View File

@@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
import stock
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,54 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
{
"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': '',
}

View File

@@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_stock_scan_to_validate_user stock.scan.to.validate user model_stock_scan_to_validate stock.group_stock_user 1 1 1 1
3 access_stock_scan_to_validate_manager stock.scan.to.validate manager model_stock_scan_to_validate stock.group_stock_manager 1 1 1 1

View File

@@ -1,203 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
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:

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_scan_to_validate_tree" model="ir.ui.view">
<field name="name">stock.scan.to.validate.tree</field>
<field name="model">stock.scan.to.validate</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="To validate">
<!--<field name="type"/>-->
<field name="barcode_id"/>
</tree>
</field>
</record>
<!--<record id="view_tracking_form_add_remove" model="ir.ui.view">
<field name="name">stock.tracking.form.add.remove</field>
<field name="model">stock.tracking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_tracking_form"/>
<field name="arch" type="xml">
<page string="Stock Moves" position="after">
<page string="To add" attrs="{'invisible':[('state', '=', 'close')]}">
<separator string="Objects to add into this pack" colspan="4"/>
<field name="to_add" nolabel="1" colspan="4"/>
<button name="add_validation" states="open" string="Confirm ADD" colspan="2" type="object" icon="gtk-ok"/>
</page>
<page string="To remove" attrs="{'invisible':[('state', '=', 'close')]}">
<separator string="Objects to remove from this pack" colspan="4"/>
<field name="to_remove" nolabel="1" colspan="4"/>
<button name="remove_validation" states="open" string="Confirm REMOVE" colspan="2" type="object" icon="gtk-ok"/>
</page>
</page>
</field>
</record>-->
<record id="view_tracking_history_tree" model="ir.ui.view">
<field name="name">stock.tracking.history.tree</field>
<field name="model">stock.tracking.history</field>
<field name="type">tree</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_history_tree"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="parent_id"/>
</field>
</field>
</record>
<record id="view_tracking_history_form" model="ir.ui.view">
<field name="name">stock.tracking.history.form</field>
<field name="model">stock.tracking.history</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_history_form"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="parent_id"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
import add_move
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,79 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
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:

View File

@@ -1,82 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_pack_add_move" model="ir.ui.view">
<field name="name">Add object</field>
<field name="model">stock.packaging.move</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Add Move">
<group width="400" height="100">
<group colspan="4">
<field name="reference" colspan="2"/>
<field name="pack_id" colspan="2" invisible="1"/>
<newline/>
<separator string="Add Move" colspan="4"/>
<button icon='gtk-cancel' special="cancel"
string="Cancel" />
<button name="add_move" string="Add Move"
type="object" icon="gtk-ok"/>
</group>
</group>
</form>
</field>
</record>
<record id="pack_add_move" model="ir.actions.act_window">
<field name="name">Add object</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.packaging.move</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_pack_add_move"/>
<field name="target">new</field>
</record>
<record id="view_pack_remove_move" model="ir.ui.view">
<field name="name">Remove object</field>
<field name="model">stock.packaging.move</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Remove Move">
<group width="400" height="100">
<group colspan="4">
<field name="reference" colspan="2"/>
<newline/>
<separator string="Remove Move" colspan="4"/>
<button icon='gtk-cancel' special="cancel"
string="Cancel" />
<button name="remove_move" string="Remove Move"
type="object" icon="gtk-ok"/>
</group>
</group>
</form>
</field>
</record>
<record id="pack_remove_move" model="ir.actions.act_window">
<field name="name">Remove object</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.packaging.move</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_pack_remove_move"/>
<field name="target">new</field>
</record>
<record id="view_tracking_form_inherit" model="ir.ui.view">
<field name="name">stock.tracking.form.inherit</field>
<field name="model">stock.tracking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_form_inherit"/>
<field name="arch" type="xml">
<button name="reset_open" position="after">
<button name="%(pack_add_move)d" states="open" string="Add object" colspan="2" type="action" icon="gtk-ok"/>
<button name="%(pack_remove_move)d" states="open" string="Remove object" colspan="2" type="action" icon="gtk-ok"/>
</button>
</field>
</record>
</data>
</openerp>

View File

@@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
import stock_tracking
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,50 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
{
"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': '',
}

View File

@@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Sequences for stock.inventory -->
<record id="seq_type_inventory_order" model="ir.sequence.type">
<field name="name">Inventory Order</field>
<field name="code">stock.inventory</field>
</record>
<record id="seq_sale_order" model="ir.sequence">
<field name="name">Inventory Order</field>
<field name="code">stock.inventory</field>
<field name="prefix">INV</field>
<field name="padding">3</field>
</record>
</data>
</openerp>

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_product_stock_tracking_user product.stock.tracking user model_product_stock_tracking stock.group_stock_user 1 1 1 1
3 access_product_stock_tracking_manager product.stock.tracking manager model_product_stock_tracking stock.group_stock_manager 1 1 1 1
4 access_product_stock_tracking_all product.stock.tracking all model_product_stock_tracking 1 0 0 0
5 access_serial_stock_tracking_user serial.stock.tracking user model_serial_stock_tracking stock.group_stock_user 1 1 1 1
6 access_serial_stock_tracking_manager serial.stock.tracking manager model_serial_stock_tracking stock.group_stock_manager 1 1 1 1
7 access_serial_stock_tracking_all serial.stock.tracking all model_serial_stock_tracking 1 0 0 0
8 access_stock_tracking_history_user serial.stock.tracking user model_stock_tracking_history stock.group_stock_user 1 1 1 1
9 access_stock_tracking_history_manager serial.stock.tracking manager model_stock_tracking_history stock.group_stock_manager 1 1 1 1
10 access_stock_tracking_history_all serial.stock.tracking all model_stock_tracking_history 1 0 0 0

View File

@@ -1,330 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
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:

View File

@@ -1,282 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--<record id="search_stock_packs_inherit" model="ir.ui.view">
<field name="name">Pack Search inherit</field>
<field name="model">stock.tracking</field>
<field name="type">search</field>
<field name="inherit_id" ref="stock.search_stock_packs"/>
<field name="arch" type="xml">
<filter name="available" position="after">
<filter icon="gtk-media-pause" name="on_hold" string="On Hold" domain="[('state','in',['on_hold','on_hold_billing','on_hold_paym'])]" help="On Hold Pickings"/>
</filter>
</field>
</record>-->
<record id="product_category_tracked_form" model="ir.ui.view">
<field name="name">product.category.property.form.inherit</field>
<field name="model">product.category</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_category_form_view"/>
<field name="arch" type="xml">
<field name="parent_id" position="after">
<field name="tracked"/>
</field>
</field>
</record>
<record id="view_tracking_tree_inherit" model="ir.ui.view">
<field name="name">stock.tracking.tree.inherit</field>
<field name="model">stock.tracking</field>
<field name="type">tree</field>
<field name="inherit_id" ref="stock.view_tracking_tree"/>
<field name="arch" type="xml">
<field name="serial" position="after">
<field name="parent_id"/>
<field name="ul_id"/>
<field name="location_id"/>
<field name="state"/>
</field>
</field>
</record>
<record id="lot_line_tree_inherit" model="ir.ui.view">
<field name="name">stock.tracking.tree.inherit</field>
<field name="model">stock.tracking</field>
<field name="type">tree</field>
<field name="inherit_id" ref="stock.lot_line_tree"/>
<field name="arch" type="xml">
<field name="serial" position="after">
<field name="parent_id"/>
<field name="ul_id"/>
</field>
</field>
</record>
<record id="view_tracking_form_inherit" model="ir.ui.view">
<field name="name">stock.tracking.form.inherit</field>
<field name="model">stock.tracking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_tracking_form"/>
<field name="arch" type="xml">
<field name="serial" position="after">
<field name="parent_id"/>
<field name="ul_id"/>
</field>
<page string="Stock Moves" position="before">
<page string="Products">
<field name="child_product_ids" nolabel="1" colspan="4" context="{'group_by':'product_id'}"/>
<field name="product_ids" nolabel="1" colspan="4" invisible="True"/>
<button name="get_products" string="Update product list" colspan="2" type="object" icon="gtk-ok"/>
</page>
<page string="Serial Code">
<field name="child_serial_ids" nolabel="1" colspan="4"/>
<field name="serial_ids" nolabel="1" colspan="4" invisible="True"/>
<button name="get_serials" string="Update Serial list" colspan="2" type="object" icon="gtk-ok"/>
<!--
<field name="current_move_ids" nolabel="1" colspan="4">
<tree string="Stock Moves">
<field name="product_id"/>
<field name="prodlot_id" groups="base.group_extended"/>
</tree>
</field>
-->
</page>
<page string="Child Packs">
<field name="child_ids" nolabel="1" colspan="2"/>
</page>
<page string="History">
<field name="history_ids" nolabel="1" colspan="4"/>
</page>
</page>
<button name="action_traceability" string="Downstream traceability" position="after">
<field name="location_id"/>
</button>
<form position="inside">
<group colspan="4" col="12">
<field name="state" colspan="3"/>
<group colspan="9" col="10">
<button name="reset_open" states="close" string="Reset Open" colspan="2" type="object" icon="gtk-ok"/>
<button name="set_close" states="open" string="Close" colspan="2" type="object" icon="gtk-ok"/>
</group>
</group>
</form>
<!--
<field name="move_ids" position="before">
<separator string="Current moves" colspan="4"/>
<field name="current_move_ids" nolabel="1" colspan="4"/>
<separator string="All moves" colspan="4"/>
</field>
-->
</field>
</record>
<record id="view_stock_tracking_tree" model="ir.ui.view">
<field name="name">stock.tracking.tree</field>
<field name="model">stock.tracking</field>
<field name="type">tree</field>
<field name="field_parent">child_ids</field>
<field name="arch" type="xml">
<tree toolbar="1">
<field name="name"/>
<field name="serial"/>
<field name="ul_id"/>
</tree>
</field>
</record>
<record id="action_stock_tracking_tree" model="ir.actions.act_window">
<field name="name">Packs Structure</field>
<field name="res_model">stock.tracking</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">tree</field>
<field name="view_id" ref="view_stock_tracking_tree"/>
<field name="domain">[('parent_id','=',False)]</field>
</record>
<menuitem
action="action_stock_tracking_tree"
id="menu_action_stock_tracking_tree"
parent="stock.menu_stock_inventory_control" />
<record id="view_picking_form" model="ir.ui.view">
<field name="name">stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='move_lines']/form/group/field[@name='tracking_id']" position="replace">
<field name="tracking_id" domain="[('state', '=', 'open')]" colspan="3"/>
</xpath>
</field>
</record>
<record id="view_picking_out_form" model="ir.ui.view">
<field name="name">stock.picking.out.form</field>
<field name="model">stock.picking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='move_lines']/form/group/field[@name='tracking_id']" position="replace">
<field name="tracking_id" domain="[('state', '=', 'open')]" colspan="3"/>
</xpath>
</field>
</record>
<record id="view_picking_in_form" model="ir.ui.view">
<field name="name">stock.picking.in.form</field>
<field name="model">stock.picking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_picking_in_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='move_lines']/form/group/field[@name='tracking_id']" position="replace">
<field name="tracking_id" domain="[('state', '=', 'open')]" colspan="3"/>
</xpath>
</field>
</record>
<record id="view_product_stock_tracking_tree_inherit" model="ir.ui.view">
<field name="name">product.stock.tracking.tree</field>
<field name="model">product.stock.tracking</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Products">
<field name="product_id"/>
<field name="quantity"/>
</tree>
</field>
</record>
<record id="view_serial_stock_tracking_tree_inherit" model="ir.ui.view">
<field name="name">serial.stock.tracking.tree</field>
<field name="model">serial.stock.tracking</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Products">
<field name="tracking_id"/>
<field name="serial_id"/>
<field name="product_id"/>
<field name="quantity"/>
</tree>
</field>
</record>
<!--<record id="view_tracking_form_inherit" model="ir.ui.view">
<field name="name">stock.tracking.form.inherit</field>
<field name="model">stock.tracking</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_form_inherit"/>
<field name="arch" type="xml">
<notebook position="inside">
</notebook>
</field>
</record>-->
<record id="view_tracking_history_tree" model="ir.ui.view">
<field name="name">stock.tracking.history.tree</field>
<field name="model">stock.tracking.history</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="History">
<field name="type"/>
</tree>
</field>
</record>
<record id="view_tracking_history_form" model="ir.ui.view">
<field name="name">stock.tracking.history.form</field>
<field name="model">stock.tracking.history</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="History">
<field name="type"/>
<!--<newline/>
<separator string="Products" colspan="4"/>
<field name="child_product_ids" nolabel="1" colspan="4"/>
<separator string="Child Packs" colspan="4"/>
<field name="child_pack_ids" nolabel="1" colspan="4"/>-->
</form>
</field>
</record>
<record id="product_ul_tree" model="ir.ui.view">
<field name="name">product.ul.tree.inherit</field>
<field name="model">product.ul</field>
<field name="inherit_id" ref="product.product_ul_tree"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="capacity_index"/>
</field>
</field>
</record>
<record id="product_ul_form_view" model="ir.ui.view">
<field name="name">product.ul.form.inherit</field>
<field name="model">product.ul</field>
<field name="inherit_id" ref="product.product_ul_form_view"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="capacity_index"/>
</field>
</field>
</record>
<record id="view_stock_move_tree_inherit" model="ir.ui.view">
<field name="name">stock.move.tree</field>
<field name="model">stock.move</field>
<field name="type">tree</field>
<field name="inherit_id" ref="stock.view_move_tree_reception_picking_board"/>
<field name="arch" type="xml">
<field name="date" position="after">
<field name="state"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
import stock
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,50 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
{
"name" : "Stock tracking Re-open",
"version" : "1.0",
"author" : "Julius Network Solutions",
"description" : """
Presentation:
This module Change reference of the packaging if it's re-open.
""",
"website" : "http://www.julius.fr",
"depends" : [
"stock",
"stock_tracking_extended",
"tr_barcode",
],
"category" : "Customs/Stock",
"init_xml" : [],
"demo_xml" : [],
"images" : ['images/Tracking reopen.png'],
"update_xml" : [
'stock_view.xml',
],
'test': [],
'installable': True,
'active': False,
'certificate': '',
}

View File

@@ -1,57 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * stock_tracking_reopen
#
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:48+0000\n"
"PO-Revision-Date: 2011-12-19 10:48+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_reopen
#: field:stock.tracking,previous_id:0
msgid "Previous Pack"
msgstr "Colis précédent"
#. module: stock_tracking_reopen
#: field:stock.tracking.history,previous_ref:0
msgid "Previous reference"
msgstr "Référence précédente"
#. module: stock_tracking_reopen
#: model:ir.model,name:stock_tracking_reopen.model_stock_tracking
msgid "Packs"
msgstr "Colis"
#. module: stock_tracking_reopen
#: constraint:stock.tracking:0
msgid "Bad parent type selection. Please try again."
msgstr "Mauvais choix du type parent. Veuillez réessayez à nouveau."
#. module: stock_tracking_reopen
#: model:ir.model,name:stock_tracking_reopen.model_stock_tracking_history
msgid "stock.tracking.history"
msgstr "stock.tracking.history"
#. module: stock_tracking_reopen
#: field:stock.tracking,modified:0
msgid "Modified"
msgstr "Mis à jour"
#. module: stock_tracking_reopen
#: model:ir.module.module,shortdesc:stock_tracking_reopen.module_meta_information
msgid "Stock tracking Re-open"
msgstr "Réouverture de colis"
#. module: stock_tracking_reopen
#: model:ir.module.module,description:stock_tracking_reopen.module_meta_information
msgid " This module Change reference of the packaging if it's re-open "
msgstr " Ce module change la référence du colis si il est ré-ouvert "

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

View File

@@ -1,133 +0,0 @@
# -*- coding: utf-8 -*-
#################################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
#
# 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 <http://www.gnu.org/licenses/>.
#
#################################################################################
from osv import fields, osv
from tools.translate import _
import time
class stock_tracking(osv.osv):
_inherit = 'stock.tracking'
_columns = {
'previous_id': fields.many2one('stock.tracking', 'Previous Pack', readonly=True),
'modified': fields.boolean('Modified'),
}
_default = {
'modified': False,
}
'''Function for pack creation'''
def create_pack(self, cr, uid, ids, context=None):
'''Init'''
if context == None:
context = {}
'''Location determination'''
stock_tracking_data = self.browse(cr, uid, ids[0])
'''Pack Creation'''
tracking_id = self.create(cr, uid, {'ul_id': stock_tracking_data.ul_id.id, 'location_id': stock_tracking_data.location_id.id})
'''Pack name is returned'''
return tracking_id
def reset_open(self, cr, uid, ids, context=None):
res = super(stock_tracking, self).reset_open(cr, uid, ids, context)
pack_ids = self.browse(cr, uid, ids, context)
for pack in pack_ids:
if pack.state == 'open':
self.pool.get('stock.tracking.history').create(cr, uid, {
'type': 'reopen',
'previous_ref': pack.name,
'tracking_id': pack.id
}, context)
return True
def set_close(self, cr, uid, ids, context=None):
barcode_obj = self.pool.get('tr.barcode')
stock_move_obj = self.pool.get('stock.move')
history_obj = self.pool.get('stock.tracking.history')
res = super(stock_tracking, self).set_close(cr, uid, ids, context)
if res:
pack_ids = self.browse(cr, uid, ids, context)
for pack in pack_ids:
if pack.state == 'open':
if self.pool.get('stock.tracking.history').search(cr,uid,[('type','=','reopen'),('tracking_id','=',pack.id)]) and pack.modified == True:
new_pack_id = self.create_pack(cr, uid, ids, context)
new_pack_data = self.browse(cr, uid, new_pack_id, context)
'''loop on each move form the old pack to the new pack'''
for pack_move in pack.current_move_ids:
'''stock move creation'''
barcode_name = pack_move.prodlot_id.name
barcode_data = barcode_obj.search(cr, uid,[('code', '=', barcode_name)], limit=1)
move_id = stock_move_obj.create(cr, uid, {
'name': pack_move.name,
'state': pack_move.state,
'product_id': pack_move.product_id.id,
'product_uom': pack_move.product_uom.id,
'prodlot_id': pack_move.prodlot_id.id,
'location_id': pack.location_id.id,
'location_dest_id': new_pack_data.location_id.id,
'tracking_id': new_pack_data.id,
})
'''end of loop'''
if pack.child_ids:
for child_pack_data in pack.child_ids:
if child_pack_data.state == 'close':
self.write(cr, uid, child_pack_data.id, {'active': False})
self.write(cr, uid, [new_child_pack_id], {'parent_id': new_pack_data.id,})
history_obj.create(cr, uid, {'type': 'pack_in',
'tracking_id': child_pack_data.id,
'parent_id': new_pack_data.id,
})
self.write(cr, uid, new_pack_data.id, {'location_id': child_pack_data.location_id and child_pack_data.location_id.id or False,})
self.write(cr, uid, [pack.id], {'state': 'close',
'active': False,
'modified': False})
'''Call for a function who will display serial code list and product list in the pack layout'''
self.get_products(cr, uid, [new_pack_data.id], context=None)
self.get_serials(cr, uid, [new_pack_data.id], context=None)
self.write(cr, uid, [pack.id], {'state': 'close'})
return res
stock_tracking()
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 + [('reopen','Re Open')]
return res
_columns = {
'type': fields.selection(_get_types, 'Type'),
'previous_ref': fields.char('Previous reference', size=128),
# 'previous_id': fields.many2one('stock.tracking', 'Previous pack'),
}
stock_tracking_history()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_tracking_history_tree" model="ir.ui.view">
<field name="name">stock.tracking.history.tree.reopen</field>
<field name="model">stock.tracking.history</field>
<field name="type">tree</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_history_tree"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="previous_ref"/>
</field>
</field>
</record>
<record id="view_tracking_history_form" model="ir.ui.view">
<field name="name">stock.tracking.history.form.reopen</field>
<field name="model">stock.tracking.history</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock_tracking_extended.view_tracking_history_form"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="previous_ref"/>
</field>
</field>
</record>
</data>
</openerp>