This commit replaces the old online payments API of the `payment` module with the new one and adapts to it all the implementing modules. See the merge commit for more details. task-2085989 task-2119838 task-2165982 task-2289255 Co-authored-by: Victor Feyens <vfe@odoo.com>
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import api, fields, models
|
|
|
|
|
|
class ResCompany(models.Model):
|
|
_inherit = 'res.company'
|
|
|
|
payment_acquirer_onboarding_state = fields.Selection(
|
|
string="State of the onboarding payment acquirer step",
|
|
selection=[('not_done', "Not done"), ('just_done', "Just done"), ('done', "Done")],
|
|
default='not_done')
|
|
payment_onboarding_payment_method = fields.Selection(
|
|
string="Selected onboarding payment method",
|
|
selection=[
|
|
('paypal', "PayPal"),
|
|
('stripe', "Stripe"),
|
|
('manual', "Manual"),
|
|
('other', "Other"),
|
|
])
|
|
|
|
@api.model
|
|
def action_open_payment_onboarding_payment_acquirer(self):
|
|
""" Called by onboarding panel above the customer invoice list. """
|
|
# Fail if there are no existing accounts
|
|
self.env.company.get_chart_of_accounts_or_fail()
|
|
|
|
action = self.env['ir.actions.actions']._for_xml_id(
|
|
'payment.action_open_payment_onboarding_payment_acquirer_wizard'
|
|
)
|
|
return action
|
|
|
|
def get_account_invoice_onboarding_steps_states_names(self):
|
|
""" Override of account. """
|
|
steps = super().get_account_invoice_onboarding_steps_states_names()
|
|
return steps + ['payment_acquirer_onboarding_state']
|