[FIX] sale: Apply several fix on sales tour
1. Lead to loose the tour: Remove the step of the tour that asks to set an address (the address is auto-completed at free trial based on domain name). 2. Bug: At step 3, it redirects to the invoice settings to select a localization, when you click on "install more packages", you are sent back to the sales app. --> this bug is related to res_config_settings.js from base addon. I tried to fix this bug by adding a data-attribute "discard" in the res_config_settings_views and checking this additional condition in the js. 3. Bug: Tour blocks at last step "send by email" on quotation. After clicking on "sent" on the pop-up, there should be rainbow effect to mark the end of the tour. 4. Bug: Sale order line: fix the blue color on Invoiced Quantity only, instead of the full line 5. Put the "sample product" in active= false (it's necessary for the sample invoice but should not be visible to the user, they should create their own) 6. Merge the 2 dates fields related to expected delivery on sale.order --> since other modules extends this module, I made the field expected_date invisible and put the same value in both fields. This value is the max of the order_lines.expected_date closes odoo/odoo#59261 Taskid: 2277314 X-original-commit: 0f81816d4ddb0febd28f6c6bb5dd50ae570333e1 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
committed by
Yannick Tivisse
parent
d1c918175b
commit
7b368e7215
@@ -39,7 +39,7 @@
|
||||
<field name="chart_template_id" widget="selection"/>
|
||||
</div>
|
||||
<div class="mt8">
|
||||
<button name="%(account.open_account_charts_modules)d" icon="fa-arrow-right" type="action" string="Install More Packages" class="btn-link"/>
|
||||
<button name="%(account.open_account_charts_modules)d" icon="fa-arrow-right" type="action" string="Install More Packages" discard="0" class="btn-link"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
import base64
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
from odoo.modules.module import get_module_resource
|
||||
from odoo.modules.module import get_resource_path
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
@@ -52,9 +54,13 @@ class ResCompany(models.Model):
|
||||
# take any existing product or create one
|
||||
product = self.env['product.product'].search([], limit=1)
|
||||
if len(product) == 0:
|
||||
default_image_path = get_module_resource('product', 'static/img', 'product_product_13-image.png')
|
||||
product = self.env['product.product'].create({
|
||||
'name': _('Sample Product')
|
||||
'name': _('Sample Product'),
|
||||
'active': False,
|
||||
'image_1920': base64.b64encode(open(default_image_path, 'rb').read())
|
||||
})
|
||||
product.product_tmpl_id.write({'active': False})
|
||||
self.env['sale.order.line'].create({
|
||||
'name': _('Sample Order Line'),
|
||||
'product_id': product.id,
|
||||
|
||||
@@ -309,6 +309,10 @@ class SaleOrder(models.Model):
|
||||
else:
|
||||
order.expected_date = False
|
||||
|
||||
@api.onchange('expected_date')
|
||||
def _onchange_commitment_date(self):
|
||||
self.commitment_date = self.expected_date
|
||||
|
||||
@api.depends('transaction_ids')
|
||||
def _compute_authorized_transaction_ids(self):
|
||||
for trans in self:
|
||||
|
||||
@@ -24,11 +24,6 @@ tour.register("sale_tour", {
|
||||
extra_trigger: ".o_sale_order",
|
||||
content: _t("Start by checking your company's data."),
|
||||
position: "bottom",
|
||||
}, {
|
||||
trigger: ".modal-content input.o_field_widget[name='street'], .modal-content input.o_field_widget[name='street_name']",
|
||||
content: _t("Let's enter the address."),
|
||||
position: "right",
|
||||
run: "text Rainbow street"
|
||||
}, {
|
||||
trigger: ".modal-content button[name='action_save_onboarding_company_step']",
|
||||
content: _t("Looks good. Let's continue."),
|
||||
@@ -117,7 +112,7 @@ tour.register("sale_quote_tour", {
|
||||
},
|
||||
...tour.stepUtils.statusbarButtonsSteps("Send by Email", _t("<b>Send the quote</b> to yourself and check what the customer will receive."), ".o_statusbar_buttons button[name='action_quotation_send']"),
|
||||
{
|
||||
trigger: ".modal-content input[name='email']",
|
||||
trigger: ".modal-content div[name='partner_ids']",
|
||||
content: _t("Write <b>your own email address</b> here in order to test the flow."),
|
||||
run: "text agrolait@example.com"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user