Commit Graph
257 Commits
Author SHA1 Message Date
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Denis Ledoux 1480f2fad5 [FIX] *: session.modified has been renamed is_dirty
Since odoo/odoo@04e972660b
The session `modified` flag has been renamed `is_dirty`.

However, it has not been renamed correctly in these
three different places.

The goal to set `modified` at this three places
is to force the session to be saved,
for instance because a mutable (a list or a dict)
contained in the session was modified,
but not the dict of the session itself,
therefore `modified` is not flagged automatically.

As the flag `modified` has not been renamed to `is_dirty`,
a key/value `modified: True` was actually assigned to the
session dict, and saved in file. The behavior
to save the session in these three places was kept,
as one key/value of the session has been changed,
but by the way to assign a new value in the session file,
which is not ideal.

It's better to assign the correct flag to avoid
setting a new key/value in the session for no reason.

closes odoo/odoo#118719

X-original-commit: b6f4a27f2d95d5bc5510f4da50132ab66d8c86aa
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-04-17 11:47:15 +02:00
Guillaume (gdi) a48346d30a [FIX] website_blog: fix the blogs search
Before this commit, following these steps:
- Go to /blog
- Enable the customize option 'Top banner - Name / Latest Post'
- Disable the customize option 'Full-Width Cover'
- Search for the word 'helicopter' in the blog post search bar

Two problems are then visible:
1) The top banner is always visible with a blog post that does not match
the search. This top banner should not be visible (like for tag and date
searches).
2) There is an alert message 'No results for "helicopter".' while the
blog post 'Maui helicopter tours' matches the search.

This commit corrects both errors.

task-3058239

X-original-commit: c28cf4b44c4fd9a1800d5fb1ad6e8c734feb9057
Part-of: odoo/odoo#114253
2023-03-03 15:56:48 +01:00
Romain Derie e7b0ee3012 [FIX] website_blog: prevent params to be lost when only one blog
With DB having only one blog (most common case, but we are used to test
it with demo data where we have two), the query params are lost when
accessing the blog controller without passing a blog.

Eg, `/blog?search=hubble` will redirect to `/blog/travel-1`

This is because the business code is doing an early redirect if we
access the `/blog` URL without a blog post passed to it to redirect to
that blog post URL directly (since there is only one), but that redirect
is not passing the query parameters.

The main impacted params are `state`, `order` and `search` but it's the
same for all others.

Step to reproduce (in later version):
- Be sure to only have one blog
- Drag & drop the search snippet in the homepage or anywhere
- Make it search on blog only (through the snippet option)

Type anything, it will not work and won't do the search. It will just
redirect to the blog page.

closes odoo/odoo#114107

X-original-commit: 41c27fd4912fb9f50ce5f31fff7c17c77b8530f7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-02 16:01:17 +01:00
Guillaume (gdi) 292102bac1 [FIX] website_blog: fix the date filter on the blog posts
Since [this commit], following these steps:
- Go to /blog
- Activate the sidebar option
- Select a date filter on the sidebar

=> An error occurs.
The bug comes from the fact that since [this commit], some arguments
were passed twice to a function which causes a python error. The fix is
just to not pass the same argument several times.

[this commit]: https://github.com/odoo/odoo/commit/f2e20e5377a6604084aaf509f57614d7fbf263e5

Related to opw-2882492

closes odoo/odoo#104639

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-07 13:49:58 +01:00
Guillaume (gdi) 6782ec3f95 [FIX] website_blog: display all the blog posts when filtered
Before this commit, following these steps:
- Go to /blog
- Activate the option Customize > Top banner - Name / Latest Post
- Disable the option Customize > Full Width Cover
- Click on the "guides" tag of the "Buying A Telescope" blog

No blog is displayed. This was because the top banner post is not shown
when the posts are filtered. Basically, once filtered, a blog post was
always missing.

Related to opw-2882492

X-original-commit: ee2f778abb8b7a6e221e05361bc7b964593d1123
Part-of: odoo/odoo#104639
2022-11-07 13:49:58 +01:00
qsm-odoo c771aa406c [FIX] website, website_blog: fix wrong href on the top banner of /blog
Before this commit, following these steps:
- Go to /blog
- Activate the option Customize > Top banner - Name / Latest Post
- Disable the option Customize > Full Width Cover

The URL to which we are redirected when we click on the category of the
post presented at the top of the page leads to an error. In order to fix
the wrong url we had to patch QueryURL so that the url prefix is added
only if the url does not already start with the prefix.

opw-2882492

X-original-commit: https://github.com/odoo/odoo/commit/2b326de107b9b7a2013ee9ff174d81b645d6a623
Part-of: odoo/odoo#104639
2022-11-07 13:49:58 +01:00
Benoit Socias f2e20e5377 [REF] website, *: make search options inheritable
*: website_blog, website_event, website_forum, website_slides

With [1] it has been made easier for partners to extend search options.

This task introduces similar inheritable functions for blog posts,
events, forum posts, slides, pages and hybrid results.

[1]: https://github.com/odoo/odoo/commit/d29f2f3ac5f8c3e8109287e0933609bdbe0cadb1

task-2897924

closes odoo/odoo#97908

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-28 18:50:49 +02:00
Arthur Detroux (ard) 08c2251070 [FIX] website_blog: properly render the sidebar
Commit [1] introduced t-cache for values inside blogs. It also broke the
sidebar template by removing the call to nav_list.

This commit adapts the call to be lazy and follow the cache principles.

[1]: https://github.com/odoo/odoo/commit/b0a2a41d78292cb8b9e53788d40c6dc5915a466d

Fixes #103199, fixes #103888

task-3001319

X-original-commit: ae76b89fbbf947a79bdcdbcc200f65b2ddb457b0
Part-of: odoo/odoo#104180
2022-10-26 17:07:22 +02:00
Guillaume (gdi)andqsm-odoo c2f394253e [IMP] website, *: improve the "edit in backend" button
*: base, mrp_account, product, mail, website_blog, website_event,
   website_forum

This commit improves the button that allows to go to the backend view of
an object when you are on its corresponding page on the website. The
button is more visible and the user can see which object he is going to
edit. Note that this commit also:

- Changes the access key to translate a website page to ALT + T.

- Adds a new access key to edit an object in backend with ALT + E.

- Removes the possibility to duplicate a blog post (but this feature
will be reintroduced later for all models, generically) **.

**: Note that the duplication of blog posts actually had a mistake:

The controller to create a new blog post has been added with [1] where
it has been decided to not be a follower of the blog posts at their
creation. A new controller has been added by [2] to be able to duplicate
a blog post, to be consistent with [1], here also the user does not
become a follower of the new blog post (the copy). So far, so good.
Finally, [3] has changed the blog post creation controller so that the
user who creates the blog post is a follower of the new blog post.
Unfortunately the same change was not made for the duplicate controller,
which is a mistake. There is no reason to be a follower of the newly
created blog posts when you go through the add blog post controller but
not when you go through the duplication controller. The behaviors should
be consistent and there is no reason for there to be a difference.

[1]: https://github.com/odoo/odoo/commit/4c3b516a7b988d758a67ff19242e8ed0837d756c
[2]: https://github.com/odoo/odoo/commit/fe40538aff2b65f7719840c8e2d6e51e858f560f
[3]: https://github.com/odoo/odoo/commit/4bf9dc4078a5ca413539a6fd16400fd5aad46907

task-2889929

closes odoo/odoo#97353

Related: odoo/enterprise#30075
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-09-04 18:29:37 +02:00
Florian Charlier db7c9ba7c5 [IMP] tools, website_{*}: increment multiple fields at once
* = blog, forum, slides

For performance reasons, allow to increment multiple fields of the same record
within the same query.

With python tests.

Task-2663320
Part of odoo/odoo#79615
2022-08-25 14:24:53 +02:00
Jeremy Kersten f230de431c [FIX] website_blog: see blog post even if tag doesn't exist anymore
If you delete a tag, but still have some link to this one, you arrive on
a 404 /blog/tag/.
We decide to redirect to the blog post without tag instead.
What is probably the expected behaviour for most customers.

closes odoo/odoo#98087

X-original-commit: 041ad20824e57b0850d7c74ca2ddbeab7f38990b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-08-12 23:37:51 +02:00
Younn Olivier b85c2a4cb1 [IMP] website, *: redirect to the client action when needed
*: website_blog, website_hr_recruitment, website_sale, website_slides

This commit changes the redirections from the controllers, that were
always redirecting to the frontend before.

Now, we want to open the website in its backend client action most of
the time (for example, when clicking on the "go to website" buttons on
the form views).

For that, a new get_client_action_url is introduced on the website
model.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier f260e3c144 [IMP] website, *: add edit in backend systray dropdown
*: website_blog, website_customer, website_event_exhibitor,
   website_event_track, website_hr_recruitment, website_sale,
   website_slides

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Gorash b0a2a41d78 [IMP] all/website: using lazy values and t-cache in templates
Using lazy values allows you to not do query when the content is not
displayed or if it is already cached. Adding `t-cache` only reduces
render time, but combining it with lazy values saves browses, computes
and query.
Thus for the `/shop` page the page is displayed in 60ms (before: 250ms).

Part-of: odoo/odoo#88276
2022-06-03 16:40:40 +02:00
Yolann Sabaux 0b78709d3a [FIX] website_blog: search query not consistent
steps to reproduce:
- install blog
- create more than 12 articles with at least on word  (the one we will search for)
- Go to the "blog" menu of the website
- Go in the search field
- Search for the word in the created articles
-> Odoo removes the search criteria on the blog (Website) + number of results is inconsistent

OPW-2720355

closes odoo/odoo#83031

X-original-commit: bc2ed4a5f0997929930e3f279e5e1347818f8880
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-19 12:23:07 +00:00
Benoit Socias 7559626c54 [IMP] website, *: make a generic search bar snippet available
(*: website_blog, website_event, website_forum, website_sale,
website_slides)

Before this commit the search bar was specific to products.

After this commit a generic search bar is available as a general feature
of website which can be configured to inspect specific models.
The snippet is used to replace the old search bar in blog, courses,
event, forum, page and shop.
The search results of these pages and the autocomplete of the search bar
run through the same search mechanism.
A new hybrid results page has also been created as a target of a search
on "Everything".

In each involved module, `website._search_get_details()` is implemented
to return search metadata for every model related to the `search_type`
parameter.
Search metadata for a single model is returned by `_search_get_detail()`
on that specific model.

The autocomplete runs through the additional
`website._search_render_results()` pre-rendering step that prepares the
data to fit in the autocomplete template.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Jeremy Kersten 478068c829 [IMP] *: always use Odoo Response
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.

We removed redirect_with_hash that was only for retro compatibility

local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.

Default code for redirect is 303 now instead of 302.

Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.

All werkeug.utils.redirect has been replaced by request.redirect.

Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.

Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.

Migrate your code:

http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect

Courtesy of odony for help and review ;)

closes odoo/odoo#72599

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-08 07:00:06 +00:00
Touati Djamel (otd) eb179429b6 [FIX] website_blog: Prevent tags loading if no blogs
Steps to reproduce the bug:
- Go to website app > configuration
- Set the visibility of all the blog to Website A (So that it's not visible on Website B)
- Go to the Blog menu of Website B
- A traceback is triggered

Problem:
The `all_tags` function calls an SQL query to get the tags related to the website blog
with a where condition based on the blog_id. But since there is no blog linked to the site.
The request fails and an error is raised.

Solution:
Do not load the tags, if there is no blog for the website.

Opw-2545315

closes odoo/odoo#72636

X-original-commit: 4d8fc86e4e6beb2171e3bebbabd532086d884d59
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-23 13:23:32 +00:00
Benoit Socias e306ec7ca3 [IMP] website_blog: remove the old latest blog posts snippet
Before this commit the old latest blog posts snippet was still
available.

After this commit the old latest blog posts snippet has been removed.

task-2477207
https://github.com/odoo/odoo/pull/67334
See https://github.com/odoo/upgrade/pull/2262
2021-03-29 14:27:58 +00:00
Goffin Simon fa0b098900 [FIX] website_blog: Traceback on archived blog
Steps to reproduce the bug:

- Create a blogpost in the the blog 'travel
- Archive the blog 'travel'
- Open the blogpost

Bug:

A traceback was raised

opw:2444406

closes odoo/odoo#65576

X-original-commit: 196d96ef8eaf8aa06e16c9768ed595fca1c315ff
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-04 17:51:29 +00:00
Romain Derie f2583f3de4 [IMP] website(_*): prevent wrong multi website access during dispatch
Before this commit, routes were prevented to be accessed if the route model was
not accessible from the current website, eg you couldn't access blog1 which is
set to website2 from website 1.
That would raise a 404 even from admin/editor.

This commit introduce that behavior at a lowel level in a generic way, instead
of having to write it on every route.

Note that routes without a model converter won't benefit from this.

Closes #63499

closes odoo/odoo#64313

Related: odoo/enterprise#15688
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-01-25 11:01:13 +00:00
Jeremy Kersten 6538e20bb6 [FIX] tools.sql, website_*: increment counter with skip lock
*blog, forum, slides

Based on https://github.com/odoo/odoo/pull/48552#discussion_r440061218 suggestion

Add a new method 'increment_skip_lock' in tools.sql to allow to easily
increment a specific field of 1 if the record is not locked.

The method return boolean if at least 1 record has been incremented.

closes odoo/odoo#58765

X-original-commit: d92e61e89f468c2db2fbd68b2f0d6b36c77f1065
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-29 08:48:59 +00:00
Jeremy Kersten 41bac94162 [FIX] website_[blog, forum]: fix loop in retro compatible routes
Purpose of the retro-compatibility route was to redirect the old to the new.
And not redirect to themself and create a loop

closes odoo/odoo#58672

X-original-commit: b5e1bafeb42e94b587c245e9e7aa844770a129c6
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-28 12:20:39 +00:00
DramixDwandqsm-odoo ea009585e1 [IMP] website_blog, *: add a way to search blog posts
*: website

As there was no way to search a blog post, it could be hard for someone
to find a particular post if there was a lot of blog post for example.

Part of https://github.com/odoo/odoo/pull/52759
task-2267693

Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-07-31 07:40:31 +00:00
Jeremy Kersten 9577dcbc3a [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
Retro-compatibility routes
2020-07-22 06:53:37 +00:00
Jeremy Kersten 01c17707bd [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
Url for a product become:
/shop/productname-id instead of /shop/product/productname-id

Url for a blog post become:
/blog/blogname-1/blogpost-1 instead of /blog/blogname-1/post/blogpost-1

Url for a question on forum become:
/forum/forumname-1/title-1 instead of /forum/forumname-1/question/title-1

task-2295016
2020-07-22 06:53:37 +00:00
DramixDw f0420013e0 [IMP] website: make pager post compatible
As we introduced postlinks, some routes are no longer compatible with
GET requests anymore. Some of those routes were using the pager which
only send GET request. In order to make the pager comptabile, we're
addding a way to use postlinks in the pager.

task-2250385

closes odoo/odoo#52475

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-06-05 15:47:06 +00:00
DramixDw 0f2cada323 [IMP] website_blog: use postlink for the tag cloud
Refactoring the tag cloud to make it work with post request.
Disallow multi-tag in get for bot indexation.

task-2250385
2020-05-29 15:09:42 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Jeremy KerstenandRomain Derie 27de8b1478 [FIX] website_blog: update viewed count without update the write_date
To backport in v13
+ check for optimistic lock

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie dba74ed353 [IMP] website_blog: rename key for viewed post and avoid write
Avoid extra call to session_store.save if we don't touch to the session
Use an explicit name to storage post_viewed in the session

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 6ae4d132a0 [IMP] website_blog: remove unused code
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 8e081ec61f [IMP] website_blog: avoid exists() in loop
`tags_list()` is called in loops to get nicely formatted URL in blog tag button
but doing an exists here will do everytime an SQL query regardless of the
cache.

We can safely remove the call to `exists()` as the `tag_ids` parameter is
coming from the controller `active_tag_ids` key which is already ensuring the
exists condition.

It make also the number of requests determinists for test with a random number
of tags. From between 200 ~ 300 queries (depending number of tags)-> 116

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 54048cb228 [IMP] website, website_blog: perf - cache customize show views
Most of the website rendering process depends of customize_show views which are
part of a configuration setup.
Once it has been setup, it will most likely never change afterward.

It makes sense to orm cache those infos to avoid having to query ir.ui.view
table everytime we render something.

Note that just store basic and small infos used for customize_show case.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Romain Derie b997684b06 [IMP] website, website_*: improvement of 7dd70438e1
* website_blog, website_event_track, website_forum, website_mail_channel

7dd70438e1 was introduced in stable as a fix, which obviously had some stable
policy preventing some changes.
This commit improves that commit in master.

task-2119086

closes odoo/odoo#45622

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-18 16:04:11 +00:00
Jeremy Kersten e6997dae2b [FIX] website_blog: avoid loop of redirect if no trailing / in tag
Before this commit in case you start on blog with url like /blog/blog-1/tag/2,
you should be redirected to /blog/blog-1/tag/website-2 to avoid duplicate
content.

But because the replace was done with /tag/%s/ it will be not replaced and so
you are redirected to the same url, creating a loop.

closes odoo/odoo#45927

X-original-commit: 666306326cecc6ac8587b45d2dbf24c0463b33a5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-21 12:30:15 +00:00
Jeremy Kersten 01028b1cf3 [FIX] website_blog: avoid traceback if tag has been deleted
Before this commit, if you have a link with a tag that doesn't exists anymore,
you will have a traceback because you try to access to a unexisting record.

odoo.exceptions.MissingError:
('Record does not exist or has been deleted.\n\n(Records: [3], User: 2)', None)

Now, we filter on existing tag before to access a field.

X-original-commit: 54b45e5c287138a87a0b04ce4f301ea6893b9223
2020-02-21 12:30:15 +00:00
Jeremy Kersten d020dd89b5 [FIX] website_blog: simplify call to s_latest_posts
Common part of the domain is automatically appended by controller now.

X-original-commit: 38058cc6642b36195329e03ca187bd7d4366914d
2020-02-21 12:30:14 +00:00
Toufik Ben Jaa 9fa2db1369 [FIX] website_blog: avoid crash when redirected on /blog
- When browsing the blogs, in some cases the code need
    to fix the URL to properly slugify the tags.

    When so, the code crashes since it is trying to maniapulate
    a `werkzeug.wrappers.Response` as if it was a `dict`.
    To avoid this, we directly return the `werkzeug.wrappers.Response`
    instead of trying to modify it.

closes odoo/odoo#45658

X-original-commit: d26ba7e4b71138a324bbb729f406cbad562881e7
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-02-18 16:29:50 +00:00
wan 0385745dd4 [FIX] website_blog: babel yyyy vs YYYY
In the format_date function of babel.dates, there is a difference
between `yyyy` and `YYYY`.
`YYYY` should only be used in combination with the week number.

See issue https://github.com/python-babel/babel/issues/419

closes odoo/odoo#42735

Related: odoo/enterprise#7536
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-01-06 16:23:29 +00:00
Jason Van Malder 1761a5c501 [FIX] website_blog: fix last update change on visit
Issue

    - Install Blog
    - Create a post
    - Remember the last update date
    - Visit the post
    - Check the last update date

    After visiting the post, the last update date changed.

Cause

    In the web_blog main.py controller, we increase the visit
    count with a write, so the write_date is updated.

Solution

    Keep the old write_date by forcing it.

OPW-2166289

closes odoo/odoo#42954

X-original-commit: 16843c63b97cda746972526f8933bf25b435d585
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2020-01-08 14:12:06 +00:00
Jeremy Kersten e19227d3ba [IMP] website*: clean sitemap
From now, you need to explicitely add sitemap=True if you want your controller
into the sitemap.

It's the default value, but if you forgot it, it will raise a Warning on runbot.
It will avoid wrong controller in sitemap and duplicate (empty) content.

From now, if your model contains a field website_id, the modelConverter for
sitemap will automatically add the domain:
   "[('website_id', 'in', (False, current_website_id))]"

It avoid redundant declaration and ugly url in redirect/rewrite view.

Migration: need to remove it from url_from in website.rewrite

task-2065018

closes odoo/odoo#39427

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-28 10:36:56 +00:00
qsm-odoo b2a403efc7 [FIX] website_blog: make latest posts snippet multi-website aware
The snippet was using the posts of all websites and blog post creation
was suggesting all blogs. Now:

- On blog post creation only suggest the blogs of the current website
- In latest posts option, only suggest blogs of the current website
- In any case, latest posts only displays posts of the current website

Part of https://github.com/odoo/odoo/pull/38510
Related to task-2083198

closes odoo/odoo#38794

X-original-commit: 4be97b48861a6631fe465054c62baea65bfc1524
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-10-15 12:55:04 +00:00
qsm-odoo 93834a55e6 [FIX] website_blog: use viewref when rendering latest posts template
Indeed, a theme can declare its own latest posts template so it would
crash with ref instead of viewref.

Part of https://github.com/odoo/odoo/pull/38510
Related to task-2083198

X-original-commit: 755944f6b88b069515881c9ec58e72e7a0cdd762
2019-10-15 12:55:04 +00:00
fw-bot e2d27c9e81 [FIX] website_blog: add missing website=True in feed
Before this commit, if you archive a blog, you will have a 500 instead of 404.
Serve page to show the 404 use request.website, so we need to force controller
with website=True to bind website on the request.

Probably need to check all controllers in website_* module.

opw-2066725

closes odoo/odoo#38539

X-original-commit: 74341c4fcba701fe5ce7ee742880bbf138131a0d
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-11 18:04:04 +00:00
Romain Derie 9b38bcec12 [IMP] website, website_*: improve edit in backend feature
*base, website_blog, website_event, website_forum, website_slides

With this commit:
1. It is now possible to add the 'Edit in backend' entry in the frontend navbar
   for any desired model, not only the ones which have the published mixin.
   It will simply redirect to the main_object form view.
   This commit add it to Forum and Blog.
2. When clicking on 'Edit in backend', it is now possible to land on another
   module than Website.
   That's especially useful for events and slides which are not directly
   related to the website module as they have their own module.
3. Remove the custom Edit in backend from the forum homepage (fa-cog).
   Opportunity was also taken to remove the 'edit welcome message'.
   It will now be editable through the editor (welcome message will appear in
   edit mode). Thus we got rid of the custom edit welcome message controller
   and views.

Closes #36325
2019-10-02 07:13:26 +00:00
wan 63de98b9b4 [FIX] *: remove en_US as fallback for lang code
en_US may not be activated as it is possible to create a database in
another language using the database manager.

When trying to install a chart of account, the tax return entry tried
to format a date at the installation of the module, with no lang in
the context. The fallback was made on en_US but an error is raised if
that language is not activated.

As it is a very common scenario to retrieve a language from the
context, add a generic tool method to do it.

Replace and closes odoo/odoo#37629

closes odoo/odoo#37568

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-01 10:05:17 +00:00
qsm-odoo 371daf1682 [REF] website_blog: review cover saving method
Use a simple write RPC instead of a dedicated controller route.

closes odoo/odoo#37030

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-09-17 14:58:52 +00:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00