Browse Source

Mar 7 :[UPDT] Updated 'user_warehouse_restriction'

pull/317/merge
AjmalCybro 2 months ago
parent
commit
1db234b958
  1. 2
      user_warehouse_restriction/models/res_config_settings.py
  2. 2
      user_warehouse_restriction/models/res_users.py
  3. 1
      user_warehouse_restriction/models/stock_picking.py

2
user_warehouse_restriction/models/res_config_settings.py

@ -39,7 +39,7 @@ class ResConfigSettings(models.TransientModel):
@api.onchange('group_user_warehouse_restriction') @api.onchange('group_user_warehouse_restriction')
def _onchange_group_user_warehouse_restriction(self): def _onchange_group_user_warehouse_restriction(self):
print("_onchange_group_user_warehouse_restriction")
"""This method is triggered when the 'group_user_warehouse_restriction' """This method is triggered when the 'group_user_warehouse_restriction'
field is changed. if it's true, assigns the current user as the field is changed. if it's true, assigns the current user as the
allowed user of all existing warehouses.""" allowed user of all existing warehouses."""

2
user_warehouse_restriction/models/res_users.py

@ -46,11 +46,9 @@ class ResUsers(models.Model):
def write(self, vals): def write(self, vals):
self.clear_caches() self.clear_caches()
print(vals)
return super(ResUsers, self).write(vals) return super(ResUsers, self).write(vals)
def _compute_check_user(self): def _compute_check_user(self):
print("_compute_check_user")
"""To determine if the user has warehouse location restrictions. """To determine if the user has warehouse location restrictions.
Sets the check_user field accordingly.""" Sets the check_user field accordingly."""
restriction_group_id = self.env.ref( restriction_group_id = self.env.ref(

1
user_warehouse_restriction/models/stock_picking.py

@ -29,7 +29,6 @@ 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):
print("_onchange_location_id")
"""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'): if self.env['ir.config_parameter'].sudo().get_param('user_warehouse_restriction.group_user_warehouse_restriction'):
return { return {

Loading…
Cancel
Save