summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreco-odoo <eco@odoo.com>2018-08-13 11:55:54 +0200
committerYannick Tivisse <yti@odoo.com>2018-08-13 17:14:05 +0200
commitf28369fd26313148d23a8b0a48d3b0e6f84656d9 (patch)
tree1d9c99581bf3590dd7e6bd87b95c8e1900b9446a
parent9030781a518e4c3bbf3b567ecc0ac95a4a98d78d (diff)
[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
-rw-r--r--addons/account/models/company.py1
-rw-r--r--addons/account/views/account_onboarding_templates.xml8
-rw-r--r--addons/payment/views/payment_acquirer_onboarding_templates.xml6
-rw-r--r--addons/payment/wizards/payment_acquirer_onboarding_wizard.py10
-rw-r--r--addons/sale/models/res_company.py1
-rw-r--r--addons/sale/views/sale_onboarding_views.xml3
-rw-r--r--addons/sale/wizard/payment_acquirer_onboarding_wizard.py6
-rw-r--r--odoo/addons/base/static/src/scss/onboarding.scss2
8 files changed, 23 insertions, 14 deletions
diff --git a/addons/account/models/company.py b/addons/account/models/company.py
index c9a898d626f..34cdf0738ec 100644
--- a/addons/account/models/company.py
+++ b/addons/account/models/company.py
@@ -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
diff --git a/addons/account/views/account_onboarding_templates.xml b/addons/account/views/account_onboarding_templates.xml
index be2613666f9..ee97c120485 100644
--- a/addons/account/views/account_onboarding_templates.xml
+++ b/addons/account/views/account_onboarding_templates.xml
@@ -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" />
diff --git a/addons/payment/views/payment_acquirer_onboarding_templates.xml b/addons/payment/views/payment_acquirer_onboarding_templates.xml
index b200dac5f27..45b67e57329 100644
--- a/addons/payment/views/payment_acquirer_onboarding_templates.xml
+++ b/addons/payment/views/payment_acquirer_onboarding_templates.xml
@@ -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')]}">
diff --git a/addons/payment/wizards/payment_acquirer_onboarding_wizard.py b/addons/payment/wizards/payment_acquirer_onboarding_wizard.py
index 80cb9e21799..e3ea6ffead7 100644
--- a/addons/payment/wizards/payment_acquirer_onboarding_wizard.py
+++ b/addons/payment/wizards/payment_acquirer_onboarding_wizard.py
@@ -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
diff --git a/addons/sale/models/res_company.py b/addons/sale/models/res_company.py
index f8979ef849d..77264e51557 100644
--- a/addons/sale/models/res_company.py
+++ b/addons/sale/models/res_company.py
@@ -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
diff --git a/addons/sale/views/sale_onboarding_views.xml b/addons/sale/views/sale_onboarding_views.xml
index c429991d7f2..8e6e9adcbd8 100644
--- a/addons/sale/views/sale_onboarding_views.xml
+++ b/addons/sale/views/sale_onboarding_views.xml
@@ -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 &amp; 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')" />
diff --git a/addons/sale/wizard/payment_acquirer_onboarding_wizard.py b/addons/sale/wizard/payment_acquirer_onboarding_wizard.py
index dba92f9d8ee..2b7212437db 100644
--- a/addons/sale/wizard/payment_acquirer_onboarding_wizard.py
+++ b/addons/sale/wizard/payment_acquirer_onboarding_wizard.py
@@ -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)
diff --git a/odoo/addons/base/static/src/scss/onboarding.scss b/odoo/addons/base/static/src/scss/onboarding.scss
index 283d3dc3f6b..cf1c886090e 100644
--- a/odoo/addons/base/static/src/scss/onboarding.scss
+++ b/odoo/addons/base/static/src/scss/onboarding.scss
@@ -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;
}