* web, website_event, website_sale, sale_quotation_builder
Instead of an ugly danger-colored badge promoting "odoo", we now use
the official odoo logo. The code is also refactored to use more
consistent and translatable sentences without duplicated code.
Note: the odoo logo is added in the repo, downloaded from our official
brand assets page (https://www.odoo.com/page/brand-assets), in its
'tiny' version. The repo already contained multiple odoo logos but they
are quite old and should be replaced in a further update. Note: the svg
version was not able to be used as it contains external margins...
Part of https://github.com/odoo/odoo/pull/34422
task-2026299
* = web, website_blog, website_crm_partner_assign, website_event,
website_event_track, website_forum, website_hr_recruitment,
website_livechat, website_partner, website_profile, website_sale,
website_sale_delivery, website_slides
The published button name is a bit ambiguous, now it will clearly state
what it does with a new title : "Go to Website". The "Published",
"Unpublished" state is shown with the globe icon changing color
(green and red) and a title on the button.
Badge and Delivery don't have a website page, the button will then be
a publish/unpublish button in the backend.
task-2002435
closesodoo/odoo#34261
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
get_installed and _lang_get_id are both ormcached and correctly check
the context
Retrieving a res.lang from a code is a frequent action that can be
achieved with _lang_get (cf previous commit).
Using _lang_get ensure the active_test in the context is correct and
is not poluted with another context propagation issue.
odoo/odoo#35490 discussion is an example of bad context propagation
closesodoo/odoo#35504
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.
Moreover, this feature was misused. It was:
- left on fields during multiple versions.
- used on reports (SQL views). This would be ok if the feature was
complete, but, as is, it was useless.
- kept unchanged after a second renaming of the field (which can happen
versions later the first rename).
- used, even when the meaning of the field changed. i.e. the field
`archived` has been renamed to the classic `active`, but the value
in the database should be switched.
* = website_forum, website_profile, website_sale,
website_sale_comparison, website_slides, website_slides_survey
Some image links were hard coded in the xml views of website, now they
are replaced with website.image_url(model, field).
Part of https://github.com/odoo/odoo/pull/34149
task-2007400
closesodoo/odoo#34149
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Commit 916968058d introduced a mechanism to check rights when writing or
creating on `website_published` field.
Problem is, `website_published` is just kind of a related to `is_published`
which really stores the value.
Thus, the checks would not work when writing/creating on `is_published`.
That would leave a loophole to bypass the expected behavior.
*website_crm_partner_assign, website_customer
Before this commit, some models would create their own `website_published`
field rather than using the `website.published.mixin` mixin which should be
used instead.
That was done to be able to override the default value of the boolean.
This commit simply adds the possibility to override the default value of the
mixin field.
Also, help and string could simply be added on xml views rather than overriding
the field.
The `website_published` field from the website's mixins is basically a readonly
from `is_published` field.
On read, this field will simply read `is_published` and check if the record's
website_id is accessible (only for the multi mixin).
On write, it will always write on `is_published`.
This commit improves a few things:
- A lot of code was writting on website_published which was just then writting
on is_published. Writting directly on is_published makes more sense.
- Some backend fields would still reference `website_published` instead of
`is_published` which would just go through the related for no reason.
Plus, using `is_published` will make the field tooltip more accurate as we
are not in a website context ('Visible on current website' to 'Is Published')
- Filter and search on tree view were still using the `website_published`
related field, which is just a readonly when we are not in a frontend
context.
- Some create and write function would have security check on
`website_published` value but that was wrong as the user could bypass that by
simply writting on `is_published`. For the write method, check `is_published`
is more accurate as it will cover both case since `website_published` will
then call the write method on `is_published`
It is now possible to specify the forum mode : Questions and Answers or
Discussions. In Q&A mode, a user can only reply once while there is no
limit in Discussions mode.
task-2008910
closesodoo/odoo#34097
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The following models are already using big images, or they might need big images
in the future:
- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank
PR: #34925
It is now possible to add very easily a font from Google Fonts under
Customize Theme > Fonts > Add Google Font.
Part of https://github.com/odoo/odoo/pull/33442
task-1974659
Co-authored-by: qsm-odoo <qsm@odoo.com>
Before this commit, if a theme had more fonts that the default number
(6), it had to override the customize dialog. Now, the number of fonts
to add in the list is found automatically.
To do so, instead of defining a <selection/> tag with 6+ <opt/> tag, we
are now able to define an unique new tag: <fontselection/> which will do
automatically the job.
Part of https://github.com/odoo/odoo/pull/33442
task-1974659
* theme_bootswatch, theme_default, website_theme_install
This commit makes use of the new 'auto' widget for font selection:
instead of enabling a template which will enable a scss file which sets
a font variable to a specific value... we directly allow to do a scss
custo which sets that value.
The code in charge of resetting font customizations on theme switching
is also moved and refactored here in website (instead of being specific
to each theme).
Part of https://github.com/odoo/odoo/pull/33442
task-1974659
Co-authored-by: qsm-odoo <qsm@odoo.com>
The theme customize dialog implements its own system of widgets. For
example: data-widget="color" and data-widget="input". Now, a new type of
widget data-widget="auto" exists. The goal is the same as the
data-widget="input" but with a predefined value that the user cannot
choose.
Also, as "data-value" was badly chosen during its implementation, it
is now renamed to "data-variable" and "data-value" is now used with the
new widget.
Example of the new widget "auto":
<opt data-widget="auto" data-variable="logo-height" data-value="3rem"
string="Logo Height"/>
-> Allows to create a button forcing the logo height to 3rem.
Part of https://github.com/odoo/odoo/pull/33442
task-1974659
The reason this widget was moved is that the next improvement
([IMP] base: Configure document layout) defines a new field (FieldColor)
which needs to call the colorpicker dialog inside of the base module.
This couldn't be done while the dialog was located in the wysiwyg assets.
Before this commit, for the following view tree:
P (active)
|
I (inactive)
|
II (active)
When calling `get_related_views()` on 'P', it would wrongly return 'II'.
It shouldn't, since its parent 'I' is inactive.
Step to reproduce:
- Go to /shop
- Enable ecommerce categories
- Enable Collapsible Cateogories
- Disable ecommerce categories
- Collapsible categories is still shown even if its parent got archived
closesodoo/odoo#35154
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this patch, if a website is deleted, its redirections will stay, affecting other websites.
Now, website-specific redirections will disappear along with their corresponding website.
closesodoo/odoo#35130
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
`_view_get_inherited_children()` `options` parameter is not more useful.
Introduced with ae8232136d and not used since edce2fd6d0.
Also, the opportunity is taken to rename `options` in `_views_get` into
`get_children. Indeed `options` does not mean much.
closesodoo/odoo#35157
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Before this commit, when a snippet was cloned, its animation was not destroyed
first. The flow was:
1. Clone the snippet (DOM) - web_editor trigger `snippet_cloned`
2. Start cloned snippet animation - website listen `snippet_cloned`
This was causing bugs, eg facebook snippet for which the animation is to create
an iframe containing the facebook widget.
When cloning this snippet, its iframe would be cloned to, then its animation
would be started, creating another iframe.
To fix such flows, the snippet cloning flow should be:
1. Strop the snippet animation
2. Clone the snippet (DOM) - web_editor trigger `snippet_cloned`
3. Start cloned snippet animation - website listen `snippet_cloned`
4. Restart the original snippet animation
task-1951466
closesodoo/odoo#35029
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* = website_sale, website_sale_wishlist
The wishlist animation was not handling the affixed navbar and always
referring to the main one.
Now the animation will target the right navbar if we scroll down.
When the navbar is duplicated, the ids of the tags were kept which is
wrong and was producing bugs such as the wishlist button not showing up
on the floating navbar on the first product added to the wishlist and
the first issue. Now the id is removed from the clone and never used
in JS code. Its only purpose is for the xpath of the wishlist button.
When a product was added to the cart from the wishlist and the affixed
navbar was displayed, the product was hidden before the animation was
completed. This changed the height of the page and the animation went to
the middle of the page instead of the button. This is now fixed too.
task-2002122
closesodoo/odoo#34358
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
No more modal because it's not visible and less handy. Use same behavior as
sales order portal.
Adapt the invoice style to properly adapt and align with the chatter block.
Part of task-37264
closesodoo/odoo#34360
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Pratima Gupta <pgu@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>