diff --git a/account_banking_mandate/models/account_invoice.py b/account_banking_mandate/models/account_invoice.py index 140a78229..d821ee3e2 100644 --- a/account_banking_mandate/models/account_invoice.py +++ b/account_banking_mandate/models/account_invoice.py @@ -59,7 +59,8 @@ class AccountInvoice(models.Model): ('state', '=', 'valid'), ('partner_id', '=', self.commercial_partner_id.id), ]) - self.mandate_id = mandates[0] + if mandates: + self.mandate_id = mandates[0] else: self.mandate_id = False diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py index d87b57351..619de6f20 100644 --- a/account_payment_order/models/account_move_line.py +++ b/account_payment_order/models/account_move_line.py @@ -23,7 +23,7 @@ class AccountMoveLine(models.Model): aplo = self.env['account.payment.line'] # default values for communication_type and communication communication_type = 'normal' - communication = self.move_id.name or '-' + communication = self.move_id.ref or '-' # change these default values if move line is linked to an invoice if self.invoice_id: if self.invoice_id.reference_type != 'none': diff --git a/account_payment_order/views/account_payment_mode.xml b/account_payment_order/views/account_payment_mode.xml index 951c59bf3..966f7b987 100644 --- a/account_payment_order/views/account_payment_mode.xml +++ b/account_payment_order/views/account_payment_mode.xml @@ -8,21 +8,29 @@ account.payment.mode + + + - - + - + - +