mirror of
https://github.com/bringout/oca-ocb-crm.git
synced 2026-04-23 20:52:02 +02:00
Initial commit: Crm packages
This commit is contained in:
commit
21a345b5b9
654 changed files with 418312 additions and 0 deletions
|
|
@ -0,0 +1,34 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import tour from 'web_tour.tour';
|
||||
|
||||
tour.register('create_crm_team_tour', {
|
||||
url: "/web",
|
||||
test: true,
|
||||
}, [
|
||||
...tour.stepUtils.goToAppSteps('crm.crm_menu_root'),
|
||||
{
|
||||
trigger: 'button[data-menu-xmlid="crm.crm_menu_config"]',
|
||||
}, {
|
||||
trigger: 'a[data-menu-xmlid="crm.crm_team_config"]',
|
||||
}, {
|
||||
trigger: 'button.o_list_button_add',
|
||||
}, {
|
||||
trigger: 'input[id="name"]',
|
||||
run: 'text My CRM Team',
|
||||
}, {
|
||||
trigger: 'button.o-kanban-button-new',
|
||||
}, {
|
||||
trigger: 'div.modal-dialog tr:contains("Test Salesman") input.form-check-input',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: 'div.modal-dialog tr:contains("Test Sales Manager") input.form-check-input',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: 'div.modal-dialog tr:contains("Test Sales Manager") input.form-check-input:checked',
|
||||
run: () => {},
|
||||
}, {
|
||||
trigger: 'button.o_select_button',
|
||||
},
|
||||
...tour.stepUtils.saveForm()
|
||||
]);
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
odoo.define('crm.crm_email_and_phone_propagation', function (require) {
|
||||
'use strict';
|
||||
|
||||
const tour = require('web_tour.tour');
|
||||
|
||||
tour.register('crm_email_and_phone_propagation_edit_save', {
|
||||
test: true,
|
||||
url: '/web',
|
||||
}, [
|
||||
tour.stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]',
|
||||
content: 'open crm app',
|
||||
}, {
|
||||
trigger: '.o_kanban_record .o_kanban_record_title span:contains(Test Lead Propagation)',
|
||||
content: 'Open the first lead',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.o_form_button_save',
|
||||
extra_trigger: '.o_form_editable .o_field_widget[name=email_from] input',
|
||||
content: 'Save the lead',
|
||||
run: 'click',
|
||||
},
|
||||
]);
|
||||
|
||||
tour.register('crm_email_and_phone_propagation_remove_email_and_phone', {
|
||||
test: true,
|
||||
url: '/web',
|
||||
}, [
|
||||
tour.stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]',
|
||||
content: 'open crm app',
|
||||
}, {
|
||||
trigger: '.o_kanban_record .o_kanban_record_title span:contains(Test Lead Propagation)',
|
||||
content: 'Open the first lead',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.o_form_editable .o_field_widget[name=email_from] input',
|
||||
extra_trigger: '.o_form_editable .o_field_widget[name=phone] input',
|
||||
content: 'Remove the email and the phone',
|
||||
run: function (action) {
|
||||
action.remove_text("", ".o_form_editable .o_field_widget[name=email_from] input");
|
||||
action.remove_text("", ".o_form_editable .o_field_widget[name=phone] input");
|
||||
},
|
||||
}, {
|
||||
trigger: '.o_back_button',
|
||||
// wait the warning message to be visible
|
||||
extra_trigger: '.o_form_sheet_bg .fa-exclamation-triangle:not(.o_invisible_modifier)',
|
||||
content: 'Save the lead and exit to kanban',
|
||||
run: 'click',
|
||||
},{
|
||||
trigger: '.o_kanban_renderer',
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
/** @odoo-module */
|
||||
import tour from 'web_tour.tour';
|
||||
const today = moment();
|
||||
|
||||
tour.register('crm_forecast', {
|
||||
test: true,
|
||||
url: "/web",
|
||||
}, [
|
||||
tour.stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
trigger: ".o_app[data-menu-xmlid='crm.crm_menu_root']",
|
||||
content: "open crm app",
|
||||
}, {
|
||||
trigger: '.dropdown-toggle[data-menu-xmlid="crm.crm_menu_report"]',
|
||||
content: 'Open Reporting menu',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.dropdown-item[data-menu-xmlid="crm.crm_menu_forecast"]',
|
||||
content: 'Open Forecast menu',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.o_column_quick_create:contains(Add next month)',
|
||||
content: 'Wait page loading'
|
||||
}, {
|
||||
trigger: ".o-kanban-button-new",
|
||||
content: "click create",
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=name] input",
|
||||
content: "complete name",
|
||||
run: "text Test Opportunity 1",
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=expected_revenue] input",
|
||||
content: "complete expected revenue",
|
||||
run: "text 999999",
|
||||
}, {
|
||||
trigger: "button.o_kanban_edit",
|
||||
content: "edit lead",
|
||||
}, {
|
||||
trigger: "div[name=date_deadline] input",
|
||||
content: "complete expected closing",
|
||||
run: `text ${today.format("MM/DD/YYYY")}`,
|
||||
}, {
|
||||
trigger: "div[name=date_deadline] input",
|
||||
content: "click to make the datepicker disappear",
|
||||
run: "click"
|
||||
}, {
|
||||
trigger: "body:not(:has(div.bootstrap-datetimepicker-widget))",
|
||||
content: "wait for date_picker to disappear",
|
||||
run: function () {},
|
||||
}, {
|
||||
trigger: '.o_back_button',
|
||||
content: 'navigate back to the kanban view',
|
||||
position: "bottom",
|
||||
run: "click"
|
||||
}, {
|
||||
trigger: ".o_kanban_record .o_kanban_record_title:contains('Test Opportunity 1')",
|
||||
content: "move to the next month",
|
||||
run: function (actions) {
|
||||
const undefined_groups = $('.o_column_title:contains("None")').length;
|
||||
actions.drag_and_drop_native(`.o_opportunity_kanban .o_kanban_group:eq(${1 + undefined_groups})`, this.$anchor);
|
||||
},
|
||||
}, {
|
||||
trigger: ".o_kanban_record .o_kanban_record_title:contains('Test Opportunity 1')",
|
||||
content: "edit lead",
|
||||
run: "click"
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=date_deadline] input",
|
||||
content: "complete expected closing",
|
||||
run: function (actions) {
|
||||
actions.text(`text ${moment(today).add(5, 'months').startOf('month').subtract(1, 'days').format("MM/DD/YYYY")}`, this.$anchor);
|
||||
this.$anchor[0].dispatchEvent(new KeyboardEvent("keydown", { bubbles: true, key: "Escape" }));
|
||||
},
|
||||
}, {
|
||||
trigger: "body:not(:has(div.bootstrap-datetimepicker-widget))",
|
||||
content: "wait for date_picker to disappear",
|
||||
run: function () {},
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=probability] input",
|
||||
content: "max out probability",
|
||||
run: "text 100"
|
||||
}, {
|
||||
trigger: '.o_back_button',
|
||||
content: 'navigate back to the kanban view',
|
||||
position: "bottom",
|
||||
run: "click"
|
||||
}, {
|
||||
trigger: '.o_kanban_add_column',
|
||||
content: "add next month",
|
||||
run: "click"
|
||||
}, {
|
||||
trigger: ".o_kanban_record:contains('Test Opportunity 1'):contains('Won')",
|
||||
content: "assert that the opportunity has the Won banner",
|
||||
run: function () {},
|
||||
}
|
||||
]);
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import tour from 'web_tour.tour';
|
||||
|
||||
tour.register('crm_rainbowman', {
|
||||
test: true,
|
||||
url: "/web",
|
||||
}, [
|
||||
tour.stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
trigger: ".o_app[data-menu-xmlid='crm.crm_menu_root']",
|
||||
content: "open crm app",
|
||||
}, {
|
||||
trigger: ".o-kanban-button-new",
|
||||
content: "click create",
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=name] input",
|
||||
content: "complete name",
|
||||
run: "text Test Lead 1",
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=expected_revenue] input",
|
||||
content: "complete expected revenue",
|
||||
run: "text 999999997",
|
||||
}, {
|
||||
trigger: "button.o_kanban_add",
|
||||
content: "create lead",
|
||||
}, {
|
||||
trigger: ".o_kanban_record .o_kanban_record_title:contains('Test Lead 1')",
|
||||
content: "move to won stage",
|
||||
run: "drag_and_drop_native .o_opportunity_kanban .o_kanban_group:has(.o_column_title:contains('Won')) "
|
||||
}, {
|
||||
trigger: ".o_reward_rainbow",
|
||||
extra_trigger: ".o_reward_rainbow",
|
||||
run: function () {} // check rainbowman is properly displayed
|
||||
}, {
|
||||
// This step and the following simulates the fact that after drag and drop,
|
||||
// from the previous steps, a click event is triggered on the window element,
|
||||
// which closes the currently shown .o_kanban_quick_create.
|
||||
trigger: ".o_kanban_renderer",
|
||||
}, {
|
||||
trigger: ".o_kanban_renderer:not(:has(.o_kanban_quick_create))",
|
||||
run() {},
|
||||
}, {
|
||||
trigger: ".o-kanban-button-new",
|
||||
content: "create second lead",
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=name] input",
|
||||
content: "complete name",
|
||||
run: "text Test Lead 2",
|
||||
}, {
|
||||
trigger: ".o_field_widget[name=expected_revenue] input",
|
||||
content: "complete expected revenue",
|
||||
run: "text 999999998",
|
||||
}, {
|
||||
trigger: "button.o_kanban_add",
|
||||
content: "create lead",
|
||||
}, {
|
||||
trigger: ".o_kanban_record .o_kanban_record_title:contains('Test Lead 2')",
|
||||
run: function () {} // wait for the record to be properly created
|
||||
}, {
|
||||
// move first test back to new stage to be able to test rainbowman a second time
|
||||
trigger: ".o_kanban_record .o_kanban_record_title:contains('Test Lead 1')",
|
||||
content: "move back to new stage",
|
||||
run: "drag_and_drop .o_opportunity_kanban .o_kanban_group:eq(0) "
|
||||
}, {
|
||||
trigger: ".o_kanban_record .o_kanban_record_title:contains('Test Lead 2')",
|
||||
content: "click on second lead",
|
||||
}, {
|
||||
trigger: ".o_statusbar_status button[data-value='4']",
|
||||
content: "move lead to won stage",
|
||||
},
|
||||
...tour.stepUtils.saveForm(),
|
||||
{
|
||||
trigger: ".o_statusbar_status button[data-value='1']",
|
||||
extra_trigger: ".o_reward_rainbow",
|
||||
content: "move lead to previous stage & rainbowman appears",
|
||||
}, {
|
||||
trigger: "button[name=action_set_won_rainbowman]",
|
||||
content: "click button mark won",
|
||||
},
|
||||
...tour.stepUtils.saveForm(),
|
||||
{
|
||||
trigger: ".o_menu_brand",
|
||||
extra_trigger: ".o_reward_rainbow",
|
||||
content: "last rainbowman appears",
|
||||
}
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue