feat: Generate account move line title using account name for non-income accounts in non-sales transactions.
This commit is contained in:
parent
e96bceedf6
commit
81c311b5d6
@ -295,8 +295,16 @@ class PosSession(models.Model):
|
|||||||
|
|
||||||
tax_ids = set(tax[0] for tax in tax_keys) if tax_keys else set()
|
tax_ids = set(tax[0] for tax in tax_keys) if tax_keys else set()
|
||||||
applied_taxes = self.env['account.tax'].browse(tax_ids)
|
applied_taxes = self.env['account.tax'].browse(tax_ids)
|
||||||
title = _('Sales') if sign == 1 else _('Refund')
|
|
||||||
|
|
||||||
|
if sign == 1:
|
||||||
|
title = _('Sales')
|
||||||
|
else:
|
||||||
|
account = self.env['account.account'].browse(account_id)
|
||||||
|
if account.account_type in ('income', 'income_other'):
|
||||||
|
title = _('Refund')
|
||||||
|
else:
|
||||||
|
title = account.name
|
||||||
|
|
||||||
# Create name with payment method information
|
# Create name with payment method information
|
||||||
if payment_method_name:
|
if payment_method_name:
|
||||||
name = _('%s - %s', title, payment_method_name)
|
name = _('%s - %s', title, payment_method_name)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user