diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-21 09:48:11 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-21 09:48:11 +0700 |
| commit | b9bdfb05f96affaeec8e197b6585df140d4cd11c (patch) | |
| tree | dd1ea6e784b2e882cb9cc2b50611e8e379f901d8 | |
| parent | ffa3c65f93c3b042fb2cb813c17483e7b8ccc4cf (diff) | |
cr stock_picking
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 16805197..10b26711 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -444,14 +444,13 @@ class StockPicking(models.Model): pick.approval_return_status = 'approved' continue + action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_stock_return_note_wizard') + 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 ): - 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] - } + 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') @@ -462,17 +461,13 @@ 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 ): - 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] - } + 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: raise UserError('Harus Purchasing yang Ask Return') - def calculate_line_no(self): for picking in self: |
