Skip to content

Commit a5fde34

Browse files
authored
Merge pull request #868 from OpenSPP/fix/change-request-name-sequence
[RMV] remove duplicated override of create method
2 parents 9f54353 + bac619f commit a5fde34

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

spp_change_request/models/change_request.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -536,36 +536,6 @@ def approve_cr(self):
536536
raise ValidationError(_("User is not allowed to approve CRs directly."))
537537
return self.request_type_ref_id._approve_cr(self)
538538

539-
# Override the create method to use the correct activity type
540-
@api.model
541-
def create(self, vals):
542-
"""
543-
Creates a record for this model and generate activity
544-
545-
Usage:
546-
547-
- Add/Update key-value pair on vals before calling super
548-
- Generate activity and add the activity to the result of super
549-
550-
:param dict vals: field name and value pair
551-
552-
:return recordset res:
553-
554-
:raise:
555-
"""
556-
557-
# Assign the CR to the current user by default
558-
if "assign_to_id" not in vals or vals["assign_to_id"] is None:
559-
vals["assign_to_id"] = self.env.user.id
560-
vals["name"] = self.env["ir.sequence"].next_by_code("spp.change.request.num")
561-
res = super().create(vals)
562-
# Create pending validation activity
563-
activity_type = "spp_change_request_base.pending_validation_activity"
564-
summary = _("For Pending Validation")
565-
note = _("A new change request was submitted. The next step will set this request to 'Pending Validation'.")
566-
res._generate_activity(activity_type, summary, note)
567-
return res
568-
569539
# Override the action_cancel method to use the correct wizard reference
570540
def action_cancel(self):
571541
"""

0 commit comments

Comments
 (0)