[FIX] payment: enhance log message for payment requests
Before this commit, the log message did not clearly indicate who attempted to request a payment. After this commit, the message specifies whether the payment request was initiated by the customer or by the system. task-3864521 closes odoo/odoo#161252 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
@@ -196,15 +196,15 @@ class PaymentTransaction(models.Model):
|
||||
:return: None
|
||||
"""
|
||||
self.ensure_one()
|
||||
self = self.with_user(SUPERUSER_ID) # Log messages as 'OdooBot'
|
||||
author = self.env.user.partner_id if self.env.uid == SUPERUSER_ID else self.partner_id
|
||||
if self.source_transaction_id:
|
||||
for invoice in self.source_transaction_id.invoice_ids:
|
||||
invoice.message_post(body=message)
|
||||
invoice.message_post(body=message, author_id=author.id)
|
||||
payment_id = self.source_transaction_id.payment_id
|
||||
if payment_id:
|
||||
payment_id.message_post(body=message)
|
||||
payment_id.message_post(body=message, author_id=author.id)
|
||||
for invoice in self.invoice_ids:
|
||||
invoice.message_post(body=message)
|
||||
invoice.message_post(body=message, author_id=author.id)
|
||||
|
||||
#=== BUSINESS METHODS - POST-PROCESSING ===#
|
||||
|
||||
|
||||
@@ -106,9 +106,9 @@ class PaymentTransaction(models.Model):
|
||||
:return: None
|
||||
"""
|
||||
super()._log_message_on_linked_documents(message)
|
||||
self = self.with_user(SUPERUSER_ID) # Log messages as 'OdooBot'
|
||||
author = self.env.user.partner_id if self.env.uid == SUPERUSER_ID else self.partner_id
|
||||
for order in self.sale_order_ids or self.source_transaction_id.sale_order_ids:
|
||||
order.message_post(body=message)
|
||||
order.message_post(body=message, author_id=author.id)
|
||||
|
||||
def _reconcile_after_done(self):
|
||||
""" Override of payment to automatically confirm quotations and generate invoices. """
|
||||
|
||||
Reference in New Issue
Block a user