hotfix
This commit is contained in:
parent
d694b1231c
commit
e01c9854d0
|
|
@ -67,13 +67,13 @@ class PurchaseRequest(models.Model):
|
|||
def create_requisition(self):
|
||||
"""inherit for take in considiration available qty """
|
||||
self.is_requisition = True
|
||||
if not self.employee_id.department_id:
|
||||
if not self.sudo().employee_id.department_id:
|
||||
raise ValidationError(_("Choose A Department For this Employee!"))
|
||||
line_ids = []
|
||||
for line in self.line_ids.filtered(lambda line: line.qty_purchased > 0):
|
||||
line_ids.append((0, 6, {
|
||||
'product_id': line.product_id.id,
|
||||
'department_id': line.request_id.department_id.id or False,
|
||||
'department_id': line.request_id.sudo().department_id.id or False,
|
||||
'product_qty': line.qty_purchased,
|
||||
'name': line.product_id.name,
|
||||
'account_analytic_id': line.account_id.id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue