Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions __manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
'website': "http://www.techspawn.com",

'category': 'Warehouse',
'version': '10.0.0.1',
'version': '10.0.0.2',

'depends': ['base', 'stock'],

'data': [
'views/users.xml',
'security/security.xml',
'views/stock.xml',
'security/security.xml',
],
'installable': True,
'application': False,
Expand Down
8 changes: 8 additions & 0 deletions models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 0 additions & 2 deletions security/ir.model.access.csv

This file was deleted.

2 changes: 1 addition & 1 deletion security/security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<field name="name">Filter Stock Picking Type Allowed</field>
<field name="model_id" search="[('model','=','stock.picking.type')]" model="ir.model"/>
<field name="groups" eval="[(4, ref('base.group_user'))]"/>
<field name="domain_force">[('id','in', [ p.id for p in user.default_picking_type_ids ])]</field>
<field name="domain_force">['|', ('allowed_user_ids','=', False), ('id','in', [ p.id for p in user.default_picking_type_ids ])]</field>
</record>
</odoo>
15 changes: 15 additions & 0 deletions views/stock.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_picking_type_form" model="ir.ui.view">
<field name="name">Picking type allowed users form view</field>
<field name="model">stock.picking.type</field>
<field name="inherit_id" ref="stock.view_picking_type_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="inside">
<group string="Allowed users" groups="stock.group_stock_manager">
<field name="allowed_user_ids" widget="many2many_tags"/>
</group>
</xpath>
</field>
</record>
</odoo>