Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] account journal display type #206

Open
wants to merge 3 commits into
base: 14.0
Choose a base branch
from

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

@matthieusaison matthieusaison force-pushed the 14.0-account_journal_display_type branch from 0b01997 to a5b2f74 Compare February 16, 2024 10:39
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