Skip to content

Conversation

matthieusaison
Copy link

Add a new display type in journal_account to handle the payment type without useless account to define.

@matthieusaison matthieusaison force-pushed the 14.0-account_journal_display_type branch from 8eee407 to c89f1b7 Compare February 9, 2024 09:47
"Select 'Cash' or 'Bank' for journals that are used in customer or vendor payments.\n"
"Select 'General' for miscellaneous operations journals.",
)
type = fields.Selection(compute="_compute_type", store=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is python builtin and then shouldn't be used as a variable : you may use type_ or kind

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the type is define in odoo core, the goal is to redefine this field to handle "payment" journal as type "bank" without useless account reference (default_account_id will have the same value as payment_debit_account_id).

If display type is payment, payment_debit_account_id and payment_credit_account_id are sufficient required fields.
If display type is cash, the only field we keep is default_account_id. the payment config tabs is useless for a cash journal. (in this case payment_debit_account_id and payment_credit_account_id are set with value of default_account_id)

https://github.com/OCA/OCB/blob/14.0/addons/account/models/account_account.py#L13

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops you're right, sorry

Copy link
Member

@bealdav bealdav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make a readme to define what is the advantage to have this type. Use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants