diff --git a/addons/account/models/account.py b/addons/account/models/account.py index ac7b7912a99..082273b3644 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -390,7 +390,7 @@ class AccountJournal(models.Model): if vals.get('type') in ('bank', 'cash'): # For convenience, the name can be inferred from account number if not vals.get('name') and 'bank_acc_number' in vals: - vals['name'] = _('Bank') + ' ' + vals['bank_acc_number'] + vals['name'] = vals['bank_acc_number'] # If no code provided, loop to find next available journal code if not vals.get('code'): diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 4c93cb35b94..e81b2f8af98 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -818,7 +818,7 @@ class AccountBankStatementLine(models.Model): ctx = dict(self._context, date=self.date) for aml_dict in to_create: aml_dict['move_id'] = move.id - aml_dict['date'] = self.statement_id.date + aml_dict['date'] = self.date aml_dict['partner_id'] = self.partner_id.id aml_dict['journal_id'] = self.journal_id.id aml_dict['company_id'] = self.company_id.id diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py index 183b16fc676..7e8b51ce2f9 100644 --- a/addons/account/models/account_payment.py +++ b/addons/account/models/account_payment.py @@ -120,8 +120,8 @@ class account_register_payments(models.TransientModel): invoices = self.env[active_model].browse(active_ids) if any(invoice.state != 'open' for invoice in invoices): raise UserError(_("You can only register payments for open invoices")) - if any(inv.partner_id != invoices[0].partner_id for inv in invoices): - raise UserError(_("In order to pay multiple invoices at once, they must belong to the same partner.")) + if any(inv.commercial_partner_id != invoices[0].commercial_partner_id for inv in invoices): + raise UserError(_("In order to pay multiple invoices at once, they must belong to the same commercial partner.")) if any(MAP_INVOICE_TYPE_PARTNER_TYPE[inv.type] != MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type] for inv in invoices): raise UserError(_("You cannot mix customer invoices and vendor bills in a single payment.")) if any(inv.currency_id != invoices[0].currency_id for inv in invoices): @@ -132,7 +132,7 @@ class account_register_payments(models.TransientModel): 'amount': abs(total_amount), 'currency_id': invoices[0].currency_id.id, 'payment_type': total_amount > 0 and 'inbound' or 'outbound', - 'partner_id': invoices[0].partner_id.id, + 'partner_id': invoices[0].commercial_partner_id.id, 'partner_type': MAP_INVOICE_TYPE_PARTNER_TYPE[invoices[0].type], }) return rec diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index 3cb5c0ef0e8..deb16e0e958 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -516,7 +516,7 @@ - + diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index c1191000f2f..e54aa4317c1 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -189,9 +189,9 @@