Skip to content

Commit

Permalink
[FIX] stock: write on warehouse name
Browse files Browse the repository at this point in the history
fixes odoo#19696

closes odoo#46048

Signed-off-by: Arnold Moyaux <[email protected]>
  • Loading branch information
sle-odoo committed Feb 24, 2020
1 parent 1d1d5e2 commit d4d012f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/stock/models/stock_warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,9 @@ def _update_name_and_code(self, new_name=False, new_code=False):
warehouse.mto_pull_id.write({'name': warehouse.mto_pull_id.name.replace(warehouse.name, new_name, 1)})
for warehouse in self:
sequence_data = warehouse._get_sequence_values()
# `ir.sequence` write access is limited to system user
if self.user_has_groups('stock.group_stock_manager'):
warehouse = warehouse.sudo()
warehouse.in_type_id.sequence_id.write(sequence_data['in_type_id'])
warehouse.out_type_id.sequence_id.write(sequence_data['out_type_id'])
warehouse.pack_type_id.sequence_id.write(sequence_data['pack_type_id'])
Expand Down

0 comments on commit d4d012f

Please sign in to comment.