Skip to content

Commit

Permalink
IMP: activity validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mboscolo committed Jan 8, 2025
1 parent dbea828 commit 5c87bec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions activity_validation/models/mail_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,22 @@ def action_to_draft(self):
def action_to_done(self):
for activity_id in self:
activity_id.plm_state = 'done'
activity_id._action_done()
if activity_id.is_eco:
self.checkChildrenECODone(activity_id)
parents = self.getParentECOActivity(activity_id)
parent = self.getParentECOActivity(activity_id)
else:
self.checkChildrenECRDone(activity_id)
parents = self.getParentECRActivity(activity_id)
parent = self.getParentECRActivity(activity_id)
close = True
if parents.children_ids:
for child_activity_id in parents.children_ids:
if parent.is_eco and parent.eco_child_ids:
for child_activity_id in parent.eco_child_ids:
if child_activity_id.plm_state != 'done':
close = False
if close:
parents.children_ids.mail_children_activity_id._action_done()
else:
activity_id._action_done()
break
if close:#
parent.plm_state = 'done'
parent._action_done()

def action_to_exception(self):
for activity_id in self:
Expand Down
3 changes: 2 additions & 1 deletion plm_pdf_workorder_enterprise/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
available into the workorder workscheet.
""",
"license": "LGPL-3",
"depends": ["plm_pdf_workorder", "mrp_workorder"],
"depends": ["plm_pdf_workorder",
"mrp_workorder"],
"assets": {
"web.assets_backend": [
"plm_pdf_workorder_enterprise/static/src/mrpWorksheet.js",
Expand Down

0 comments on commit 5c87bec

Please sign in to comment.