Merge pull request #3166 from expsa/y_dev_odex25_purchase

Fix asset operations display for purchase requests
This commit is contained in:
kchyounes19 2025-05-12 12:15:49 +01:00 committed by GitHub
commit 702ba2e048
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -480,6 +480,7 @@ class PurchaseRequest(models.Model):
if custody_lines:
CustodyLine.create(custody_lines)
self.create_asset_operation()
if products_with_issues:
warning_message = _("No available assets found for the following products: {}").format(
", ".join(products_with_issues)
@ -494,7 +495,7 @@ class PurchaseRequest(models.Model):
'type': 'warning',
}
}
self.create_asset_operation()
return True
def asset_operation_release(self):
@ -565,6 +566,7 @@ class PurchaseRequest(models.Model):
'context': context,
}
class PurchaseRequestLine(models.Model):
_inherit = 'purchase.request.line'
_description = 'purchase request line'