diff --git a/README.md b/README.md
index 7bb0dcb..6de8333 100644
--- a/README.md
+++ b/README.md
@@ -19,3 +19,8 @@ For Support :
* Website : www.techspawn.com
* Facebook : www.facebook.com/techspawnsolutions/
* Twitter : www.twitter.com/techspawn/
+
+Contributors:
+=============
+
+* F?brica de Software Libre: www.fslibre.com
\ No newline at end of file
diff --git a/__init__.pyc b/__init__.pyc
deleted file mode 100644
index b067e0a..0000000
Binary files a/__init__.pyc and /dev/null differ
diff --git a/__openerp__.py b/__openerp__.py
index cf255e6..dc3e4d2 100644
--- a/__openerp__.py
+++ b/__openerp__.py
@@ -37,8 +37,11 @@
'depends': ['base', 'stock'],
'data': [
-
'users_view.xml',
- 'security/security.xml',
+ 'stock_view.xml',
+ 'security/security.xml',
],
+ 'installable': True,
+ 'application': False,
+ 'auto_install': False,
}
\ No newline at end of file
diff --git a/security/security.xml b/security/security.xml
index 375e68e..92432cd 100644
--- a/security/security.xml
+++ b/security/security.xml
@@ -1,13 +1,9 @@
-
-
-
-
- Filter Stock Picking Type Allowed
-
-
- [('id','in', [ p.id for p in user.default_picking_type_ids ])]
-
-
-
-
\ No newline at end of file
+
+
+ Filter Stock Picking Type Allowed
+
+
+ ['|', ('allowed_user_ids','=', False), ('id','in', [ p.id for p in user.default_picking_type_ids ])]
+
+
\ No newline at end of file
diff --git a/stock.py b/stock.py
index a0fd0e7..4cbc284 100644
--- a/stock.py
+++ b/stock.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-
from openerp import models, fields, api, _
from openerp.exceptions import Warning
+
class ResUsers(models.Model):
_inherit = 'res.users'
@@ -20,6 +20,14 @@ class ResUsers(models.Model):
'user_id', 'picking_type_id', string='Default Warehouse Operations')
+class StockPickingType(models.Model):
+ _inherit = 'stock.picking.type'
+
+ allowed_user_ids = fields.Many2many(
+ 'res.users', 'stock_picking_type_users_rel',
+ 'picking_type_id', 'user_id', string='Allowed users', )
+
+
class stock_move(models.Model):
_inherit = 'stock.move'
@@ -38,5 +46,3 @@ def check_user_location_rights(self):
raise Warning(message % self.location_id.name)
elif self.location_dest_id not in user_locations:
raise Warning(message % self.location_dest_id.name)
-
-
diff --git a/stock.pyc b/stock.pyc
deleted file mode 100644
index e439a47..0000000
Binary files a/stock.pyc and /dev/null differ
diff --git a/stock_view.xml b/stock_view.xml
new file mode 100644
index 0000000..b393e2d
--- /dev/null
+++ b/stock_view.xml
@@ -0,0 +1,15 @@
+
+
+
+ Picking type allowed users form view
+ stock.picking.type
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/users_view.xml b/users_view.xml
index c882c69..db85f12 100644
--- a/users_view.xml
+++ b/users_view.xml
@@ -1,31 +1,17 @@
-
-
-
- usability.default_warehouse.res.users.form
- res.users
-
-
-
+
+
+ usability.default_warehouse.res.users.form
+ res.users
+
+
+
+
+
+
-
-
-
-
- location_security.users.form
- res.users
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
\ No newline at end of file