Commit Graph
170533 Commits
Author SHA1 Message Date
Jeremy Kersten 2af6f0989c [FIX] l10n_in_sale: conditionnal hsn visibility
Don't show HSN value for sale.order not linked to this localization.

Before this commit, if you have multi company with multi localization,
you see this field whatever the current localization.
It uses the same condition than other report: purchase/invoice/...

closes odoo/odoo#160833

X-original-commit: e2a684018d7f92994aa5d30ded8f64703254f0fb
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-04-08 11:13:51 +00:00
lase@odoo.com 1160d80da4 [FIX] website_sale: hide unpublished product to portal subcontractor
Steps to reproduce:

- Activate Subcontracting in the settings.
- Create a storable product
- Create a BOM of type "subcontracting" where the subcontractor is a
  Portal user (e.g. Joel Willis) for that product.
- Log out and connect as your portal user.
- Go to the website shop and search your product.

Expected behavior:

The portal user should only be able to see the published products.

Current behavior:

The portal user sees unpublished products for which he is subcontractor.

Cause of the issue:

The commit 99b56ec has introduced a subcontracting portal. In order for
portal users to be able to interact with product templates, the
following rule was added to the "base.group_portal":
https://github.com/odoo/odoo/blame/f0a0d596ab716c96de38a5c0f837da2924338d7b/addons/mrp_subcontracting/security/mrp_subcontracting_security.xml#L120-L131
When you go to the website shop, the records displayed in the shop will
be computed here:
https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/addons/website_sale/controllers/main.py#L348
https://github.com/odoo/odoo/blob/f0a0d596ab716c96de38a5c0f837da2924338d7b/addons/website/models/mixins.py#L353-L357
However, during this call, the "ir.rule" added for portal users will be
added to the SQL query here:
https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/odoo/models.py#L4682
As such, products (enven if unpublished) for which the portal user is a
subcontractor will be fetched and displayed in the shop.

Fix:

Since the "ir.rule" can not be changed only for flows involving the
`website_sale` application, we propose to make a change similar to
commit b1f6171 whose purpose is to hide unpublished products for non
internal users:
https://github.com/odoo/odoo/blob/1c321cd1fe0aabd9cd92c13cd1eae604e5817ae0/addons/website_sale/models/product_template.py#L105-L108

opw-3768845

closes odoo/odoo#160703

X-original-commit: d57db5b6a7ca4579145723139223cab3d8a7dd24
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-04-08 11:13:49 +00:00
Florent de Labarre 7cb9e96f86 [FIX] stock: in multi company env the product type can be changed.
Without sudo, an user in a company can change the type even if somes not done stock.move.line exists.

closes odoo/odoo#160856

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-04-08 09:27:29 +00:00
Julien Castiaux 851133ff06 [FIX] core: NotFound error without warning
The conditionnal `isinstance(exc, NotFound)` is shadowed by the
conditionnal `isinstance(exc, HTTPException)` two lines above. Nobody
ever complained that the warning for NotFound error was gone. Since
werkzeug 1.0.0, the status code in the response log is colored, 404 is
colored yellow which should catch the eye. The explicit warning line
isn't really necessary.

closes odoo/odoo#159895

X-original-commit: 851b91f19b87446662421cb8d801a9472725bc72
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-04-08 09:27:27 +00:00
ruja-odoo 439ad27b9f [FIX] web_editor: unable to add space in link label
Before this commit:

The cursor kept on flickering when attempting to enter a space at the end
of label text field of a link resulting in not being able to add space at all.

After this commit:

Now, it's possible to add  spaces at the end of a link label.

task-3820250

closes odoo/odoo#160780

X-original-commit: 1af59ba5054dae5272506aead8b2c8dd0e5616fb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2024-04-08 07:35:59 +00:00
Pierre-Yves Dufays 1c81de987a [FIX] website_slides, website_event{_exhibitor,_meet}: fix "Go to website"
How to reproduce:
- Install website_slides with demo data
- Log in from localhost
- Log in from dev.localhost
- Switch to localhost
- (The system property web.base.url is http://dev.localhost:8069 but we are
on localhost)
- Go to a course in the back end and click on “Go to website” button

You are redirected to the frontend website home page instead of the course
home page.

This fix solves the problem.

Afer correcting this error for the courses (slide.channel), we have found the
same problem for:
- event.sponsor
- event.meeting.room
- slide.slide
So we apply the same correction for them.

Technical note: the button "Go to website" uses the open_website_url method of
WebsitePublishedMultiMixin that relies on website_url. That method expects a
relative URL in the computed field website_url and not an absolute one
(actually, the method already handle adding the website domain, so it expect
the relative part). The problem is that the compute method for the field
website_url of channel compute an absolute URL. The consequence is that the
user is redirected to the home page instead of the course page (by
WebsitePreview, see get path method). In stable, we cannot change easily
website_url to make it relative as it is used in other of places (ex.: if we
make it relative the share link in the sidebar on the frontend is relative
which is not correct and in mail template, the URL might not be correct as the
mail system append the default domain for relative URLs). So instead, we
override open_website_url to use a relative URL when the website is not
defined. If the website is defined on the course, we call the super
implementation because a domain change might be required. Note that by doing
that, we duplicate the code of _compute_website_url in open_website_url but
making the URL relative instead of absolute. So we should clean that in master.

Task-3635856

closes odoo/odoo#160763

X-original-commit: 1f798428fc0f403755512a45f67b5f70aae0c808
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Pierre-Yves Dufays (pydu) <pydu@odoo.com>
2024-04-08 07:35:58 +00:00
Damien Bouvy ed60ac7cea [FIX] website_sale: wrap shop card's bottom content
In mobile, having a somewhat 'large price' (like a few thousands
currency units) can cause the bottom of the card to overflow (esp.
if buttons like 'add to card' or 'add to wishlist' are present).

This commit modifies the card template so that content is normally
spaced and can wrap to a new line if need be.

opw-3706637

closes odoo/odoo#160628

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2024-04-08 07:35:57 +00:00
mathysPaul d9b6faea4d [FIX] payment_stripe: Correct Afterpay shipping info
Resolves an issue with Afterpay via Stripe not receiving correct
shipping address details, causing transaction failures. Now,
ensures shipping address from the order or invoice is accurately
sent to Stripe if we have it.

opw-3419984

closes odoo/odoo#160300

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-04-08 07:35:54 +00:00
Samuel Degueldre e9a8baf95e [REF] web: simplify confusing curried functions in pyjs
Previously, methods on python objects such as sets and strings were
implemented as functions returning a function returning the result.
While curried functions can be a great tool, they're also confusing at
first glance and in this particular case they can be easily replaced by
a simple function and the usage of Function.prototype.bind to bind it to
the correct argument. We also add a simple whitelist for pyjs functions
as a sanity check as it makes no sense to call JS functions from python
code.

With this change, we can also treat functions and methods from any
object more uniformly instead of having many return points that are
treated like special cases.

task-3762958

Part-of: odoo/odoo#139451

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-02-28 10:08:38 +00:00
Chrysanthe (chgo) a1b8cfec43 [FIX] web, website_sale: add missing `.float-start class
Commit[1] aimed to fix a layout issue inside the eCommerce categories
form view on mobile devices.

Prior to Commit[1], a `.float-start` class was applied to the content
of thesheet, moving it "out of the flow", resulting in a wrong sized
form_sheet.

To fix the issue, we removed the `.float-start` class, but doing such
a change introduced a risk for users's customizations.

======
After
======

To prevent this issue, we reintroduce the initial lines, and will provide
a fix in another PR.

Commit[1]: 9837396
Related to task-3847917

closes odoo/odoo#160858

X-original-commit: 0914a0bd179a6b644e51de25bfad0555ea0f40ca
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Chrysanthe Gomrée (chgo) <chgo@odoo.com>
2024-04-07 19:17:14 +00:00
Xavier-Do e73094c19a [FIX] base: adapt patch.dict for noble
closes odoo/odoo#160842

Related: odoo/enterprise#60219
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2024-04-07 10:03:48 +00:00
Xavier-Do 52a2675ae8 [FIX] web: more robust test_image filename
The main purpose of this test is to ensure that line return are removed,
but all other special character are kept once the file is saved.

Unfortunately, werkzeug versions have different strategies on how to
quote the filename, removing less special character in latest versions
like after https://github.com/pallets/werkzeug/commit/babfc93b3834bcbb22163442a9af70141bcc5a81

This also changes after the changes that removed werkzeug urls methods
replacing them by urllib, making the behaviour different again.

This commit makes the test more robust by checking that the filename
correspond to the expeted one once unquoted, not comparing the quoted
versions.

Part-of: odoo/odoo#160842
2024-04-07 10:03:48 +00:00
Xavier-Do e531d8ed18 [IMP] support deprecated timezone resolution
In ubuntu noble, some timezone where removed leading to errors when
trying to assign/access them.

This was partially fixed in the code by removing all references to old
timezones but one issue remains: if a database contains timezones that
are not defined in the os, the resolution will fail and break at runtime

This patches proposes to alter timezone to fallback on the new canonical
timezone if the timezone was removed.

This list was generated by checking all symlink in /usr/share/zoneinfo
in ubuntu 22.04 that disapeared in ubuntu 24.04

This solutions will work when moving a database from one server to
another, even without migration.

The all_timezone is not modified on purpose to avoid breaking existing
logic. This list may be used to define if a timezone is known by
postgress, define selection fiels, .... we don"t want to increase the
list in those case.

Some other logic using all_timezone may need to be updated but This
will be done in master.

Part-of: odoo/odoo#160842
2024-04-07 10:03:48 +00:00
Xavier-Do e9b62b47dc [FIX] *: adapt tz for Ubuntu Noble
Some of the non canononical timezones are not present in Ubuntu Noble,
it would be a better practice to only use canonical timezones in data
and tests.

Note that this is not a real fix for all cases since the database that
ran on Ubuntu Jammy and are moved to an ubuntu Noble server will have
the issue with timezones already in database.

One of the possible fix would be to manage that during upgrades, but
this isn't a verry flexible solution since upgrade are meant to manage
chyange of version, not change of server. If an old 17.0 versions needs
to be moved to a Noble server, this won't work.

Another solution would be to install package like tzdata-legacy that may
keep the old timezones but it is not the only think since TAI-10 are
also in this package. This solution is not ideal because non canonical
timezone will still be shown in the dropdown. We would need to filter
them.

A last solution would be to add the support for those old timezones by
monkeypatching the lib. This way, only new timezones would be shown but
non canonical one won't crash when used. This is not ideal either
because we may need to keep this for a while. But in combination with
the upgrade solution, it may work proprely.

Part-of: odoo/odoo#160842
2024-04-07 10:03:48 +00:00
Xavier-Do 0dc85a2200 [FIX] tools: vendor werkzeug.urls
In latest versions of werkzeug, the `werkzeug.urls` module has been
reduced to remove feature present in urllib.parse. This commit vendored
the old version to avoid breaking compatibility with older versions of
odoo on ubuntu Noble, without adapting the whole codebase. This
should/may be removed in stable by adaptaing eveything to urlib.

This version of the lib was minimalized to avoid redondunce with feature
still present in werkzeug.urls. Some unused features in odoo are still
vendored for ease but are not exposed on the werkzeug.urls for now.

Part-of: odoo/odoo#160842
2024-04-07 10:03:48 +00:00
Xavier-Do 8daf517639 [FIX] adapt for pypdf 2.0.0-2.11.0
Part-of: odoo/odoo#160842
2024-04-07 10:03:48 +00:00
Xavier-DoandXavier Morel 2d13fa900b [FIX] tools: xpath tail for lxml 5.1.0
see https://github.com/lxml/lxml/commit/cc5ddbb1576d2844262a9d520867608aec956de9

Part-of: odoo/odoo#160842
Co-authored-by: Xavier Morel (xmo) <xmo@odoo.com>
2024-04-07 10:03:48 +00:00
Pierre Masereel 81e4f9affb [FIX] odoo,base: new Python 3.11 opcodes
When python expression is evaluated in odoo form an action or qweb, we
are checking the opcodes generated by the evaluation of this code. We do
such a verification, because the code from actions and templates can be
written by someone having not access to the server and we don't want to
let them perform actions out of the scope of their database.

In python 3.11, some opcodes from previous versions of Python have been
renamed, grouped or sepcified. There are also new ones that have been
introduce.

In this PR, we are whitelisting the new ones that are needed by odoo to
properly work in this version of Python.

Part-of: odoo/odoo#160842
2024-04-07 10:03:48 +00:00
Odoo Translation Bot a19537ea69 [I18N] Update translation terms from Transifex 2024-04-07 00:08:33 +02:00
Julien Carion (juca) 4548eed71d [FIX] web, partner_autocomplete: onChange interference with selection
This commit fixes an issue regarding unwanted interaction between the
regular autocomplete option click selection and the onChange handler
from the input field hook used in the PartnerAutoCompleteCharField
component. This became an issue starting from https://github.com/odoo/odoo/pull/154203
because of the disappearance of the t-on-mousedown.prevent handler
placed on the autocomplete options list which would prevent the onChange
event from being triggered when clicking on an option. The issue would
be that the onChange handler from the input field hook would take
precedence over the option click handler of the autocomplete which would
most of the time be ignored afterwards. The solution found for This
problem is to prevent the immediate propagation of the change event
in the autocomplete handler when an option has been clicked on so that
it will never be propagated to the input field hook handler in this case.

Steps to reproduce:
- Go to contacts and open a company contact
- Type in the name field a few characters (at least 3)
- Click on any autocomplete option

Most of the time, the option will not be applied and the name won't change

closes odoo/odoo#160561

X-original-commit: aa1e5eabb67800fbf4155c9cae12b90d97bb75db
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
2024-04-06 09:09:12 +00:00
Julien Carion (juca) 7211ba49de [FIX] web: autocomplete should always close on click away
this commit fixes an issue introduced by https://github.com/odoo/odoo/pull/154203
which could keep the autocomplete options list opened even after a click
away when the user would "drag and drop" an option out of the list instead
of simply clicking on it. This is caused by the fact that the onInputBlur
code is directly terminated in this case (because of ignoreBlur) while
it is the only way for the autocomplete list to be closed in this case.
The solution is therefore to add an external listener on pointer down
which will always close the autocomplete list when clicking away from it.

Steps to reproduce:
- go to any autocomplete (crm salesperson for example)
- click on the input
- drag and drop a result outside of the list
- try to close the autocomplete list by clicking away

Before the fix, the autocomplete list would only close by scrolling
or clicking on the input once again.

X-original-commit: 57801ab7292e3d369615740a5f67aac9a4b9a521
Part-of: odoo/odoo#160561
2024-04-06 09:09:12 +00:00
Nicolas Viseur (vin) 829058b5a0 [FIX] l10n_id_efaktur: used partner.
At the moment, the partner being used to get the information
for the efaktur module is the partner set on the invoice.

This is wrong, since if the partner set on the invoice is a
child record of a company partner you cannot set most of these
fields.

To fix this issue, we will update in order to fetch the efaktur
related fields from the commercial partner instead. (vat, along
with all efaktur specific information used in the process)

closes odoo/odoo#160267

X-original-commit: 108a87407b7c46cc1682d93524398a968b025441
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-04-06 07:27:58 +00:00
Mohammed Basioni 2876b8300d [FIX] hr_expense: convert inline templates with text to regular templates.
Strings within inline templates are not translatable, so we convert
these templates into standard templates so that they can be.

Task-3761551

closes odoo/odoo#160768

X-original-commit: 29497433bb7e19fd58287ba2af28fac4890b0b76
Related: odoo/enterprise#60185
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Mohammed Basioni (basm) <basm@odoo.com>
2024-04-05 20:07:48 +00:00
Antoine Dupuis (andu) 23064451d1 [FIX] web: Fix download.js handling of large content.
When handling a non-200 reponse with a large payload (>65536 bytes),
download.js fails to decode the payload properly on WebKit.

This is because the content is parsed using WebKit's
`DOMParser.parseFromString`, which creates several Text nodes if the
text would exceed 65536 bytes. Then, only the textContent of the second
Text node is passed to `JSON.parse()`, which fails because it is not
valid JSON.

See https://stackoverflow.com/questions/67738121/in-what-cases-do-browsers-create-multiple-adjacent-text-nodes/67774415#67774415
and https://github.com/WebKit/WebKit/blob/68ae0fde5f959e056fbd6700f1ca7fa652cd1ffa/Source/WebCore/html/parser/HTMLConstructionSite.cpp#L584-L592

closes odoo/odoo#160753

Taskid: 3790302
X-original-commit: a68348fd2b5141a410608016469ffabadc08d68d
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2024-04-05 20:07:47 +00:00
qsm-odoo 1688a19266 [FIX] website: prevent website duplicate from form view
At the moment, duplicating a website is not possible in the sense of
duplicating content, pages, etc. It is still available as an action from
the form view, and it could make sense to start up a new website with a
few common values (social media? etc?)... but many of website fields are
technical fields that should not be copied and many are dubious to copy
and not even visible in the form view. Really, duplicating a website at
the moment is misleading. This commit disables the possibility from the
form view.

In the future, we want to focus on the ability to export / import a full
website, but that's not for now.

opw-3782830

closes odoo/odoo#160587

X-original-commit: 43971a22c56b197306060ac3be7903d36d2c4be9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-04-05 18:41:45 +00:00
Sarah Bellefroid 5ec7779cb0 [FIX] point_of_sale: revert to allow order partial refund
This reverts commit https://github.com/odoo/odoo/commit/ae7d18dd5f2a712348fc0911777b164c7a273c0a to allow partial refunding of pos order as the total_amount is not correct anymore.

opw-3827876

closes odoo/odoo#160741

Signed-off-by: Sarah Bellefroid (sbel) <sbel@odoo.com>
2024-04-05 17:21:43 +00:00
Lucas Lefèvre (lul) f5d6a8c4f8 [FIX] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/33f09d7c4 [REL] 17.0.17
https://github.com/odoo/o-spreadsheet/commit/1767b3728 [FIX] chart: preserve label order when aggregate
https://github.com/odoo/o-spreadsheet/commit/6c96ded0b [PERF] helpers: faster default cell height Task: 3845472
https://github.com/odoo/o-spreadsheet/commit/b48eb1cf7 [IMP] package: update owl to version 2.2.10
https://github.com/odoo/o-spreadsheet/commit/c2f6da219 [FIX] *: Compute max/min on huge arrays Task: 3802691
https://github.com/odoo/o-spreadsheet/commit/06db89656 [FIX] Charts: format of negative values
https://github.com/odoo/o-spreadsheet/commit/c2eed35cb [FIX] EditionPlugin: data validation duplicate values
https://github.com/odoo/o-spreadsheet/commit/ed7d3fa63 [FIX] BottomBarSheet: Rename a sheet with style content on Firefox Task: 3754944
https://github.com/odoo/o-spreadsheet/commit/33ed353a9 [FIX] bottom_bar: disable sheet drag & drop in readonly Task: 3820888
https://github.com/odoo/o-spreadsheet/commit/261616dfa [FIX] menu: non-aligned menu items Task: 3814222

closes odoo/odoo#160740

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2024-04-05 15:52:06 +00:00
Jeremy Kersten 36a5a419bc [FIX] website: continue cleaning crawler
Related to previous commit: a9a9d2f12740b02c025f992d62c0d4f5feeaab1d
From initial PR: 158843

Improve Regexp to match double slugs /blog/blog-1/post-2 or /blog/1/2
Ignore param order: `?a=<param>&b=<param>` == `?b=<param>&a=<param>`
Remove trailing / from base url when querystring is present
Ignore '/en' url instead of '/en_US' since the default url_code has been
updated meanwhile (269aa59411).

Add a new test to check that urls are cleaned as expected

Remove crawl as admin, since the demo user already have all groups and
so we will check the same urls. The overlap is important for a really
low value.

X-original-commit: f17b210c6ad2364aebc6199153523ea5b767f67f

+ remove support of # part in clean url, not handled server side
+ support path in querystring (forum_origin)

closes odoo/odoo#160409

X-original-commit: 818e7af5650fae464090e7249f776193dc2b3814
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-04-05 15:52:04 +00:00
mano-odoo 2cbd223880 [FIX] web: clipped dropdown on firefox in list views
On firefox and safari applying a position-sticky on an element inside
an other element with an overflow is causing a rendering issue (see
issue [1]).

This was occuring with the dropdown `.o_optional_columns_dropdown`
making it unusable as soon as the `overflow-x` triggered the horizontal
scroll in the table.

This commit works around this bug by moving the dropdown's menu out of
the actual table and attachs it to the ListRender's root element.

As this issue is specific to the Optional Fields dropdown, we
implemented it only in the ListRender (and not for all Dropdowns). Also
the issue is not present anymore in master since the Dropdown
refactoring (see PR [2]).

Note: a unique class identifying the ListRenderer has been introduced to
handle multiple List Views rendered at the same time (in the same view,
in modal...) as the the `t-portal` requires a global selector and
doesn't allow to use relative one (i.e. searching only the parents ; cf.
OWL feature request [3]).

task-3696473
opw-3682280
opw-3697814

X-original-commit: 01cd6d4d0cfa418f5a72a90742d10ee44af523a4

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1887116
[2]: https://github.com/odoo/odoo/pull/137691
[3]: https://github.com/odoo/owl/issues/1428

closes odoo/odoo#160566

X-original-commit: 9a9da10bf5d1c0f96f48c9d56807512e0ad1d6ef
Related: odoo/enterprise#60116
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2024-04-05 14:01:12 +00:00
Pedram (pebr) f948473914 [FIX] point_of_sale: Refine partner search to match start of line
Before this commit, when adding two columns to the address, the search
string would become formatted as such:
"47:abigail peterson|address Belgium address0: 12, |abigail..."

Searching for "abigail" would incorrectly match with "0: 12, |abigail",
leading to the addition of the partner with ID 0 and causing an error.

With this commit, we have refined the search to match only at the
beginning of a line. This prevents incorrect matches and the subsequent
errors, improving the reliability of the partner search.

opw-3847934

closes odoo/odoo#160475

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-05 14:01:10 +00:00
Maira Salazar (srma) d3f5a4aee7 [IMP] base: display only company name in duplicate Tax ID warning
When creating a new company from a move, if the tax ID is repeated, a warning is displayed.
The warning includes the company name, address and VAT, if those have been added. In this case,
address is shown in an extra line, which looks broken.

This commit removes additional partner information by updating the context,
displaying only the partner name.

It also slightly rewords the warning, from "are you sure to create a new one?" to
"are you sure you want to create a new one?".

To replicate the issue:
1. Create an invoice
2. Click on the empty field next to Customer, type a new name and click "Create and edit..."
3. Add a Tax ID that is already in use (e.g. US12345673)
4. Warning of duplicate Tax ID shows, displaying company name, address and VAT

task-3829641

closes odoo/odoo#160373

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2024-04-05 14:01:09 +00:00
lakhichand borse dccca8fe8d [FIX] project: fixes 'view task' is display once the task is saved in portal
Steps to reproduce:
- Open project share any project which has task.
- My account > project > open that project you can see task .
- Open any task and add new sub-task you can see once the sub-task is saved
  'task view' button is displayed.

Issue:
- Sub-tasks notebook > add a line > 'view task' is displayed at the creation but
  is then hidden once the task is saved.

Solution:
- Correct the attrs and change the condition in able to invisible 'view task'
  once the sub-task is saved

task-3602610

closes odoo/odoo#160117

X-original-commit: cd6ed7f9fd2e0654cfb0672d7a9536dca21035cf
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-04-05 14:01:07 +00:00
Laurent Smet 89c9396cc3 [FIX] account,point_of_sale: Fix computation of GST group of taxes in india
Configure the group of taxes 5% GST to be price_included and apply it on 295.
Both children taxes must have the exact same amount.
However, this is not the case. In this example, we get 7.02 for one tax (correct) but 7.20 for the other.
This is because both taxes are "include_base_amount".

opw-3758458

closes odoo/odoo#160541

X-original-commit: ce28edbaae5a9af0a8c6e1f2addf4285ec56e9e1
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-04-05 12:18:18 +00:00
kcv-odoo b4985308b4 [FIX] project: fix milestone options issues in sub-task page
Steps:
- Install project app.
- Share a project which contains a task and
sub-task and project should have allow milestone
- Go to task form in project sharing.
- Go to milestone field of sub-task page.

Issue:
- Milestone field has can create and can open options
enable and because of that portal user able to create
edit or open milestone and which leads to tracebacks

Cause:
- There was no options added to prevent those attribute
from that field for project sharing views.

Fix:
- Added option to prevent those operation for project
sharing view.

Note: Add this options in blockby page in FW port.

task-3764782

closes odoo/odoo#160514

X-original-commit: 9b5da888af627e0d7efc8cdd49f41c023c79bb25
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-04-05 12:18:17 +00:00
Djamel Touati a0235d1e77 [FIX] delivery: update picking weight when product of the move changes
Steps to reproduce the bug:
- Create a storable product “P1” and "P2":
    - Weight "P1": 1kg
    - Weight "P2": 2kg

- Create a picking with the product “P1”
- Change the product of the move to “P2”

Problem:
The picking weight is not updated

opw-3754884

closes odoo/odoo#160215

X-original-commit: 849ece86a6cf49c0a9249ed910aa52add197f431
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2024-04-05 12:18:16 +00:00
Arnold Moyaux 180224ae1d [FIX] stock: don't use visibility days in reordering
This reverts commit 8a5541d16caa793c7549d78c082f7879d3aba233.

It's a too big change for stable. It breaks the flow for poeple
that want to be in just in time but want to consider the future
deliveries to order all at once. Due to reverted commit they see
their reorder in advance.

The fixed use case, could be achieve with the security days or the
global lead days system parameter.

opw-crl

closes odoo/odoo#158302

X-original-commit: 51833e4735fb0b761d3cd2867dfd166813469e70
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-04-05 12:18:14 +00:00
Maximilien (malb) 7e9a87388e [IMP] account: adding id
This pr will add an id on a div to be able to do a xpath on it.

closes odoo/odoo#157648

Task: 3756179
Related: odoo/enterprise#58640
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-04-05 12:18:13 +00:00
Loan (LSE) ccbfdea3dc [FIX] hw_drivers: get IoT log file instead of Internal Server Error
Before this commit:
 Using the "Download logs" button from the IoT box form view will
fail every time due to an Internal Server Error on the IoT side.
```py
File "/home/pi/odoo/odoo/tools/misc.py", line 189, in file_path
FileNotFoundError: File not found: /var/log/odoo/odoo-server.log
```
This happened due to changes introduced in:
https://github.com/odoo/odoo/pull/99658

The changes enforced to double check that the file path was in an
odoo addons (for security reasons).
However, it is generally not the case, thus the error

After this commit:
The log file is downloaded as intended

opw-3827121

closes odoo/odoo#160576

X-original-commit: a7aa4c6e58d6448556c85c393f2910490a0519f5
Signed-off-by: Loan Sens (lse) <lse@odoo.com>
2024-04-05 10:30:40 +00:00
lejeune quentin 3da6cbfbea [FIX] pos_viva_wallet: Add possibility to copy webhook
Currently, when you copy the viva wallet webhook to
configure it in your account, you have to select it manually.
With this commit we add a “CopyClipboardChar” widget
which does this automatically.

closes odoo/odoo#160516

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2024-04-05 10:30:39 +00:00
Andrea Grazioso (agr-odoo) 3f14dfe63e [FIX] pos_loyalty: check expired promo code
Create an expired loyalty program with code
Open POS session
Add product
Apply code

Issue: code is applied even if expired

opw-3624670

closes odoo/odoo#145609

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-05 10:30:38 +00:00
Paolo Gatti (pgi) 58fefc94ca [FIX] account: Fix restrict_mode_hash_table's account.journal write
A partner found a bug, when this public method is called on a recordset
of more than one journal then the restriction will traceback, as the
`id` can only be called on one journal.

Simplest solution is to simply get `id` on the loop variable instead,
and let the code normally block the user with a UserError.

Credits to: https://github.com/juppe
Old PR: https://github.com/odoo/odoo/pull/150888

closes odoo/odoo#160585

X-original-commit: a0ca663b78741a82fcc8f4bea97779aa97087754
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2024-04-05 08:57:50 +00:00
Nguyễn Đại Dương e7187ec1c0 [IMP] website_blog: avoid redirect 301 for /blog/feed
-Before this commit the url is like /blog/1/feed then it will become a
redirect 301 url to /blog/travel-1/feed which is not good for SEO.
Therefore we change to slug(blog) to ensure no redirect occur

closes odoo/odoo#160583

X-original-commit: 3192d2d531e918a705aee2341881a80294f848dd
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-04-05 08:57:49 +00:00
Louis (loco) d234e26890 [FIX] portal, *: display avatar when read access right are fulfilled
*: test_mail_full, website_blog

Steps to reproduce the bug:
- Enable the comments on a blog.
- Add a comment.

-> Problem: The avatar of the comment is the default placeholder image.

The problem appears since [1]. This commit was created to bypass the
read access of an image if a correct `token` was provided in the dataset
of the `.o_portal_chatter` element. The problem is that since [1], if
the `.o_portal_chatter` element does not have a `token` (or a `hash` and
a `pid` since [2]) in its dataset, the avatar images are displayed as
the default placeholder image by default. The goal of this commit is to
correct this behavior; if there is no token provided, the previously
used `/web/image` route is used to show the avatar. Thanks to this
route, the avatar is displayed if the read access is fulfilled. If it is
not the case, the default placeholder image is displayed.

[1]: https://github.com/odoo/odoo/commit/d4eb996cd3caea3fbb822437057a6a5a8a722293
[2]: https://github.com/odoo/odoo/commit/7f69708bcce3b3c4b096d89cb0ec354998eac191

opw-3749422

closes odoo/odoo#160240

X-original-commit: https://github.com/odoo/odoo/commit/c65cffd6447afce65a45a38690c003e84afd63d9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
2024-04-05 08:57:48 +00:00
Arnold Moyaux 0c2b6fa7be [FIX] mrp: Handle kit with BoM having qty != 1
Use case:
- Create a Kit BoM with finished qty to 5 consuming 10 components
- Do a sale order for 3 units (3/5 of BoM)
- Update the sale order line to 4 units

Current behavior:
The delivery has a huge amount to deliver

Expected:
The delivery is for 8 units

It happens because the method `_compute_kit_quantities`
always expect a BoM for 1 units.
`bom_line_data['original_qty']` always contains the number of times the
BoM will be needed and not the quantity of finished products.
In order to have the number of component by unit of finished product we
have to introduce the BoM quantity in the formula

closes odoo/odoo#160149

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-04-05 08:57:48 +00:00
adch-odoo 1d7b08184b [FIX] web_editor: resolved NaN issue in font-size dropdown in toolbar
Commit [1] resolved an issue related to the behavior of small font sizes, which
caused 'NaN' to appear in the font-size dropdown within the floating toolbar.
This occurred due to the removal of a variable definition, resulting in the
inability to compute the font size. This commit rectifies the problem by
reintroducing the variable in the SCSS file to ensure correct rendering.

[1]: 7931d1a14a

task-3801894

closes odoo/odoo#158811

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2024-04-05 08:57:47 +00:00
Julien Carion (juca) 42b760c8fa [FIX] board: make embedded views scrollable
This commit fixes an issue with the embedded views of "My dashboard"
view: the embedded could take as much height as they needed which could
result in excessive place taken by a single embedded view and this also
had issues with the virtual hook which is not adapted to embedded views
without scroll (this could result in completly blank space inside
embedded gantt views when they would take too much space). To solve
this issue, the commit adds a fixed maximum height to the embedded views
(80% of the window height) and also adds a minimum width to their content
so that it will be horizontally scrollable instead of being weirdly
squished. Also tweaks a bit the padding of the embedded view so that it
looks a bit better even with the added scroll bars.

task-3834795

closes odoo/odoo#160568

X-original-commit: 3df65df6a4ea027b14cc7d877de96db0987f688f
Related: odoo/enterprise#60117
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2024-04-05 07:20:50 +00:00
sesn-odoo fc0c5eead6 [FIX] l10n_es_edi_facturae: display error for EDI on refund w/o invoice
Currently, a traceback appears when you attempt to generate a Facturae
document for a credit note created manually.

Steps to reproduce
------------------
* install `l10n_es_edi_facturae`
* create a credit note manually (not from an invoice)
* confirm and attempt to generate the Facturae EDI file

You should be me with a traceback:
`ValueError: not enough values to unpack (expected 1, got 0)`

Cause
-----
To generate the EDI document, the system needs the credit note to have a
link to the refunded invoice. However, in this case, there's no invoice
since the credit note was created manual.

opw-3786219
opw-3772085

closes odoo/odoo#160565

X-original-commit: 202387e518118171051e0db0fe857f44d442fb95
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2024-04-05 07:20:48 +00:00
aath-odoo 3c17d2ef3b [FIX] website_event: submenu page not found
Before this commit:
When disabling the submenu for events, it would show a 404
Page Not Found error.

After this commit:
the current behavior is that when the
submenu is disabled, it redirects to the /register page of the event.

task-3658380

closes odoo/odoo#160544

X-original-commit: ea140d5cfea992caad7207ff6499a46a8f575729
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Aashish Thakur (aath) <aath@odoo.com>
2024-04-05 07:20:48 +00:00
Dawn Hwang 6cb886efc0 [FIX] hr_holidays_attendance: Fix time off overtime duration check
Currently when a time off using an overtime is written to for any
reason, it will compare the duration of the overtime with the
number_of_hours_display. However, the duration check will always be
triggered since overtime duration is number_of_hours_display * -1

This causes problems if an overtime time off is modified for any reason
and the employee does not have enough total_overtime

closes odoo/odoo#160381

X-original-commit: 1c477259d08995d1b0bfe8ebd551452073e0c03b
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-05 07:20:47 +00:00
Ethan Vincent a11bca1810 [FIX] sale_loyalty: skip paid calc if ewallet type
**Current behavior:**
Creating an ewallet loyalty program and removing the default
value for `trigger_product_ids` without adding another in its
place will result in any ewallet created using that program to
not have its balance deducted after being used in a sale order.

**Expected behavior:**
The default product should not be required here, nor should any
product, seeing as there is no `required` constraint on this
field nor any related ones.

**Steps to reproduce:**
1. Create an ewallet loyalty program and remove the Top-up
     ewallet product

2. Create an ewallet, give it some balance, and use it in an
     order

3. Check the balance of the wallet to see the erroneous behavior

**Cause of the issue:**
In the _program_check_compute_points() method of `sale.order` in
`sale_loyalty`, the conditional block:

`if not products_per_rule.get(rule):
    continue`

will normally prevent rules belonging to ewallet program types
from going further in the method because they have the default
ewallet top-up product in their domain. When the continue is not
reached, they will reach this line:

`amount_paid = sum(max(0, line.price_total) for
    line in order_lines if line.product_id in rule_products)`

which will end up offsetting the actual subtraction of a SOLs
`points_cost` from an ewallet `loyalty.card`'s balance.

**Fix:**
Add another check prior to the calculation of order points which
prevents ewallet coupons without any top-up products from
reaching the problematic code. If an ewallet program doesn't
have any `trigger_product_ids`, it shouldn't ever need to
perform such calculations.

opw-3756134

closes odoo/odoo#159957

X-original-commit: 695b3a687a3d160451339a675aab8986682389eb
Signed-off-by: Vincent Ethan <etvi@odoo.com>
2024-04-05 07:20:46 +00:00