Skip to content

Commit

Permalink
[REF] account: Create function _get_aml_default_display_map to allow …
Browse files Browse the repository at this point in the history
…other modules to inherit and add new key pairs

closes #122694

X-original-commit: 98cda20
Signed-off-by: Laurent Smet <las@odoo.com>
  • Loading branch information
daonamutc1 committed May 30, 2023
1 parent cae2773 commit e3be581
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions addons/account/models/account_payment.py
Expand Up @@ -199,6 +199,14 @@ def _get_valid_liquidity_accounts(self):
self.journal_id.outbound_payment_method_line_ids.payment_account_id,
)

def _get_aml_default_display_map(self):
return {
('outbound', 'customer'): _("Customer Reimbursement"),
('inbound', 'customer'): _("Customer Payment"),
('outbound', 'supplier'): _("Vendor Payment"),
('inbound', 'supplier'): _("Vendor Reimbursement"),
}

def _get_aml_default_display_name_list(self):
""" Hook allowing custom values when constructing the default label to set on the journal items.
Expand All @@ -212,12 +220,7 @@ def _get_aml_default_display_name_list(self):
]
"""
self.ensure_one()
display_map = {
('outbound', 'customer'): _("Customer Reimbursement"),
('inbound', 'customer'): _("Customer Payment"),
('outbound', 'supplier'): _("Vendor Payment"),
('inbound', 'supplier'): _("Vendor Reimbursement"),
}
display_map = self._get_aml_default_display_map()
values = [
('label', _("Internal Transfer") if self.is_internal_transfer else display_map[(self.payment_type, self.partner_type)]),
('sep', ' '),
Expand Down

0 comments on commit e3be581

Please sign in to comment.