diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-21 09:46:54 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-21 09:46:54 +0700 |
| commit | ffa3c65f93c3b042fb2cb813c17483e7b8ccc4cf (patch) | |
| tree | 7c3dbf4d65c0258a751c9b65eaadef9142718390 | |
| parent | 5a71f4543a265562abc36630d16059f9db92d056 (diff) | |
cr stock picking
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index f17e12b7..16805197 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -444,15 +444,15 @@ class StockPicking(models.Model): pick.approval_return_status = 'approved' continue - action_context = { - 'picking_ids': [x.id for x in self] - } - if self.picking_type_code == 'outgoing': if self.env.user.id in [3988, 3401, 20] or ( self.env.user.has_group('indoteknik_custom.group_role_purchasing') and 'Return of' in self.origin ): - return self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_stock_return_note_wizard', context=action_context) + action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_stock_return_note_wizard') + action['context'] = { + 'picking_ids': [x.id for x in self] + } + return action elif not self.env.user.has_group('indoteknik_custom.group_role_purchasing') and 'Return of' in self.origin: raise UserError('Harus Purchasing yang Ask Return') else: @@ -462,7 +462,11 @@ class StockPicking(models.Model): if self.env.user.has_group('indoteknik_custom.group_role_purchasing') or ( self.env.user.id in [3988, 3401, 20] and 'Return of' in self.origin ): - return self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_stock_return_note_wizard', context=action_context) + action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_stock_return_note_wizard') + action['context'] = { + 'picking_ids': [x.id for x in self] + } + return action elif not self.env.user.id in [3988, 3401, 20] and 'Return of' in self.origin: raise UserError('Harus Sales Admin yang Ask Return') else: |
