Merge pull request #1020 from expsa/make-product-req

make product
This commit is contained in:
eslam 2024-09-05 15:27:19 +03:00 committed by GitHub
commit 7b06f79c84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,8 @@ class PurchaseRequest(models.Model):
self.department_id = self._default_emp().department_id.id
def action_submit(self):
if len(self.line_ids) == 0:
raise ValidationError(_("Can't Confirm Request With No Item!"))
self.write({'state': 'direct_manager'})
def action_confirm(self):