Skip to content

Commit

Permalink
Fix: problem on update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Jul 11, 2024
1 parent ca7130d commit bef07fa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions plm/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,14 @@ def action_create_normalBom_WF(self):
self.wf_message_post(body=_('Created Normal Bom.'))
return False

def checkWorkflow(self, docInError, linkeddocuments, check_state):
def checkWorkflow(self,
docInError,
linkeddocuments,
check_state):
docIDs = []
attachment = self.env['ir.attachment']
for documentBrws in linkeddocuments:
if documentBrws.state == check_state:
if documentBrws.state in check_state:
if documentBrws.is_checkout:
docInError.append(_("Document %r : %r is checked out by user %r") % (documentBrws.name, documentBrws.revisionid, documentBrws.checkout_user))
continue
Expand All @@ -729,13 +732,10 @@ def _action_ondocuments(self, action_name, include_statuses=[]):
"""
docIDs = []
docInError = []
documentType = self.env['ir.attachment']
for oldObject in self:
if (action_name != 'transmit') and (action_name != 'reject') and (action_name != 'release'):
check_state = oldObject.state
else:
check_state = 'confirmed'
docIDs.extend(self.checkWorkflow(docInError, oldObject.linkeddocuments, check_state))
docIDs.extend(self.checkWorkflow(docInError,
oldObject.linkeddocuments,
include_statuses))
if docInError:
msg = _("Error on workflow operation")
for e in docInError:
Expand Down

0 comments on commit bef07fa

Please sign in to comment.