[IMP] sale,sale_crm: activate the sale_tour test

This commit is contained in:
qsm-odoo
2016-08-28 22:43:39 +02:00
parent b7791e57e9
commit 0bcf978920
8 changed files with 109 additions and 28 deletions
+49 -10
View File
@@ -6,7 +6,9 @@ var tour = require('web_tour.tour');
var _t = core._t;
tour.register('sale_tour', [{
tour.register('sale_tour', {
url: "/web",
}, [tour.STEPS.MENU_MORE, {
trigger: '.o_app[data-menu-xmlid="sales_team.menu_base_partner"], .oe_menu_toggler[data-menu-xmlid="sales_team.menu_base_partner"]',
content: _t('Organize your sales activities with the <b>Sales app</b>.'),
position: 'bottom',
@@ -14,10 +16,51 @@ tour.register('sale_tour', [{
trigger: ".oe_kanban_action_button",
extra_trigger: '.o_salesteam_kanban',
content: _t("Let\'s have a look at the quotations of this sales team."),
position: "bottom"
position: "bottom",
id: "quotation_button_on_dashboard",
}, {
trigger: ".btn-primary.o_sale_confirm",
extra_trigger: '.o_sale_order',
trigger: ".o_list_button_add",
extra_trigger: ".o_sale_order",
content: _t("Let's create a new quotation.<br/><i>Note that colored buttons usually points to the next logical actions in any screen.</i>"),
position: "right",
}, {
trigger: ".o_form_required input",
extra_trigger: ".o_sale_order",
content: _t("Write the name of your customer to create one on the fly, or select an existing one."),
position: "top",
run: "text Agrolait",
}, {
trigger: ".ui-menu-item > a",
auto: true,
in_modal: false,
}, {
trigger: ".o_form_field_x2many_list_row_add > a",
extra_trigger: ".o_sale_order",
content: _t("Click here to add some lines to your quotations."),
position: "bottom",
}, {
trigger: ".modal-body .o_form_required input, .o_list_editable .o_form_required input",
extra_trigger: ".o_sale_order",
content: _t("Select a product, or create a new one on the fly. The product will define the default sale price (that you can change), taxes and description automatically."),
position: "right",
run: "text Ipad",
}, {
trigger: ".ui-menu-item > a",
auto: true,
in_modal: false,
run: function (actions) {
actions.auto();
actions.auto(".modal-footer .btn-primary");
},
id: "quotation_product_selected",
}, {
trigger: ".o_form_button_save",
extra_trigger: ".o_sale_order",
content: _t("Once your quotation is ready, you can save, print or send it by email."),
position: "right",
}, {
trigger: ".o_sale_confirm",
extra_trigger: ".o_sale_order.o_form_readonly",
content: _t("<p><b>Confirm the order</b> if the customer purchases.</p><p><i>The customer can also confirm the order directly from the email he received.</i></p>"),
position: "bottom"
}, {
@@ -30,12 +73,8 @@ tour.register('sale_tour', [{
content: _t("Use this menu to access quotations, sales orders and customers."),
edition: "enterprise",
position: "bottom"
}, {
trigger: ".o_main_navbar .o_menu_toggle",
content: _t('Click the <i>Home icon</i> to navigate across apps.'),
edition: "enterprise",
position: "bottom"
}, {
}, tour.STEPS.TOGGLE_APPSWITCHER,
tour.STEPS.MENU_MORE, {
trigger: '.o_app[data-menu-xmlid="base.menu_administration"], .oe_menu_toggler[data-menu-xmlid="base.menu_administration"]',
content: _t("Configuration options are available in the Settings app."),
position: "bottom"
+1
View File
@@ -3,3 +3,4 @@
import test_sale_to_invoice
import test_sale_order
from . import test_product_id_change
import test_sale_ui
+9
View File
@@ -0,0 +1,9 @@
import odoo.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
@odoo.tests.common.at_install(False)
@odoo.tests.common.post_install(True)
class TestUi(odoo.tests.HttpCase):
def test_01_sale_tour(self):
self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('sale_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.sale_tour.ready", login="admin")
+6 -6
View File
@@ -128,7 +128,7 @@
<field name="model">sale.order</field>
<field name="priority">4</field>
<field name="arch" type="xml">
<tree string="Quotation" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'">
<tree string="Quotation" class="o_sale_order" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'">
<field name="message_needaction" invisible="1"/>
<field name="name" string="Quotation Number"/>
<field name="date_order"/>
@@ -155,7 +155,7 @@
<button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary"/>
<button name="print_quotation" string="Print" type="object" states="draft" class="btn-primary"/>
<button name="action_confirm" states="sent" string="Confirm Sale" class="btn-primary o_sale_confirm" type="object" context="{'show_sale': True}"/>
<button name="action_confirm" states="draft" string="Confirm Sale" type="object" context="{'show_sale': True}"/>
<button name="action_confirm" states="draft" string="Confirm Sale" class="o_sale_confirm" type="object" context="{'show_sale': True}"/>
<button name="print_quotation" string="Print" type="object" states="sent,sale"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
<button name="action_cancel" states="draft,sent,sale" type="object" string="Cancel"/>
@@ -517,10 +517,10 @@
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
Note that once a Quotation becomes a Sale Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
@@ -753,10 +753,10 @@
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
Note that once a Quotation becomes a Sale Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
+2 -2
View File
@@ -83,14 +83,14 @@
<field name="invoiced" widget="progress" title="Invoicing" options="{'current_value': 'invoiced', 'max_value': 'invoiced_target', 'editable': true, 'edit_max_value': true, 'on_change': 'update_invoiced_target'}"/>
</div>
<div t-if="!record.invoiced_target.raw_value" class="col-xs-12 o_kanban_primary_bottom text-center">
<a href="#" class="sales_team_target_definition o_inline_link">Click to define a team target</a>
<a href="#" class="sales_team_target_definition o_inline_link">Click to define a team target</a>
</div>
</xpath>
<xpath expr="//div[contains(@class, 'o_kanban_manage_view')]" position="inside">
<t t-if="record.use_quotations.raw_value">
<div>
<a name="%(action_quotations_salesteams)d" type="action">Quotations</a>
<a name="%(action_quotations_salesteams)d" type="action" class="o_quotation_view_button">Quotations</a>
</div>
<div >
<a name="%(action_orders_salesteams)d" type="action">Sales Orders</a>
+10 -9
View File
@@ -1,22 +1,23 @@
odoo.define('sale_crm.tour', function(require) {
"use strict";
var core = require('web.core');
var tour = require('web_tour.tour');
var sale_tour = require('sale.tour');
require('sale.tour');
var _t = core._t;
tour.tours.sale_tour.steps.splice(1, 1,
{
trigger: ".o_kanban_manage_button_section",
var quotation_button_step_index = _.findIndex(tour.tours.sale_tour.steps, function (step) {
return (step.id === "quotation_button_on_dashboard");
});
tour.tours.sale_tour.steps.splice(quotation_button_step_index, 1, {
trigger: ".o_kanban_manage_button_section > a",
content: _t("Click here to see more options."),
position: "bottom"
}, {
trigger: '.o_kanban_manage_view div:nth(2)',
content: _t("Let\'s have a look at the quotations of this sales team."),
trigger: ".o_quotation_view_button",
content: _t("Let's have a look at the quotations of this sales team."),
position: "right"
});
});
});
+26
View File
@@ -0,0 +1,26 @@
odoo.define("sale_stock.tour", function (require) {
"use strict";
var tour = require('web_tour.tour');
require('sale.tour');
var quotation_product_selected_step_index = _.findIndex(tour.tours.sale_tour.steps, function (step) {
return (step.id === "quotation_product_selected");
});
tour.tours.sale_tour.steps[quotation_product_selected_step_index].run = function (actions) {
actions.auto();
};
tour.tours.sale_tour.steps.splice(quotation_product_selected_step_index+1, 0, {
trigger: ".o_dialog_warning + .modal-footer .btn-primary",
auto: true,
}, {
trigger: "body:not(:has(.o_dialog_warning))",
auto: true,
in_modal: false,
run: function (actions) {
actions.auto(".modal-footer .btn-primary");
},
});
});
+6 -1
View File
@@ -1,12 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/sale_stock/static/src/js/tour.js"></script>
</xpath>
</template>
<menuitem id="base.menu_aftersale" name="After-Sale"
groups="sales_team.group_sale_salesman"
parent="sales_team.menu_base_partner" sequence="5" />
<menuitem id="base.menu_invoiced" name="Invoicing" parent="base.menu_aftersale" sequence="1"/>
<record id="stock_location_route_form_view_inherit_sale_stock" model="ir.ui.view">
<field name="name">stock.location.route.form</field>
<field name="inherit_id" ref="stock.stock_location_route_form_view"/>