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

[12.0][FIX] account_usability - Fix stripe installation issue due to wrong account_type on transfert … #116

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions account_usability/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,3 +693,22 @@ class ResConfigSettings(models.TransientModel):

transfer_account_id = fields.Many2one(
related='company_id.transfer_account_id', readonly=False)


class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"

@api.model
def _prepare_transfer_account_template(self):
"""Change the type of default account in order to be
compliant with _check_account_type_on_bank_journal
Used at installation of payment modules like stripe
See https://github.com/akretion/odoo-usability/issues/115
"""
vals = super()._prepare_transfer_account_template()
current_assets_type = self.env.ref(
'account.data_account_type_liquidity', raise_if_not_found=False)
vals.update({
'user_type_id': current_assets_type and current_assets_type.id or False,
})
return vals
1 change: 1 addition & 0 deletions account_usability/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ This modules adds the following functions:
* don't attach PDF upon invoice report generation on supplier invoices/refunds
* Add filter on debit and credit amount for Move Lines
* Add supplier invoice number in invoice tree view
* Change type from current_assets to liquidity for transfert account template.

Together with this module, I recommend the use of the following modules:

Expand Down