mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
Improve performance when creating a picking from rma
# Conflicts: # crm_claim_rma/wizards/claim_make_picking.py
This commit is contained in:
@@ -75,9 +75,9 @@ class ClaimMakePicking(models.TransientModel):
|
||||
domain = [('claim_id', '=', self.env.context['active_id'])]
|
||||
lines = self.env['claim.line'].search(domain)
|
||||
if lines:
|
||||
lines = lines.filtered(
|
||||
lambda l: getattr(getattr(l, move_field), 'state') == 'cancel'
|
||||
or not getattr(l, move_field))
|
||||
lines = lines.filtered(lambda l: getattr(getattr(l, move_field),
|
||||
'state') == 'cancel' or
|
||||
not getattr(l, move_field))
|
||||
if not lines:
|
||||
raise exceptions.UserError(
|
||||
_('A picking has already been created for this claim.')
|
||||
|
||||
Reference in New Issue
Block a user