[IMP] sale,account: Fix/improve miscellaneous points on the onboarding bars
Purpose ======= Clean some stuff on the onboarding bars: - Payment setting should be activated in sales settings if a payment acquirer is activated from the sales bar, otherwise the customer can't pay with the acquirer - No email is sent with sample documents -> sending to yourself using the chatter doesn't work... - Select "sign online" by default - Improve payment instructions - Improve the default thank you message on payment acquirer accordingly (when no bank defined) - Choose a custom payment method -> mark the step as done - Improve buttons wording: - Put a pointer cursor when hovering on done steps - Fix typo : instructions -> Instructions - Fix layout issue on tax screen
This commit is contained in:
committed by
Yannick Tivisse
parent
9030781a51
commit
f28369fd26
@@ -508,6 +508,7 @@ Best Regards,'''))
|
||||
'mark_invoice_as_sent': True,
|
||||
'custom_layout': 'mail.mail_notification_borders',
|
||||
'force_email': True,
|
||||
'mail_notify_author': True,
|
||||
}
|
||||
return action
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<t t-set="description">
|
||||
Send an invoice to test the customer portal.
|
||||
</t>
|
||||
<t t-set="btn_text">Send Sample</t>
|
||||
<t t-set="btn_text">Send sample</t>
|
||||
<t t-set="done_text">Sample invoice sent!</t>
|
||||
<t t-set="method" t-value="'action_open_account_onboarding_sample_invoice'" />
|
||||
<t t-set="model" t-value="'res.company'" />
|
||||
@@ -150,7 +150,7 @@
|
||||
<t t-call="base.onboarding_step">
|
||||
<t t-set="title">Taxes</t>
|
||||
<t t-set="description">Choose a default sales tax for your products.</t>
|
||||
<t t-set="btn_text">I'm ready</t>
|
||||
<t t-set="btn_text">Set taxes</t>
|
||||
<t t-set="done_text">Step Completed!</t>
|
||||
<t t-set="method" t-value="'action_open_account_onboarding_sale_tax'" />
|
||||
<t t-set="model" t-value="'res.company'" />
|
||||
@@ -164,8 +164,8 @@
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<div>Choose a default sales tax for your products.</div>
|
||||
<label for="account_sale_tax_id" string="Sales tax"/>
|
||||
<div class="mb16">Choose a default sales tax for your products.</div>
|
||||
<label for="account_sale_tax_id" string="Sales Tax"/>
|
||||
<field name="account_sale_tax_id" />
|
||||
<footer>
|
||||
<button string="Apply" class="btn btn-primary" type="object" name="action_save_onboarding_sale_tax" />
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<t t-call="base.onboarding_step">
|
||||
<t t-set="title">Payment Method</t>
|
||||
<t t-set="description">Configure your payment methods.</t>
|
||||
<t t-set="btn_text">Set Payments</t>
|
||||
<t t-set="btn_text">Set payments</t>
|
||||
<t t-set="done_text">Payment method set!</t>
|
||||
<t t-set="method" t-value="'action_open_payment_onboarding_payment_acquirer'" />
|
||||
<t t-set="model" t-value="'res.company'" />
|
||||
@@ -61,9 +61,9 @@
|
||||
</div>
|
||||
|
||||
<div attrs="{'invisible': [('payment_method', '!=', 'other')]}">
|
||||
<a type="action" role="button" name="payment.action_payment_acquirer">
|
||||
<button type="object" name="action_onboarding_other_payment_acquirer">
|
||||
Check here
|
||||
</a>
|
||||
</button>
|
||||
to choose another payment method.
|
||||
</div>
|
||||
<div attrs="{'invisible': [('payment_method', '!=', 'manual')]}">
|
||||
|
||||
@@ -25,11 +25,12 @@ class PaymentWizard(models.TransientModel):
|
||||
manual_name = fields.Char("Method", default=lambda self: self._get_default_payment_acquirer_onboarding_value('manual_name'))
|
||||
journal_name = fields.Char("Bank Name", default=lambda self: self._get_default_payment_acquirer_onboarding_value('journal_name'))
|
||||
acc_number = fields.Char("Account Number", default=lambda self: self._get_default_payment_acquirer_onboarding_value('acc_number'))
|
||||
manual_post_msg = fields.Html("Payment instructions")
|
||||
manual_post_msg = fields.Html("Payment Instructions")
|
||||
|
||||
@api.onchange('journal_name', 'acc_number')
|
||||
def _set_manual_post_msg_value(self):
|
||||
self.manual_post_msg = _('Please make a payment to %s %s') % (self.journal_name or _("Bank") , self.acc_number or _("Account"))
|
||||
self.manual_post_msg = _('Please make a payment to <ul><li>Bank: %s</li><li>Account Number: %s</li><li>Account Holder: %s</li></ul>') %\
|
||||
(self.journal_name or _("Bank") , self.acc_number or _("Account"), self.env.user.company_id.name)
|
||||
|
||||
_payment_acquirer_onboarding_cache = {}
|
||||
_data_fetched = False
|
||||
@@ -137,3 +138,8 @@ class PaymentWizard(models.TransientModel):
|
||||
|
||||
def _set_payment_acquirer_onboarding_step_done(self):
|
||||
self.env.user.company_id.set_onboarding_step_done('payment_acquirer_onboarding_state')
|
||||
|
||||
def action_onboarding_other_payment_acquirer(self):
|
||||
self._set_payment_acquirer_onboarding_step_done()
|
||||
action = self.env.ref('payment.action_payment_acquirer').read()[0]
|
||||
return action
|
||||
|
||||
@@ -81,6 +81,7 @@ class ResCompany(models.Model):
|
||||
'custom_layout': 'mail.mail_notification_paynow',
|
||||
'proforma': self.env.context.get('proforma', False),
|
||||
'force_email': True,
|
||||
'mail_notify_author': True,
|
||||
}
|
||||
return action
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<t t-set="description">Customize the look of your quotations.</t>
|
||||
<t t-set="done_icon" t-value="'fa-star'" />
|
||||
<t t-set="done_text">Looks great!</t>
|
||||
<t t-set="btn_text">Customize</t>
|
||||
<t t-set="method" t-value="'action_open_sale_onboarding_quotation_layout'" />
|
||||
<t t-set="model" t-value="'res.company'" />
|
||||
<t t-set="state" t-value="state.get('account_onboarding_invoice_layout_state')" />
|
||||
@@ -16,6 +17,7 @@
|
||||
<t t-call="base.onboarding_step">
|
||||
<t t-set="title">Confirmation & Payment</t>
|
||||
<t t-set="description">Choose how to confirm quotations and get paid.</t>
|
||||
<t t-set="btn_text">Set payments</t>
|
||||
<t t-set="method" t-value="'action_open_sale_onboarding_payment_acquirer'" />
|
||||
<t t-set="model" t-value="'res.company'" />
|
||||
<t t-set="state" t-value="state.get('sale_onboarding_order_confirmation_state')" />
|
||||
@@ -25,6 +27,7 @@
|
||||
<t t-call="base.onboarding_step">
|
||||
<t t-set="title">Sample Quotation</t>
|
||||
<t t-set="description">Send a quotation to test the customer portal.</t>
|
||||
<t t-set="btn_text">Send sample</t>
|
||||
<t t-set="method" t-value="'action_open_sale_onboarding_sample_quotation'" />
|
||||
<t t-set="model" t-value="'res.company'" />
|
||||
<t t-set="state" t-value="state.get('sale_onboarding_sample_quotation_state')" />
|
||||
|
||||
@@ -11,7 +11,7 @@ class PaymentWizard(models.TransientModel):
|
||||
_name = 'sale.payment.acquirer.onboarding.wizard'
|
||||
|
||||
def _get_default_payment_method(self):
|
||||
return self.env.user.company_id.sale_onboarding_payment_method
|
||||
return self.env.user.company_id.sale_onboarding_payment_method or 'digital_signature'
|
||||
|
||||
payment_method = fields.Selection([
|
||||
('digital_signature', 'Sign online'),
|
||||
@@ -26,7 +26,6 @@ class PaymentWizard(models.TransientModel):
|
||||
""" Override. """
|
||||
self.env.user.company_id.set_onboarding_step_done('sale_onboarding_order_confirmation_state')
|
||||
|
||||
|
||||
def _on_save_payment_acquirer(self, *args, **kwargs):
|
||||
""" Override """
|
||||
self._install_module('sale_payment')
|
||||
@@ -37,8 +36,7 @@ class PaymentWizard(models.TransientModel):
|
||||
self.env.user.company_id.sale_onboarding_payment_method = self.payment_method
|
||||
if self.payment_method == 'digital_signature':
|
||||
self.env.user.company_id.portal_confirmation_sign = True
|
||||
if self.payment_method in ('paypal', 'stripe'):
|
||||
if self.payment_method in ('paypal', 'stripe', 'manual'):
|
||||
self.env.user.company_id.portal_confirmation_pay = True
|
||||
|
||||
|
||||
return super(PaymentWizard, self).add_payment_methods(*args, **kwargs)
|
||||
|
||||
@@ -36,7 +36,7 @@ $o-onboarding-violet-ui-2: #FBEEC8;
|
||||
.o_onboarding_wrap {
|
||||
padding: $o-horizontal-padding*2 $o-horizontal-padding;
|
||||
}
|
||||
.o_onboarding_step_title {
|
||||
.o_onboarding_step_title, a.o_onboarding_all_done {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user