Commit Graph
4110 Commits
Author SHA1 Message Date
rde a91a3a5633 [IMP] website: warn user about key change when editing special file name
The idea is to warn user if he created a special file (website.page with
supported extension) and he wants to change the file's name, which will at the
end also change the key).
If this special file has been t-called elsewhere, they t-call wont work anymore
This is why warning user is needed.

Note that this is different than the already existing page_search_dependencies
that is just checking if the URL is present in menus, templates, blog or pages.
This is about checking if the key is present somewhere. (we assume that if the
key is present, it is surely about a t-call.

Technically, the flow is:
1. Get supported extension
2. Get key dependencies
3. Check if user modify name
4. If name changed and it is/was a supported extension (special file) and it
   has dependencies (surely t-call) then warn user these call wont work anymore

--

search_page_dependencies is also improved by returning links to be clickable
(on delete dialog eg) and splitting template/page results.

it also refactor dependencies warning that was creating HTML in javascript into
using XML template
2017-10-12 16:20:42 +02:00
rde a8fc544c5c [TYPO] website: change some texts 2017-10-12 16:20:42 +02:00
rde 53920fae31 [FIX] website: key from page's view was not unique in every cases
Before this commit, if you created a page with the same name as another one
(which is allowed) it would set the same key for that second page.
Indeed, the code was setting correctly the path uniqueness but it was then
setting the key based on the name and not on the unique url we found free.

Now, the key is correctly uniquely set and even better, it is now completely
independant from the url and has its own 'find unique' method to be sure it is
correctly working.
It was not clever to have key & url being linked.

To be more clear:
1. Create page 'aboutus'
	key  is 'website.aboutus'
	name is 'aboutus'
	url  is '/aboutus'
2. Create page 'aboutus' ->
	key  is 'website.aboutus'
	name is 'aboutus'
	url  is '/aboutus-1'
Problem: key should be unique (for t-call for specific files & website_version)
Cause: key is set based on name which is not checking for uniqueness like url.
Two possible solutions:
	1. Set key based on url (which is being checked for uniqueness)
	2. Create & Use a specific method to get unique key
Fixed with solution 2 which is more clean.

--

It also fix an invisible 'bug':
Saving a page being in menu would cause the menu's URL to get it's trailing '/'
to be removed. It was only a problem when you were getting the warning about
dependencies (the menu wouldn't be recognized as dependencies because of the
removed '/')
2017-10-12 16:20:42 +02:00
rde 7692f52ad5 [FIX] website: page url were not checked anymore for uniqueness
Before this commit, if you created 2 pages with the same name/url it could
create both the pages with the same url.

Now, like before, it is correctly adding a suffix (eg '-1') when you create a
page with an URL already taken
2017-10-12 16:20:42 +02:00
rde 553e24ccd1 [IMP] website: button to easily back to page manager from form view
Before this commit:
When you were on the page manager and you were editing a website.page's
content, it would redirect you to the website.page's ir.ui.view's form view in
the backend.
From there, you would'nt have an easy way to get back to the page manager:
your only option was to go to the website module and click on 'go to website'
and then click on menu/manage pages.
It was not convenient when you were editing multiple page quickly or just
taking a look into some pages.

Now, you have a button on the ir.ui.view's form view to get directly on the page
manager.

Note: this back button is obviously invisible for ir.ui.view not related to a
website.page
2017-10-12 16:20:42 +02:00
rde 3549078ef4 [REF] website: function inverse on computed field is_homepage
Before this commit, we were using data[] array from json call to write on
website model accordingly of is_homepage value.

Now, we use the newly created inverse function of the computed field to handle
that to make it more clear
2017-10-12 16:20:42 +02:00
qsm-odoo c1156915c1 [FIX] website: load xml dependencies of website.prompt
The deprecated-but-still-used website.prompt requires some static XML
to be loaded to work. In the case of creating a new website page, this
XML was implicitely loaded by the "Content" menu... but when the user
is on a translated page, this menu is not there. Anyway, this static
XML loading should be done by the website.prompt function itself if
necessary.
2017-10-12 13:31:36 +02:00
Odoo Translation Bot 38155cd786 [I18N] Update translation terms from Transifex 2017-10-11 17:17:17 +02:00
Jeremy Kersten 48fa000bb2 [FIX] website: don't force a maxlength for key
That seems useless and break some code like the 'website menu' feature from website_event

This fix closes odoo/odoo#20023
2017-10-11 13:37:12 +02:00
qsm-odoo b719e43b15 [FIX] website: allow starting website 'animations' on #wrapwrap
Before 11.0, website 'animations' were able to be started on any DOM
element. Since 11.0, this was reduced to any DOM element inside the
main website element (#wrapwrap). This commit allows this element
to be attached a website 'animation' too.
2017-10-10 09:57:11 +02:00
Odoo Translation Bot ded650083e [I18N] Update translation terms from Transifex 2017-10-09 10:53:17 +02:00
Jeremy Kersten 436ad6efa4 [IMP] http_routing, website: split website code into website
This reverts partially commit ab2283ef83.

This commit clean and clarify some code.
It also secure the call to specific page extension's template to avoid somehow
calling unexisting tempalte
2017-10-03 08:44:34 +02:00
qsm-odoo 14c7af50fe [FIX] website: prevent dropping snippets in <p/>
Main snippets can be dropped in `.oe_structure` elements and
`[data-oe-type=html]` elements. The second case happens when adding
a field in a page thanks to `t-field`. If used on a <p/> element,
the content cannot contain snippets (as browsers will not allow <div/>
and <section/> in a <p/>).

Note: we should not use <p/> with HTML fields at all but this might
happen with old databases... or by mistake. The problem is that the
problem is not visible during development without this fix.
2017-10-02 15:43:44 +02:00
Olivier Colson 0556b7fe31 [FIX] account, base_setup, crm, event, google_calendar, hr, hr_attendance, hr_expense, hr_payroll, hr_recruitment, l10n_be_hr_payroll_fleet, mass_mailing, mrp, project, purchase, sale, stock, website: rename the actions leading to settings to "settings", for breadcrumbs
Before that, the breadcrumb used the name of the action called to access the settings view, which sometimes did no correspond with the settings tab that was actually used.
2017-10-02 15:15:14 +02:00
Odoo Translation Bot 0333007a08 [I18N] Update translation terms from Transifex 2017-10-02 15:06:48 +02:00
Martin Trigaux 0e3455222d [I18N] Update translation source terms 2017-10-02 13:34:51 +02:00
Jeremy Kersten ab2283ef83 [IMP] http_routing, website: move website method into website
Method _guess_mimetype should be in website module.
2017-10-02 10:30:25 +02:00
rde 727d461e1d [IMP] website: create special extension page redirect backend + own template
Before this commit:
1. You could create a page with supported extension in the path (eg: myfile.js)
You would then be redirected to the webeditor (myfile.js?enable_editor..)
But in this case, it would just redirect you to a plain text page without odoo
layout because supported extension are rendered with a specific mimetype.
(is it is a .js page, it will just render the page content as a js file)
2. These kind of page would still call t-layout that you should be removed in
backend in order to make it work

Now:
1. You will be automatically redirected to the back end to edit your file
instead of landing on a text-only page.
2. Supported extension now have their own template (eg: .js file now have
<script text=..> tag added automatically in their content)
2017-09-30 16:11:48 +02:00
qsm-odoo a3f899c395 [FIX] website(_twitter): properly stop snippet animations
The `stop` method of snippet animations was renamed to `destroy` (as
animations are now extensions of standard `Widget` class).
2017-09-30 14:33:05 +02:00
rde 4bd8e3e2ed [IMP] website: Script injected in DOM: window.onerror empty params
Before this commit, error thrown by scripts injected in DOM won't return a
clean error on window.onerror.
It would open the crash_manager's show_error's dialog that wouldn't display
any informations except "Script Error." and "Traceback:".
This is because of browser's security reason: it will just give you a
'Script error.' as message and nothing else for security issue.

Now, this kind of error will show a clearer message informing that it is
probably originating from a Javascript file served from a different origin.
There is now also the possibility for developers to handle/override the
behavior when this kind of error is catch to prevent the dialog to open for
example.

Might be of use:
https://blog.sentry.io/2016/05/17/what-is-script-error.html
https://stackoverflow.com/a/7778424
https://danlimerick.wordpress.com/2014/01/18/how-to-catch-javascript-errors-with-window-onerror-even-on-chrome-and-firefox/ (Search for Script Error)
2017-09-30 12:21:27 +02:00
rde c837eaca9f [FIX] website: edit menu not showing url & mailto prefix with '/'
Before this commit:
1. you could not edit a menu URL because the input was hidden.
   This was due to radio options being switched (new page is now selected choice)
   when you create a menu.
   But when you edit, there is no choice and the input should be shown.
2. if you set a menu url to an email address, the display link would be prefixed
   by a / and so it would open mysite.com/mailto:XXX instead of just the mailto

Now:
1. Input is now hidden only when you add a new menu, not when editing a menu.
2. mailto link now works as expected: it will open your desktop mail software
2017-09-30 12:21:27 +02:00
Prakash Prajapati 0b6c9c60d4 [FIX] website: remove left & right margins around todo buttons 2017-09-30 12:21:27 +02:00
Jeremy Kersten 29dec43ce8 [IMP] website_sale: replace signup by 'Sign In' in checkout
+ add link in confirmation page to propose the signup in b2c
2017-09-30 12:21:27 +02:00
rde 4edf03b5d9 [REM] website: remove unused method get_page_key
call to this method got removed on #f015746549e1eb380bfbda8c8f47d1f1e5d0cfbc
2017-09-30 12:06:04 +02:00
Kishan Gajjar 5c6379303a [FIX] website: adding a link on a "Features"'s icon broke the layout 2017-09-30 11:17:22 +02:00
Kishan Gajjar 90dbe3c6be [FIX] website: add white background to placeholder image 2017-09-30 11:17:22 +02:00
Deep Patel 98748a93c0 [FIX] res_config: Fix several layout issues on config views
- subscription settings are broken and show up at the bottom of any setting page: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrra01leUZ1Wnczbms/view?usp=drivesdk
- don't put setting item of the app you are configuring at the top of the list: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrdXEwUmFWTTlLd1E/view?usp=drivesdk
- hide empty sections when searching not in debug mode: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrVGFOa0FKVmtNTWs/view?usp=drivesdk
- when installing Invoicing, setting item should be Invoicing and not "Accounting": https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrWGQwY1ktaXlNSUk/view?usp=drivesdk
- app labels: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrreXlNTXZnbU13aFk/view?usp=drivesdk
- coupon programs links: duplicate in sales + no link at all in website: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrraTV1YTNPdWU2VUE/view?usp=drivesdk
- delivery methods: links are duplicated in sales settings https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrczR5X1FOUllUZHM/view?usp=drivesdk
- add subtitles to all the carriers in sales settings: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrS1NXXzhwRTFQV2c/view?usp=drivesdk
- inner options should never be in bold:
	customer account: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrMnpualBta2x6dU0/view?usp=drivesdk
	phone validation: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrraHJrYngtaGJ6T2s/view?usp=drivesdk
	signature & payment: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrWTJ3dVBuTzNONlU/view?usp=drivesdk
	bill control: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrRy16UkdTWWdrdDQ/view?usp=drivesdk
- make similar settings look the same through all the apps:
	taxcloud: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrraGlVWmNXRjJ5WEk/view?usp=drivesdk
	pricelist: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrQ2pwVmtEZXM1SWM/view?usp=drivesdk
	multi-currencies: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrTFNWTTJpcS1XbnM/view?usp=drivesdk
	shipping costs: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrM2hKdk5XRy1WTjg/view?usp=drivesdk
2017-09-29 14:12:03 +02:00
kap-odoo 230e88264a [FIX] website: removed padding in todo buttons of dashboard.
closes #19733
2017-09-28 09:49:44 +02:00
Vandan Shah fed46211ed [IMP] website: change link for google analytics tracking ID
closes #19730
2017-09-28 09:46:41 +02:00
Jeremy Kersten 95634c967f [FIX] website, website_slide: fix enumerate_page
Use rec_name in domain because some model like survey.survey don't have name field.
Check that query_string is setted to avoid traceback 'lower of None'
2017-09-27 23:32:40 +02:00
Jeremy Kersten 953a693df1 [FIX] website, http_routing: fix translate on website.page
Before this commit:
website.page won't be rendered as translated items since it is not going though
 a controller (route) enabling multilang. Website.page were not considered as
 multilang items and no lang prefix were applied on link.

Now:
website.page will correcly handling translation.

In case of one route doesn't match a controller, it is now by default a route of
type multilang.

Add a new field auto_redirect_lang on website model to allow to deactive the
autoredirect of the lang optionnaly. The code will arrive after more tests.
2017-09-27 21:33:50 +02:00
rde 257595011d [FIX] website: website.redirect was never called
Before this commit, the website.redirect records would never been called since
we switched call order from redirect>page to page>redirect.
It would always render a 404 and would never check redirect records.

Now, if there is no page found, it will check for redirects and if no redirect
found it will return 404.
2017-09-27 21:33:50 +02:00
rde fa23bb8586 [FIX] website: unpublished page present in menu throws an error if public user
Before this commit, an unpublished page present in menu would throw an error for
public user (group_portal & group_public) because of the security record rule
set on website.page model not allowing read access to unpublished pages:

<field name="domain_force">[('website_published', '=', True)]</field>

In this particular case, we try to retrieve the menu URL, but since the URL is
retrieved through its (m2o) website.page, it would cause an error.

Now, it the menu has a website.page unpublished, we will correctly retrieve its
URL (sudo) and it won't crash.
2017-09-27 21:33:49 +02:00
Jeremy Kersten 1b52b00d2a [IMP] website*: clean sitemap + add method to declare sitemap function.
Don't add useless routes or route that will return 404.
Improve generate function from ModelConverter to have a better management of
query_string.

Now we have an helper sitemap_qs2dom that will analyse the current route and
check if query string is plausible and if yes, generate a domain, when the
query_string don't seems to match the route, we return a Falsy domain.

Before this commit, if qs was /product/ipad, enumerate_page check for each
modelconverter of the route a name ilike '/product/ipad'.

Now we check all routes that contains product and one converter that match ipad
or routes that contains ipad and one converter that match product.

This commit a new way to declare the sitemap for a route.
    def sitemap_xx(env, rule, query_string):
        yield {'loc': '/my_url'}
    @http.route(..., sitemap=sitemap_xx)

    In this case, only the loc returned by this function will be in the sitemap
    for all rules.

    You can pass sitempa=False, if you don't want that route are into the sitemap
2017-09-27 21:33:49 +02:00
rde 741e003b94 [REF] website: rename ir_ui_view_id by view_id to fit odoo coding style 2017-09-26 16:10:39 +02:00
Kishan Gajjar f435f72a27 [IMP] website: Limit size of favicon
Before this commit, if you uploaded a big image, it would break the settings
screen.

Now, the image will have its displayed size limited to 90px
2017-09-26 16:10:38 +02:00
rde 976dc2bea0 [IMP] website: website manager - change tooltip & label to be more clear
+ website.page should not have the option 'edit in backend' in the navbar like
blog post, product, jobs..
2017-09-26 16:10:38 +02:00
rde 8baabfb6be [FIX] website_*: convert old ir.ui.view page=True into website.page in 1 record
Before this commit, website.page xml record were created in 2 steps:
	1. Create an ir.ui.view record with <template> tag
	2. Create a website.page record with <record model="website.page">
But this is useless since website.page inheritS ir.ui.view, you can create both
records just in one <record> tag.

Note: This is NOT TRUE in every case:
Odoo's ORM will suffix external_id of inherited records (in this case the
ir.ui.view created through the website.page record) with its model's name.
This can be a problem in some case (this is an example):
	website_crm_template.xml create an ir.ui.view inheriting the
	ir.ui.view 'website.contactus'.
	But if we didn't keep website.page & ir.ui.view records split for that
	specific case, the ir.ui.view would inherit a website.page record
	causing an error. (website.contactus would be the id of the page record
	while the ir.ui.view's id would be website.contactus_ir_ui_view)

In short: when migrating an ir.ui.view (<record> xml) to a website.page:
	* If there is record inheriting the ir.ui.view ID, then split
	  website.page & ir.ui.view
	* if not, you can create the website.page and its ir.ui.view both in one
	  record (<record model="website.page").

This commit also removed remaining page="True" from xml template since we
removed the 'page' attribute from ir.ui.view model overrided in website module.
2017-09-26 16:08:14 +02:00
rde 0426849de1 [IMP] website, website_crm, website_hr_recruitment: remove useless name field from website.page
Before this commit, website.page had a 'name' field which was useless because
website.page inheritS from ir.ui.view which has its own 'name field.
At the end, we were duplicating/synchronizing 'name' field between
website.page and its ir.ui.view for no reason because we were always using the
one from ir.ui.view.

Now, getting website.page's name will always retrieve the one from its
ir.ui.view and there is no redundant information.
2017-09-26 16:07:16 +02:00
rde a40236d38a [FIX] website: SEO keywords
Seen behavior: SEO keywords not saving

Expecte behavior: SEO should save

Reason: destroy event method from dialog.js is now hidding modal
programmatically. Which at the end call twice the keywords save
method.
The second time there were no keywords passed to that function
which is causing that behavior (saving empty array).
2017-09-25 10:53:28 +02:00
rde acd0b6da14 [IMP] website: pageManagement - improvements according to first feedbacks
- labelling and screen redesign (update labels, hide labels, hide fields, ...)
 - make UI more mobile friendly (icon biggest, color using less variables,...)
 - Page & Redirection menu are for visible only in debug mode
 - Add meta noindex for website.page not shown in sitemap
 - Add mechanism to be able to edit in backend a broken view
	(Needed for - Internal Error 500, css, js file, ...)
 - website pagemanager dedicated to website_publisher only
2017-09-25 10:53:28 +02:00
Mehul Patel ca01a458ec [FIX] website: Update default language when removing current default
Purpose
=======

Steps to reproduce:

Remove current default language of your website, it doesn't change the default language which makes the website crashing on edition.
2017-09-22 13:34:43 +02:00
Kirti Choudhary d797628779 [IMP] website_sale:set background-repeat property of image to no-repeat so it will not repeat. 2017-09-22 11:41:08 +02:00
Olivier Dony 2257583bb5 [ADD] ir.attachment: add token field for external access
Introduce a new attachment field (access_token) to allow external
unauthenticated access. This will be an opaque unique number
(typically a UUID) that should be provided via an appropriate
controller, for unauthenticated display.

The field is intended to be NULL unless unauthenticated access has been
allowed, in which case a value will be set for the access_token.

This could be used e.g. for allowing access to images within mailings,
even when the recipient is not logged in (which is sometimes entirely
impossible, when email providers use restricted proxy servers to
load images)

Note 1: this is still a work-in-progress, but serves to freeze the API.
The implementation of the access check and provisioning of the new
field will be added later.

Note 2: namimg collisions with the file download token prevent the use
of a shorter 'token' parameter for download routes.

Apologies for the late (and incomplete) addition in saas-18 :-/
2017-09-21 23:48:36 +02:00
Lucas Perais (lpe) 3505ca73d2 [FIX] website: change link url google analytics doc 2017-09-21 10:16:09 +02:00
Martin Trigaux 9d2e825340 [I18N] export saas-18 source terms
saas-18 will be the future version 11
2017-09-20 16:14:08 +02:00
Xavier Morel f1a85ba70a [FIX] *: fix a bunch of incorrectly documented docstring
Fix a bunch of ill-documented/incomplete/incorrect method docs
Without this, the automatic doc generation does not work.
2017-09-18 11:54:39 +02:00
Christophe Monniez bfa85c84a6 [IMP] website_sale: manage abandoned cart
Purpose: Add button to see the number of
abandoned carts and the ability to send
a recovery email to those customers.

On the abandoned carts menu, you can see
the SO from the website where no reminder
email has been sent.
By selecting them, you can send an email
to the customer to tell him there is still
a cart waiting.
Clicking on the link, he can reuse his old
cart or merge it with his current one.

An abandoned cart is a SO from a website
sales team, and created after a treshold
parametered by a 'delay' settings (number
of hours to be considered as abandoned).
2017-09-15 16:55:17 +02:00
rde 4ecbacaf59 [ADD] website: add new page management
website.page = old ir.ui.view with page=True
website.redirect is a new mechanism to replace in the futur the ir.attachment
mechanism of redirect.

From now, we don't have a specific /page controller to serve 'page'.

We use a new model website.page which is rendered if none route matches the url
 and that the field 'url' on website.page matches the request.httprequest.path.

The order to serve a path is:
    - Routes defines in controllers (/shop, /blog, ...)
    - ir.attachment with name matching the path
    - website.page with url matching the path
    - website.redirect with url_from matching the path
    - 404

To improve:
    - allow regexp in website.redirect model
    - allow to edit the view_arch from the page.management via redirect backend
      (needed when traceback in the page, or when modifying a js/css/less/...)
2017-09-15 15:29:37 +02:00
Christophe Simonis c5f680200c [MERGE] forward port branch saas-17 up to d08b4407be 2017-09-12 12:09:11 +02:00