mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[14.0][IMP] account_payment_order: Add a hook method to retrieve communication type and communication
This commit is contained in:
@@ -48,9 +48,10 @@ class AccountMoveLine(models.Model):
|
||||
else:
|
||||
ml.partner_bank_id = ml.partner_bank_id
|
||||
|
||||
def _prepare_payment_line_vals(self, payment_order):
|
||||
self.ensure_one()
|
||||
assert payment_order, "Missing payment order"
|
||||
def _get_communication(self):
|
||||
"""
|
||||
Retrieve the communication string for the payment order
|
||||
"""
|
||||
aplo = self.env["account.payment.line"]
|
||||
# default values for communication_type and communication
|
||||
communication_type = "normal"
|
||||
@@ -70,6 +71,12 @@ class AccountMoveLine(models.Model):
|
||||
elif "out" in self.move_id.move_type:
|
||||
# Force to only put invoice number here
|
||||
communication = self.move_id.name
|
||||
return communication_type, communication
|
||||
|
||||
def _prepare_payment_line_vals(self, payment_order):
|
||||
self.ensure_one()
|
||||
assert payment_order, "Missing payment order"
|
||||
communication_type, communication = self._get_communication()
|
||||
if self.currency_id:
|
||||
currency_id = self.currency_id.id
|
||||
amount_currency = self.amount_residual_currency
|
||||
|
||||
Reference in New Issue
Block a user