[IMP] onboarding, *: customize step image
* = account, sale This commit allows users to modify the panel image for the onboarding steps. This is especially necessary for additional onboardings that can be/could have been created, or if the appointment onboarding was modified, as it was chosen to not overly complicate the upgrade and simply not modify these records. We also customize the placeholder icon to be one of these icons instead of the default "camera" image. Finally, a few icons are renamed to be more generally usable. closes odoo/odoo#121349 Related: odoo/enterprise#41031 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@@ -21,7 +21,7 @@
|
||||
<t t-set="description">
|
||||
Create your first invoice.
|
||||
</t>
|
||||
<t t-set="image" t-value="'/base/static/img/onboarding_order-confirmation.png'"/>
|
||||
<t t-set="image" t-value="'/base/static/img/onboarding_default.png'"/>
|
||||
<t t-set="alt" t-value="'Onboarding Create Invoice'"/>
|
||||
<t t-set="btn_text">Create</t>
|
||||
<t t-set="done_text">First invoice sent!</t>
|
||||
|
||||
@@ -23,8 +23,10 @@ class OnboardingStep(models.Model):
|
||||
done_text = fields.Char(
|
||||
'Text to show when step is completed', default=_('Step Completed! - Click to review'), translate=True)
|
||||
step_image = fields.Binary("Step Image")
|
||||
step_image_filename = fields.Char("Step Image Filename")
|
||||
step_image_alt = fields.Char(
|
||||
'Alt Text for the Step Image', translate=True, help='Show when impossible to load the image')
|
||||
'Alt Text for the Step Image', default='Onboarding Step Image', translate=True,
|
||||
help='Show when impossible to load the image')
|
||||
panel_step_open_action_name = fields.Char(
|
||||
string='Opening action', required=True,
|
||||
help='Name of the onboarding step model action to execute when opening the step, '
|
||||
@@ -73,6 +75,12 @@ class OnboardingStep(models.Model):
|
||||
return "NOT_FOUND"
|
||||
return "JUST_DONE" if step.action_set_just_done() else "WAS_DONE"
|
||||
|
||||
@api.model
|
||||
def _get_placeholder_filename(self, field):
|
||||
if field == "step_image":
|
||||
return 'base/static/img/onboarding_default.png'
|
||||
return super()._get_placeholder_filename(field)
|
||||
|
||||
def _create_progress_steps(self):
|
||||
onboarding_progress_records = self.env['onboarding.progress'].search([
|
||||
('onboarding_id', 'in', self.onboarding_id.ids),
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
<field name="button_text"/>
|
||||
<field name="done_text"/>
|
||||
<field name="done_icon"/>
|
||||
<field name="step_image_filename" invisible="1"/>
|
||||
<field name="step_image" filename="step_image_filename"/>
|
||||
<field name="step_image_alt"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<t t-call="base.onboarding_step">
|
||||
<t t-set="title">Order Confirmation</t>
|
||||
<t t-set="description">Choose between electronic signatures or online payments.</t>
|
||||
<t t-set="image" t-value="'/base/static/img/onboarding_order-confirmation.png'"/>
|
||||
<t t-set="image" t-value="'/base/static/img/onboarding_default.png'"/>
|
||||
<t t-set="alt" t-value="'Onboarding Quotation Layout'"/>
|
||||
<t t-set="btn_text">Set payments</t>
|
||||
<t t-set="method" t-value="'action_open_sale_onboarding_payment_provider'" />
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |