Browse Source

Apr 24 [UPDT] : Updated 'user_warehouse_restriction'

pull/278/merge
AjmalCybro 1 year ago
parent
commit
cc2fcd19e2
  1. 2
      user_warehouse_restriction/__manifest__.py
  2. 5
      user_warehouse_restriction/doc/RELEASE_NOTES.md
  3. 2
      user_warehouse_restriction/models/stock_picking.py

2
user_warehouse_restriction/__manifest__.py

@ -21,7 +21,7 @@
############################################################################### ###############################################################################
{ {
'name': "User Warehouse Restriction", 'name': "User Warehouse Restriction",
'version': '16.0.1.0.0', 'version': '16.0.2.0.0',
'category': 'Warehouse', 'category': 'Warehouse',
'summary': """Restrict Warehouses and location for users.""", 'summary': """Restrict Warehouses and location for users.""",
'description': """This module helps you to restrict warehouse and stock 'description': """This module helps you to restrict warehouse and stock

5
user_warehouse_restriction/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 16.0.1.0.0 #### Version 16.0.1.0.0
#### ADD #### ADD
- Initial commit for User Warehouse Restriction - Initial commit for User Warehouse Restriction
#### 23.04.2024
#### Version 16.0.2.0.0
#### UPDT
- Added Condition for stock picking

2
user_warehouse_restriction/models/stock_picking.py

@ -30,9 +30,11 @@ class StockPicking(models.Model):
@api.onchange('location_id', 'location_dest_id') @api.onchange('location_id', 'location_dest_id')
def _onchange_location_id(self): def _onchange_location_id(self):
"""Domain for location_id and location_dest_id.""" """Domain for location_id and location_dest_id."""
if self.env['ir.config_parameter'].sudo().get_param('user_warehouse_restriction.group_user_warehouse_restriction'):
return { return {
'domain': {'location_id': [ 'domain': {'location_id': [
('warehouse_id.user_ids', 'in', self.env.user.id)], ('warehouse_id.user_ids', 'in', self.env.user.id)],
'location_dest_id': [ 'location_dest_id': [
('warehouse_id.user_ids', 'in', self.env.user.id)]}} ('warehouse_id.user_ids', 'in', self.env.user.id)]}}

Loading…
Cancel
Save