diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py index 9d0564a9060..f1601089207 100644 --- a/addons/account/__manifest__.py +++ b/addons/account/__manifest__.py @@ -39,6 +39,7 @@ You could use this simplified accounting in case you work with an (external) acc 'views/account_tax_views.xml', 'views/account_full_reconcile_views.xml', 'views/account_payment_term_views.xml', + 'views/account_payment_method.xml', 'views/res_partner_bank_views.xml', 'views/report_statement.xml', 'views/terms_template.xml', diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 15be42ca4c9..97ff29c754d 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -2092,7 +2092,7 @@ class AccountMove(models.Model): # Only invoice-like and journal entries in "auto tax mode" are synced tax_container['records'] = container['records'].filtered(lambda m: (m.is_invoice(True) or m.line_ids.tax_ids and not m.tax_cash_basis_origin_move_id)) invoice_container['records'] = container['records'].filtered(lambda m: m.is_invoice(True)) - misc_container['records'] = container['records'].filtered(lambda m: m.move_type == 'entry' and not m.tax_cash_basis_origin_move_id) + misc_container['records'] = container['records'].filtered(lambda m: m.is_entry() and not m.tax_cash_basis_origin_move_id) tax_container, invoice_container, misc_container = ({} for __ in range(3)) update_containers() @@ -3672,6 +3672,9 @@ class AccountMove(models.Model): def is_invoice(self, include_receipts=False): return self.is_sale_document(include_receipts) or self.is_purchase_document(include_receipts) + def is_entry(self): + return self.move_type == 'entry' + @api.model def get_sale_types(self, include_receipts=False): return ['out_invoice', 'out_refund'] + (include_receipts and ['out_receipt'] or []) diff --git a/addons/account/models/account_payment_method.py b/addons/account/models/account_payment_method.py index 1a5126ef606..89e8a73aa46 100644 --- a/addons/account/models/account_payment_method.py +++ b/addons/account/models/account_payment_method.py @@ -119,6 +119,11 @@ class AccountPaymentMethodLine(models.Model): company_id = fields.Many2one(related='journal_id.company_id') available_payment_method_ids = fields.Many2many(related='journal_id.available_payment_method_ids') + def name_get(self): + if self.env.context.get('show_payment_journal_id'): + return [(method.id, "%s (%s)" % (method.name, method.journal_id.name)) for method in self] + return super().name_get() + @api.depends('payment_method_id.name') def _compute_name(self): for method in self: diff --git a/addons/account/views/account_payment_method.xml b/addons/account/views/account_payment_method.xml new file mode 100644 index 00000000000..089ad49b718 --- /dev/null +++ b/addons/account/views/account_payment_method.xml @@ -0,0 +1,15 @@ + + + + + account.payment.method.line.tree + account.payment.method.line + + + + + + + + + diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index 38704aadb77..db8d26da13e 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -227,7 +227,9 @@ -