diff --git a/addons/account_payment/__manifest__.py b/addons/account_payment/__manifest__.py index 8b5068b930c..dbcec3696bc 100644 --- a/addons/account_payment/__manifest__.py +++ b/addons/account_payment/__manifest__.py @@ -19,6 +19,7 @@ 'views/account_move_views.xml', 'views/account_journal_views.xml', 'views/account_payment_views.xml', + 'views/onboarding_templates.xml', 'views/payment_provider_views.xml', 'views/payment_transaction_views.xml', diff --git a/addons/account_payment/models/__init__.py b/addons/account_payment/models/__init__.py index 1a548501a06..b3efe32217f 100644 --- a/addons/account_payment/models/__init__.py +++ b/addons/account_payment/models/__init__.py @@ -7,3 +7,4 @@ from . import account_payment_method from . import account_payment_method_line from . import payment_provider from . import payment_transaction +from . import res_company diff --git a/addons/account_payment/models/res_company.py b/addons/account_payment/models/res_company.py new file mode 100644 index 00000000000..2ed14af310c --- /dev/null +++ b/addons/account_payment/models/res_company.py @@ -0,0 +1,19 @@ +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import api, models + + +class ResCompany(models.Model): + _inherit = 'res.company' + + @api.model + def action_open_payment_onboarding(self): + self.env.company.payment_onboarding_payment_method = 'stripe' + menu = self.env.ref('account_payment.payment_provider_menu', raise_if_not_found=False) + menu_id = menu and menu.id + return self._run_payment_onboarding_step(menu_id) + + def get_account_invoice_onboarding_steps_states_names(self): + """ Override of `account` to add the state of the payment onboarding step. """ + steps = super().get_account_invoice_onboarding_steps_states_names() + return steps + ['payment_provider_onboarding_state'] diff --git a/addons/account_payment/views/onboarding_templates.xml b/addons/account_payment/views/onboarding_templates.xml new file mode 100644 index 00000000000..8485c35c26b --- /dev/null +++ b/addons/account_payment/views/onboarding_templates.xml @@ -0,0 +1,22 @@ + + + + + + + +