Purpose
=======
Add a unicity constraint (on the url, UTM campaign, medium and source).
As we must care about null values, we can not implement it in SQL
(possible in pure SQL, but we will need to create an index on the
columns, which is not possible in Odoo if we want to customize the
error message).
Clean the code, before the "search or create" behavior was implemented
in the create, causing strange behavior (creating a link tracker with
the same values as an existing one didn't raise an error, but open
the form view of the existing link tracker).
Task-2090344
closesodoo/odoo#48845
Related: odoo/enterprise#9608
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes the step trigger:
'#o_website_links_link_tracker_form
#generated_tracked_link:contains("/r/")' that was taking too long
because of a call to _get_title_from_url happening during the creation
of a 'link.tracker'.
Before this commit the automated tests of website_links did trigger an
http request on the 'contactus' page which sometimes took too long to
respond and reached the test failure timeout.
After this commit the information obtained from this request is
hard-coded to avoid the unpredictable timing of the test.
This commit is a manual port of #62479.
task-2397724
closesodoo/odoo#62582
X-original-commit: db3296c034fe4c82d19580418fd5cdecdf578395
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, the syntax to start a tour was extremely verbose.
With this new method, it is possible to start a tour by just giving the
essential parameter: the tour name.
The full set of features from browser_js are kept by using **kwargs.
closesodoo/odoo#32316
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is following c78da8a80 that fixed website_links module.
We had to merge it with a skipped test as there was an error only appearing
with Docker (on runbot or on local with Docker).
This commit fix that test error and some other remaining bugs not found during
the first fix:
1. Fix the test error by adding a step to show recently used links. Indeed the
bug was that newest links would return inconsistent order as both 2 links
created during the steps have the same creation date.
On runbot it would click on the wrong link, the one which has 0 clicks.
Then JS would crash (see error bellow).
2. `websiteLinksCharts` JS animation class would execute all the `start`
method code even if there was no `_totalClicks`. JS would then crash as
`beginDate` would not be set correctly. Before the refactoring all that code
would be skipped as surrounded by an if/else condition.
3. BS3 to BS4 broke the nav-tabs layout to switch between 'Newest, Most Clicked
and Recently Used. `mt16` needed to be removed.
Closes#31829
Commit 6d67ce5b7c refactored the JS from multiple website modules including
`website_links`.
A few error needed to be fixed:
- recent links would not appear anymore
- graphs would not be displayed anymore
- graph resize on tab change would not be fired
This commit fixes it and also add some tests to be sure this module is now
strongly tested.
Note: tests are skipped for now as there is a race condition happening only
with docker and this fix is getting urgent for Odoo.com
closesodoo/odoo#31507
Signed-off-by: Romain Derie (rde) <rde@odoo.com>