Skip to content

Commit

Permalink
[REF] auto-fix conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
moylop260 committed Nov 14, 2014
1 parent 85dfb61 commit 5c7916c
Show file tree
Hide file tree
Showing 62 changed files with 1,260 additions and 1,066 deletions.
12 changes: 6 additions & 6 deletions __unported__/stock_barcode_reader/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,10 +17,10 @@
# 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 package_acquisition
import stock
import wizard
from . import package_acquisition
from . import stock
from . import wizard

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
28 changes: 14 additions & 14 deletions __unported__/stock_barcode_reader/__openerp__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,12 +17,12 @@
# 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 bar code reader",
"version" : "1.0",
"author" : "Julius Network Solutions",
"name": "Stock bar code reader",
"version": "1.0",
"author": "Julius Network Solutions",
"description" : """
Presentation:
Expand All @@ -39,16 +39,16 @@
This module adds a submenu for acquisition setting with a field Barcode and Action type.
""",
"website" : "http://www.julius.fr",
"depends" : [
"stock",
"stock_tracking_extended",
"stock_tracking_add_move",
"website": "http://www.julius.fr",
"depends": [
"stock",
"stock_tracking_extended",
"stock_tracking_add_move",
],
"category" : "Warehouse Management",
"images" : ['images/Acquisition.png'],
"demo" : [],
"data" : [
"category": "Warehouse Management",
"images": ['images/Acquisition.png'],
"demo": [],
"data": [
'wizard/reference_view.xml',
'acquisition_view.xml',
'stock_view.xml',
Expand Down
509 changes: 286 additions & 223 deletions __unported__/stock_barcode_reader/package_acquisition.py

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions __unported__/stock_barcode_reader/stock.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,10 +17,10 @@
# 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 openerp.osv import orm

from openerp.osv import osv, fields, orm
from openerp.tools.translate import _

class stock_picking(orm.Model):
_inherit = "stock.picking"
Expand All @@ -30,7 +30,8 @@ def start_acquisition(self, cr, uid, ids, context=None):
context = {}
active = self.browse(cr, uid, ids[0])
name = active.name
action_context = {'default_type': 'order', 'default_name': 'Preparation ' + name, 'default_picking_id': ids[0]}
action_context = {'default_type': 'order', 'default_name':
'Preparation ' + name, 'default_picking_id': ids[0]}
address_id = active.address_id and active.address_id.id or False
if address_id:
action_context.update({'default_address_id': address_id})
Expand All @@ -46,7 +47,7 @@ def start_acquisition(self, cr, uid, ids, context=None):
'view_mode': 'form',
'res_model': 'acquisition.acquisition',
'view_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock_barcode_reader', 'view_stock_tracking_acquisition_form')[1],
# 'menu_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'menu_stock_root')[1],
# 'menu_id': self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'menu_stock_root')[1],
'context': action_context
}
return action
Expand Down
8 changes: 4 additions & 4 deletions __unported__/stock_barcode_reader/wizard/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,8 +17,8 @@
# 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 reference
from . import reference

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
46 changes: 26 additions & 20 deletions __unported__/stock_barcode_reader/wizard/reference.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,11 +17,12 @@
# 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 openerp.osv import fields, osv, orm
from openerp.tools.translate import _


class stock_reference(orm.TransientModel):

_name = "stock.reference"
Expand All @@ -32,14 +33,14 @@ class stock_reference(orm.TransientModel):
def _get_track_id(self, cr, uid, context=None):
if context is None:
context = {}
return context.get('active_id',False)
return context.get('active_id', False)

_columns = {
# 'barcode_id': fields.many2one('tr.barcode', 'Reference', required=True),
# 'barcode_id': fields.many2one('tr.barcode', 'Reference', required=True),
'reference': fields.char('Reference', size=128, required=True),
'track_id': fields.many2one('acquisition.acquisition','Track id', required=True),
'text': fields.text('Barcode list',readonly=True),
# 'bad_barcode': fields.text('Bad barcode list',readonly=True),
'track_id': fields.many2one('acquisition.acquisition', 'Track id', required=True),
'text': fields.text('Barcode list', readonly=True),
# 'bad_barcode': fields.text('Bad barcode list',readonly=True),
}

_defaults = {
Expand All @@ -48,51 +49,56 @@ def _get_track_id(self, cr, uid, context=None):

def onchange_reference(self, cr, uid, ids, reference, track_id, barcode_list=''):

res = {}
barcode_obj = self.pool.get('tr.barcode')
acquisition_list = self.pool.get('acquisition.list')
acquisition_setting = self.pool.get('acquisition.setting')

text = barcode_list or ''

if reference:
barcode_ids = barcode_obj.search(cr, uid, [('code', '=', reference)], limit=1)
barcode_ids = barcode_obj.search(
cr, uid, [('code', '=', reference)], limit=1)
if not barcode_ids:
reference2 = reference
while len(reference2.split('-')) > 1:
reference2 = reference2.replace('-','')
barcode_ids = barcode_obj.search(cr, uid, [('code2', '=', reference2)], limit=1)
reference2 = reference2.replace('-', '')
barcode_ids = barcode_obj.search(
cr, uid, [('code2', '=', reference2)], limit=1)

if barcode_ids:
barcode_type = 'object'
line_ids = acquisition_list.search(cr, uid, [('barcode_id', '=', barcode_ids[0]), ('acquisition_id', '=', track_id)])
setting_ids = acquisition_setting.search(cr, uid, [('barcode_id', '=', barcode_ids[0])], limit=1)
line_ids = acquisition_list.search(
cr, uid, [('barcode_id', '=', barcode_ids[0]), ('acquisition_id', '=', track_id)])
setting_ids = acquisition_setting.search(
cr, uid, [('barcode_id', '=', barcode_ids[0])], limit=1)

if setting_ids:
setting_data = acquisition_setting.browse(cr, uid, setting_ids)
setting_data = acquisition_setting.browse(
cr, uid, setting_ids)
barcode_type = setting_data[0].action_type
create = True
if line_ids:
create = False
line_barcode = barcode_obj.read(cr, uid, barcode_ids[0], ['res_model'])
if line_barcode.get('res_model',False) == 'product.product' or setting_ids:
line_barcode = barcode_obj.read(
cr, uid, barcode_ids[0], ['res_model'])
if line_barcode.get('res_model', False) == 'product.product' or setting_ids:
create = True
if create:
acquisition_list.create(cr, uid, {
'barcode_id': barcode_ids[0],
'acquisition_id': track_id,
'type': barcode_type,
})
})
text = reference + '\n' + text

else:
raise osv.except_osv(_('Warning!'),_('Barcode Not found!')) # Return of the wraning msg !!
# Return of the wraning msg !!
raise osv.except_osv(_('Warning!'), _('Barcode Not found!'))
## bad_barcode = bad_barcode_list or ''
# bad_barcode += reference
# if bad_barcode:
# bad_barcode += '\n'


return {'value': {'reference' : False, 'text' : text}}
return {'value': {'reference': False, 'text': text}}

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
10 changes: 5 additions & 5 deletions __unported__/stock_move_packaging/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,9 +17,9 @@
# 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
from . import stock
from . import wizard

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
23 changes: 11 additions & 12 deletions __unported__/stock_move_packaging/__openerp__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,12 +17,12 @@
# 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",
"name": "Move Stock Packaging",
"version": "1.0",
"author": "Julius Network Solutions",
"description" : """
Presentation:
Expand All @@ -31,15 +31,15 @@
and adds fields for source location and destination location in History.
""",
"website" : "http://www.julius.fr",
"depends" : [
"website": "http://www.julius.fr",
"depends": [
"stock",
"stock_tracking_extended",
],
"category" : "Warehouse Management",
# "images" : ['images/Move packaging.png'],
"demo" : [],
"data" : [
"category": "Warehouse Management",
# "images" : ['images/Move packaging.png'],
"demo": [],
"data": [
'stock_view.xml',
'wizard/move_pack_view.xml',
],
Expand All @@ -49,4 +49,3 @@
}

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

18 changes: 10 additions & 8 deletions __unported__/stock_move_packaging/stock.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,27 +17,29 @@
# 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 openerp.osv import fields, osv, orm
from openerp.osv import fields
from openerp.osv import orm
from openerp.tools.translate import _


class stock_tracking_history(orm.Model):

_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'))]
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'),
# 'move_ids': fields.one2many('stock.move', 'pack_history_id', 'Associated moves'),
}

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
8 changes: 4 additions & 4 deletions __unported__/stock_move_packaging/wizard/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#################################################################################
##########################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
Expand All @@ -17,8 +17,8 @@
# 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
from . import move_pack

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

0 comments on commit 5c7916c

Please sign in to comment.