summaryrefslogtreecommitdiff
path: root/addons/website/tests/__init__.py
AgeCommit message (Collapse)Author
2021-02-11[FIX] website: add tests for #64446Romain Derie
As `standalone` tests were introduced in 14.0 (see 0453566a76d), this commit adds tests to ensure the `inherit_id` of COW views are correctly updated on module updates. This test could not be rewritten in a regular test and merged in 12.0 as module operation in tests try to be avoided (see 5e7e7b00b7d). See #64446 for more information about the original fix. closes odoo/odoo#65841 Signed-off-by: Christophe Simonis <chs@odoo.com> Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-02-04[FIX] website, web_editor: fix empty parallax snippet not being removedSamuel Degueldre
Previously, when removing all the content of a snippet, that snippet would get automatically deleted. This was not the case for parallax snippets because we previously intended the user to drop the parallax snippet, empty it, and drop other content inside of it. Recently, we added the parallax option on all snippets, rendering the previous workflow obsolete. There is now no longer any reason to keep empty parallax snippets. This commit fixes that. task-2446008 closes odoo/odoo#64907 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-05-01[IMP] website: simplify website menuDramixDw
Some apps, once installed, automatically create a menuitem in website. What complexify the UI and create useless menu withtout plusvalue. It is not because you install livechat to make support online, that you want a link in your menu to show stats e.g. Now we remove the default menu created, and help user to find it when he create a link. The autocomplete suggest most of the main App's controllers task-2189613 closes odoo/odoo#49081 Related: odoo/enterprise#9733 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-19[FIX] website: add SQL performance test for page loadingRomain Derie
This will ensure the performances stay correct for a blank page (no layout), a standard page and a homepage (which has its own controller). Related to #47257 task-2211013 X-original-commit: 08e01b5fc4a71b8f7639a953137fbb546ddf3b3e
2019-11-25[FIX] ir_http: support redirect pitcure for themeJeremy Kersten
Missing / wrong indented code during rewrite of binary controller: https://github.com/odoo/odoo/commit/7d85ab1#diff-1407a8ce197a04eefaefa26c127a4418L343-L348 In case you have: <record id="s_cover_default_image" model="theme.ir.attachment"> <field name="key">website.s_cover_default_image</field> <field name="url">/web/image/theme_treehouse.bg_img_15</field> </record> theme_treehouse.bg_img_15 will be not found in /web addons. So we need a 301 redirect too. opw-live How to reproduce: odoo.com/trial > Website > Install theme Clean Drop first snippet > background is 404 closes odoo/odoo#40605 X-original-commit: b8ce93e4eb397e1b7a0e1d408d61d2f283223fb9 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-12[REF] website, *: merge website_theme_install into websiteqsm-odoo
* theme_bootswatch, theme_default, website_theme_install
2019-10-14[FIX] website: Display duplicate login error messageLucas Lefèvre
When you try to create two users with the same login, the shown error message is the Postgresql integrity error instead of a nice (translated) validation error. This happens since bf88f3e which changed the way error messages are translated. The reason is the manually created unique index `res_users_login_key_unique_website_index`. The error handling and translation mechanisms don't know it exists. The index was created for performance reasons in commit b5a12b4 where the original python constraint was replaced with this custom SQL index. In this commit, the python constraint is re-introduced to remove the index hack, but the implementation now uses a single SQL query, which should be quite fast. closes odoo/odoo#38737 X-original-commit: 817a811ec98b0c313b12e6464b5e98ca432cb3fc Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-08-26[IMP] http_routing, website: allow to customize the lang in URLRomain Derie
With this commit it is now possible to change the lang displayed in the URL. Eg, you could use `/fr` instead of `/fr_BE`, or even a fancier `/french`. Task-32838 Courtesy of pla@odoo.com closes odoo/odoo#35135 Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-08-19[IMP] website : add website visitors activity trackingDavid Beguin
This commit adds the website_visitor model that will be used to track website visitor activity (page viewed, number of visits and more general info about the visitor (country, lang, etc..) This model will, in later commit, be used to send chat requests and push notification from the operators (or backend users) directly to the visitor. - A website_visitor is created once the visitor is requesting a website.page that is tracked. - A website_visitor is considered as connected if his last tracked website_page request is within the last 5 minutes. - The number of visits for a website_visitor is incremented if his last tracked website_page request was at least 8 hours ago. - A website_visitor is only handled by the system. Users cannot create, edit or delete a website_visitor. - A unique website_visitor is created per website. That means that the same real person can triggers multiple visitor creation if visits multiple websites. This is because, for livechat purpose on later commit, for example, the chat request can be created on the correct livecaht channel (linked to the correct website) - The visitor is recognized via his cookie (visitor_id). So if the visitor flush his cookies, a new visitor will be created the next time he will request a tracked website_page. - Link user's res.partner to website.visitor. If a website_visitor log in (a visitor that has visitor_id in his cookie), the website_visitor is linked to the res.partner. The website visitor name is than adapted to match the name of the first res.partner linked to the visitor. A visitor can have multiple partners as the same session can be used by multiple person (one PC for a team for example). To keep a detailed history of the visitor page views, we add a website.visitor.page model that makes the link between visitor and website.page but that keeps the visit date. So that we can see if a visitor went mulitple times on the same page and when. It's usefull to see his last page views. Task ID : 2028059 PR #34624
2019-06-13[IMP] base, model, website[*]: add get_base_url helperJeremy Kersten
Before this commit, when we want to make an external url, we need to know if the record is related to a specific website or not, and choose base_url or website domain. Now each model have a fonction get_base_url (public to be callable from email template, ...) and website override this function to add the website domain if the record is website specific. closes odoo/odoo#34089 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-29[IMP] tools,website: correctly handle favicon and .ico filesSébastien Theys
Previously the image that we uploaded as a favicon of the website was not resized, so it could be extremely excessive in size and resolution, and it also was not guaranteed to be a square. Now we always resize it appropriately and save it as an ICO file. The default favicon is now applied to all websites instead of only the first. task-1958000 PR: #31811
2019-02-06[FIX] website: allow scheme and port on domain (multi-website)Sébastien Theys
Before this commit, the website selection was not working when a scheme or port was encoded in the domain field. This was not obvious or natural for the user, because the easiest way to fill it was to copy/paste the URL from the browser. Now it works when scheme or port are encoded, it is even strongly recommended to actually encode them if they don't take a default value because they will be used when creating full URL to the website (typically when sending emails to clients where a link back is necessary). PR: #30000
2019-02-06[FIX] *: share URL on the correct website if possibleSébastien Theys
* = base, auth_signup, mail, portal, sale, website, website_sale Before this commit, sending an object by email would always link to web.base.url even if the object was created from a specific website. Now if the object has a website, we use the URL of that website if it is set. The fallback will always be on the web.base.url. opw-1921030 PR: #30000
2018-08-13[IMP] website,*: support multiple websitesJoren Van Onder
This implements support to administer multiple websites. Although the core functionality already existed, managing multiple websites was fairly technical. In the interest of database updates and migration this attempts to keep duplicated data to a minimum. To do this the usual generic records are rendered unless some website-specific record exists that replaces it. Copy-on-write (COW) is used to create these website-specific records. Through this mechanism creating a website-specific record is delayed until necessary. A COW mechanism has been implemented on 4 models: ir.ui.view, website.page, website.menu and ir.attachment. These COW mechanisms are activated when editing data through the website (aka frontend). These frontend edits (e.g. with web_editor) will be website-specific, possibly creating a website-specific record when necessary. When editing data in the backend nothing special will happen, even when editing a generic record. Note that because of this mechanism also facilitates the ability to create new, uncustomized websites because the generic data is kept. Support is provided for a website to have any theme. Themes are fairly complex to handle. Standalone themes can depend on other standalone themes (e.g. theme_beauty depends on theme_loftspace) and themes usually modify some data of the themes they depend on. Because a theme can be installed on multiple websites, using website_id m2o fields does not work well. It would require duplicate data, making updates and migration harder. Because of this, data for themes (ir.ui.view and ir.attachment specifically) have a theme_id m2o. website has a theme_ids m2m that identifies all theme modules currently installed on it. Through these fields we figure out what to render. A theme is only fully uninstalled when it's no longer active on any website. The advantage of this approach is that upgrading or migrating theme data is no different from the single-website case. The website.published.mixin class was modified to handle multiple websites. A wizard was added in the backend to easily manage this for multiple website. Although not used anywhere in this commit, a 'website_id' variable has been added in the evaluation context of ir.rule. It allows to easily make any model multi-website aware, all that's needed is a custom website_id m2o field on a model and a custom record rule.
2018-06-15[FIX] qweb: use cdn for asset filesChristophe Matthieu
Refactoring of qweb to call _post_processing_att for each nodes. This change remove the crappy ovewrite in website module. The website overwrite only the _post_processing_att to add the cdn parameters. The static node (without t- attributes) can stay static (remove overwrite of _is_static_node), the cdn is applied at the compile time for this nodes instead of at the running time like the dynamic node.
2017-04-28[FIX] Various P3-related import changesxmo-odoo
* LDAP import: python-ldap is not python3-compatible, pyldap is Warning: only supported from debian Stretch (current testing)? https://packages.debian.org/search?searchon=names&keywords=pyldap * implicitly relative imports * imports of moved or removed stdlib modules issue #8530
2016-08-04[REF] website_*: remove `render` method on websiteJérome Maes
Since saas-3, website controllers use `request.website.render` to render the template of a web page. This was kept for retro compatibility. It's time to stop using deprecated stuff. Same for `_render` method on website. 'json' route don't use `request.render` since `JsonRequest` has no `render` method.
2014-06-29[IMP] test impprove HTTPCase openerAntony Lesuisse
Simplify website crawler using the generic HTTPCase opener
2014-02-17[FIX] re-enable crawler testsXavier Morel
Move URLCase back out of the test module, otherwise loadTestFromModule attempts to load it in the usual manner (~URLCase('runTest')). Which does not work at all, because that's not what URLCase is for. URLCase extends TestCase to benefit from the TestCase.run infrastructure (running tests, filling result object, etc...) bzr revid: xmo@openerp.com-20140217151535-alq7pq6qapski73x
2014-02-17[FIX] website testsAntony Lesuisse
bzr revid: al@openerp.com-20140217001148-2ub37hxyz8tbxrwe
2014-02-09[FIX] disable http test before conversionAntony Lesuisse
bzr revid: al@openerp.com-20140209141950-o9sf0jual07y315f
2013-12-18[IMP] Basic support for ui testsddm
bzr revid: ddm@openerp.com-20131218145628-9oqxlwy4g05n4jwa
2013-11-05[ADD] CMS crawling case, with a bunch of hardcoded values to fixXavier Morel
bzr revid: xmo@openerp.com-20131105145047-4ccrchj79lohry5q
2013-09-30[IMP] move conversion out of view.saveXavier Morel
Also, html.fromstring does weird stuff when encoding is not specified, force to utf-8 just in case. bzr revid: xmo@openerp.com-20130930145358-qh7xdicgg21prsk4
2013-09-10[ADD] move view.save tests from serverXavier Morel
bzr revid: xmo@openerp.com-20130910133055-75q72gd75sty317m