* query pricelist filters/domains directly for the correct company
instead of relying on context/session/... content
* pass the record instead of the id to avoid useless browse calls
* also clearly highlight sudoed partner record
Part-of: odoo/odoo#82374
* order fields, methods according to guidelines
* fix some typos
* rename methods according to guidelines
* remove useless field attributes and class specifications in super()
calls
Part-of: odoo/odoo#82374
There is an issue with the Italian carryover, line vp14b.
Use case:
- Month 1, have a value of 25 in this line => will trigger a carryover to line vp7
- Month 2, add more value to vp14b so that it goes above 25.82.
This will set the bound as None, and thus this will not impact the carryover.
This is wrong, because then the next month we will see a value of 25 in vp7
while it should be 0.
closesodoo/odoo#84938
X-original-commit: ffbc7af321a36d4fd0aebb94d7a636cb1fc34b88
Related: odoo/enterprise#24555
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
Before this commit, the numbering system used by luxon was the default
one set by the browser (in most cases: 'latn'). This caused issues when
translating luxon dates with moment dates, as moment supports some
locales differently (e.g.: ar_001 uses the 'arab' numbering system
while Intl uses 'latn').
To have proper consistency, this commit assigns (as much as possible)
the same numbering systems as luxon for each supported locale.
Warning: since the numbering system is now set according to the user
'lang' parameter, it's now unsafe to use `DateTime.fromFormat(...)` with
static date strings, as they might not be parsable with the current
numbering system.
closesodoo/odoo#84833
X-original-commit: 8bd8b299d57ea930b0549446900bd51d03800041
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Since [1] when fuzzy search was introduced, fuzzy search was also used
when the search term contained numbers.
This is a problem for companies where the shop search is used on
references: the fuzzy search does not match against the whole database
and therefore the exact match might not be found.
After this commit the exact search is used whenever the search term is
made of 80% of numbers or more - because it is very likely to be a
reference or an identifier.
[1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986
opw-2715647
closesodoo/odoo#84943
X-original-commit: 7b44907c322a7b78ef4a5cb46627df4f72b21240
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
- A new flag is added to the Setting (l10n_it_edi_sdicoop_demo_mode)
that is computed from the ir.config_parameter
'account_edi_proxy_client.demo'.
If the flag is 'demo', Odoo will not send invoices through the EDI,
if the flag is 'test', Odoo will send invoices to an IAP test server
instance that operates with a test SDICoop service
if the flag is 'prod', Odoo will send invoices to production IAP,
that routes them to the official SDICoop service.
- Some minor UI rework for the EDI parameters on res.company
The EDI settings in the res_company form, under the
'Electronic Invoicing' tab, must stay on the left
closesodoo/odoo#84925
X-original-commit: c5d049c55d21f9885e79182df2bd5f433c5bb782
Signed-off-by: Josse Colpaert <jco@odoo.com>
With this commit we can now call a hook when we want to modify the code for this route.
Before this commit the only way to modify/extend this would be by taking over a big part of the code.
closesodoo/odoo#84905
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Prior to this commit the next call date for the first level would not
take the second level into account, as such it could be that the first
level would be completely skipped instead of being prorated properly.
TaskId-2768435
closesodoo/odoo#84899
X-original-commit: 791b801c7b96a94353031a06dd5da4eeb20ee08b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit orders the records coming from the mock server the same
way they are ordered by the ORM, while also allowing it to support
multiple levels of orderby.
This has been done to increase consistency in the test suite and provide
a more accurate representation of how records would be returned by the
actual server.
Some tests performed their assertions based on this previous
undeterministic system and have been adapted, either by altering
the base setup or the assertions themselves.
closesodoo/odoo#84718
Related: odoo/enterprise#24509
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Ensure the user can keep typing inside a newly emptied inline tag:
* Add Zero-width Spaces (ZWS) in empty html tag
> We add zero-width spaces in elements in certain cases where they would
> not be correctly displayed by the browser if they were truly empty.
> This also ensure the user cursor can stay in an empty elements,
> and thus we keep the ability to add content in those elements.
>
> See the `fillEmpty` utils function.
* Remove lingering zero-width spaces
> However, we never remove those zero-width spaces when they are not
> useful anymore. In particular, keeping those invisible characters in the
> content prevents the ecommerce from saving the new price of a product if
> the previous price was previously completely emptied during edition.
> This commit fixes that.
>
> The issue didn't happen with the previous editor because they were
> using non-breaking space instead, which is removed by the text_content
> method of lxml. However, non-breaking space were visible during edition,
> which was weird on its own.
>
> Some changes had to be made to the deleteForward and backward commands,
> to ensure the new behaviors.
> Author : @dmo-odoo
* Adapt the deleteForward and backward commands
> To ensure the added ZWS do not break the Deletes behaviors,
> we need to adapt the `deleteForward` and `deleteBackward` commands.
Co-authored-by David Monjoie <dmo@odoo.com>
task-2622455
closesodoo/odoo#84891
X-original-commit: 4360643a446271d4ff1898d67a5b5287722a0820
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
* Fix some tests that will break when we change the empty inline tag handling.
* Add missing tests to ensure the new empty tag management
behave correctly.
* Improve some tests with `contentBeforeEdit` and `contentAfterEdit`
X-original-commit: af379b11462d9393c3c9846aaecb9488ffaa9212
Part-of: odoo/odoo#84891
* Ensure the test environment is clean from previous editor instances.
* Provide a way to clean the successfully test cases
to have a better and quicker overview of the failed tests.
* Better error messages in test report
X-original-commit: 9a362195ad7b3485877946d18d64fd84c62605f9
Part-of: odoo/odoo#84891
Purpose
=======
The module website_crm_partner_assign has its own partner_longitude
and partner_latitude values that are resolved independently, when the
linked partner doesn't exist yet.
So when a lead is turned into an opportunity and a partner is created,
the address info is copied to the new partner, but not the geolocation.
In case these partners are supposed to be geolocalized (for example
on the FSM application), the geolocation will be recomputed despite
the fact that this information was already available at the convertion
time.
closesodoo/odoo#84890
Related: odoo/enterprise#24517
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
This @depends could be 'dangerous' because it would trigger a
lot of calls to the GeoIP API.
It would be more reasonable to make it lazy instead.
So we just reset the geolocation to 0 when the address is modified
without providing the new values, and the user can manually trigger
the geolocation again when needed.
For FSM, it will be updated when needed as the computation is
triggered when the geolocation information is empty.
Part-of: odoo/odoo#84890
Before this commit the only way to modify the domain is to completely override portal_my_quotes/portal_my_orders.
Since this function is so big this is not clean/easy to do.
By creating a separate function we can simply override it and we can reuse the same domain in two places.
closesodoo/odoo#84886
X-original-commit: ff50844da0e4423372746e767f482a2a71148be4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to repoduce:
- Go to Sales - products
- Create a product
- Add variants (3 attributes and 2 values each) Total is 8 variants.
- onfigure variants: Select 1 attribute and exclude it for 1 variant (for example: exclude for size 12x12)
-> the number of variants remains at 8. The one that is excluded is still visible in the Product variants tab.
Solution:
When an exclusion is created, archive all the not-possible-combination.
OPW-2729329
closesodoo/odoo#84883
X-original-commit: 91642f4e29beb89d110084a20443fb300ee26530
Related: odoo/enterprise#24512
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The history of the replenishment info may be empty while it should not
To reproduce the issue:
(Set your device on January)
1. Process a delivery for product P
2. (Inventory > Operations > Replenishment, create a new one for P)
3. Click on the information icon (I) of the P's line
Error: The sales history does contain anything
When calling `relativedelta`, `month` is considered as an absolute value
and will replace the corresponding value while `months` is a relative
value and will be added/subtracted to the corresponding value.
OPW-2740123
closesodoo/odoo#84881
X-original-commit: c87fea0916b61cb4b0c37f3fe2ddad8359e6aeb2
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Usecase to reproduce:
- Create a batch picking from a new location to customer
- Put some `stock.move.line` in a wave
- Validate the remaining of the initial `stock.picking`
- Create a new `stock.move` with the same data and without `picking_id`
Current behavior
The stock.move is added to the existing wave. However the
stock.move.line created could not match the current wave specification
Expected behavior
A new picking is created and it could be merge in the wave picking if
wanted
closesodoo/odoo#84875
X-original-commit: 4ea418ed1cceff4aee916cf791011a1dc67c77a1
Signed-off-by: Arnold Moyaux <arm@odoo.com>
The configurator introduced at [1] uses a frontend controller to
display its content. However this results in inconsistent language
translation as the python code uses the users's language but the
localization services uses the frontend's language when on a frontend
page.
Steps to reproduce:
- Create a database with the only language being french
- Install website
- In the configurator, all the pages will be in french except
"Pages and Features"
With this commit, the language for the configurator will always be
the language of the website it's configuring. A test also make sure
that this is the current behavior.
[1]: https://github.com/odoo/odoo/commit/e8a5af2e28a4724f86783746706cb59175f086bf
task-2687416
closesodoo/odoo#84810
X-original-commit: a0f8fdc65566fafe98dab21f5c2dbab9505c3d5c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Specify 'channel_type' explicitly in channel_create. This makes the
method more clear and decoupling from default value.
Once the default values changes, the method can work as expected as well.
task-2767635
closesodoo/odoo#84867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
*: calendar, hr, hr_holidays, im_livechat, note, sms, snailmail,
website_livechat, website_slides.
This commit prepares the ground for the model definitions PR.
In order to reduce the noise, all mail module's beforeEach
functions will be made async.
task-2767820
closesodoo/odoo#84845
Related: odoo/enterprise#24489
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, the users with the "editor and designer" role no
longer had access to the theme tab options (and also other flows like
assets regeneration in debug mode, etc). This is because when the
website assets have been changed to be handled by ir.asset records, in
this commit [1], the "editor and designer" rights were not updated to
have an access to ir.asset.
After this commit, the users with the "editor and designer" role have
the rights to access ir.asset (read, write, create, but not unlink
because the admin does not need it).
This mimick what is done with ir.ui.view, which is way more critical
than ir.asset, so it should be relatively safe to add this right to the
website admin for assets, as it is already the case for views.
We could have added sudo() everywhere (as no need of a -u, and which is
less risky that adding rights directly through csv but the ir.asset
rights covers too many different flows to do so.
[1]: https://github.com/odoo/odoo/commit/8cc066173dfb61bd95b8e1f0716f71f4e251810a
task-2748004
closesodoo/odoo#84847
X-original-commit: e3515a7b73c3e173a3ddf0bc48e4a888024c8817
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Rewrite _post_inventory to make it work better
with mo batches. This mainly improves the
time it takes to mark_as_done manufacturing
orders from the Workorders ListView.
stock.move._action_done is faster
when called outside of a for loop, i.e.
directly on self.
opw-2760394
closesodoo/odoo#84846
X-original-commit: 4cc6083ea1bd28be07e275322481ad11d8995d58
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Sometimes when importing products that share the same internal reference code (default_code) the _import_fattura_pa function will throw an expected singleton error. This is because, in order to find the product for the line of the invoice, it will search for the product reference code (e.g. [CONS_0001]), which is not necessarily unique.
I've set the limit to one on the search to fix the immediate error for
now, but I will add more logic to better search for the relevant product
in a future commit.
closesodoo/odoo#84826
Task-id: 2764978
X-original-commit: aae609915cb1f76c32c518ff8959674853633f55
Signed-off-by: Josse Colpaert <jco@odoo.com>
Set the l10n_it_edi_transaction value on the invoice to false after
receiving notificaScarto from the edi. This is so that the methods
associated with posting the invoice will detect it again and process it
for posting.
Task-id: 2764978
X-original-commit: 925fc0ff3914e83ddaac4fd5f6c1bdb7b4b2c68b
Part-of: odoo/odoo#84826
This commit adapts the l10n_it_edi_sdicoop and account_edi_proxy_client
modules to make use of the existing config param
'account_edi_proxy_client.demo' in order to target the correct odoo iap
server for italian edi requests.
When the config param is set to:
'prod' or False (when the config param doesn't exist): Target the
production odoo iap server (by default), which submits and collects edi from the
production channel. Though if the config parameter
'account_edi_proxy_client.edi_server_url' exists, we use the value
provided there instead.
'test': Target the test odoo iap server, which submits and collects edi
from the test channel
'demo' or anything else not above: don't send anything, and simulate the
flow of italian edi submissions in odoo
task-id 2764978
X-original-commit: 32683b70a34a900a112d19bf780446a973753ae5
Part-of: odoo/odoo#84826
Current behavior:
In any chatter, if you schedule an activity then use the "Done & schedule next" options you had an error if you try to modify some fields of the record linked to the chatter.
For example in CRM you couldn't modify the probability after using "Done & Schedule next"
Steps to reproduce:
-Go in CRM
-Go on a lead page
-In the chatter schedule an activity
-Click on mark done and then on Done & Schedule next
-Try to edit the probabilty field of the lead
-You get an error : Record does not exist or has been deleted. (Record: mail.activity(x,), User: xx)
opw-2648685
closesodoo/odoo#84841
X-original-commit: b45f024e96e17790427ad12e7f201567db0a249b
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Add a button to directly open the leave/allocation in the Time Off
Analysis view.
closesodoo/odoo#84729
Taskid: 2762014
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit simplifies the SCSS of the Pivot View.
It also adds the possibility to detect if the Pivot View is embedded in
another one (eg. if the view is embedded in the Dashboard view). This
last change was made to adapt the size of the Pivot table depending of
the context.
task-2731553
closesodoo/odoo#82575
Related: odoo/enterprise#23701
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Being able to first authorize then capture a payment has several
advantages:
- Confirm a quotation when the payment is authorized and capture it
when the order is shipped.
- Review orders before capturing the payment.
- Prevent credit card fees in the case of a refund
This commit implements this feature for the payment acquirer Adyen.
task-2507304
closesodoo/odoo#70591
Related: odoo/upgrade#3088
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit contains two fixes.
The first fixes the absence of a multi company rule for the attendance
report model.
The second fixes the wrong widget being used in the pivot view of the
attendance report.
TaskId-2765671
closesodoo/odoo#84668
Related: odoo/upgrade#3251
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The settings that determines the digitalization mode (disabled, manual
or automatic) used to be common for both vendor bills and customer
invoices.
As many users only want to use the service on vendor bills and not on
customer invoices, the settings has been split for both types of
invoices.
closesodoo/odoo#84184
Task: 2751408
Related: odoo/enterprise#24083
Related: odoo/upgrade#3240
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Before this commit, some tours from `sale_product_configurator` and
`sale_product_matrix` were not working since there wasn't a dependency
with `sale_management`.
They are now in a test module with all the other configurators and the
missing dependency.
Additionally, other tests are added to improve the coverage of the
configurators' logic.
task-2049081
closesodoo/odoo#82108
Related: odoo/enterprise#23199
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
PURPOSE
Consolidate information on a 'main' website.visitor when using multiple
devices / browsers.
Which in turn allows a much deeper cleaning of irrelevant and inactive
website.visitors instead of archiving them, saving a lot of DB space.
SPECS
This purpose is reached in 3 steps:
### First step
First move the concept of 'parent_id' of website.visitor into the 'website'
module.
The implementation of 'parent_id' was done in website_event because of stable
development requirements but it makes sense to move it to the website module.
### Second step
Then enforce the consolidation of all visitors information onto the
'main visitor'.
Visitors are linked when we are able to identify a single user through its Odoo
account. The browser where the last connection has been made will be linked to
the main visitor, other visitor records are linked to it through the parent_id
field.
When using multiple devices / browsers, we want to consolidate all the relevant
information on the main visitor, including:
- Created crm.leads
- Subscriptions to events
- Wishlisted tracks
- (Subscriptions to push notifications, done in enterprise counterpart)
Once we have clean visitor records containing necessary important information,
we can safely go ahead and modify the CRON cleaning inactive visitors to DELETE
them instead of archiving them, leading less database space required / improved
query performances.
### Third step
Clean now unnecessary code for wishlisted tracks.
This code was necessary when we had to keep track of all visitors and its
children records when there was only one push_token allowed per
website.visitor.
Now that a website.visitor can have multiple push subscriptions (see enterprise
counterpart), this code is no longer necessary, leading to better logic and
increased performances.
Check underlying commits for detailed information about those 3 steps.
LINKS
Task-2429652
closesodoo/odoo#65113
Related: odoo/enterprise#16781
Related: odoo/upgrade#2111
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is the community counterpart of the enterprise commit that
consolidates push tokens on website.visitors.
We now don't need to keep wishlisted tracks on children records of a
website.visitor and we can keep the whole wishlisted tracks list consolidated
on the parent only.
This allows some code cleaning and some simplification as well as a few
performance improvements.
Task-2429652
Part-of: odoo/odoo#65113
PURPOSE
Visitors are useful in terms of marketing analysis but they can bloat the
database really quickly if you have a lot of traffic on your website.
This commit aims to relieve the database by fully deleting inactive visitors.
SPECS
On an active website, you can easily reach hundreds or even thousands of
visitors per day.
While active visitors are useful for marketing purposes, inactive ones were
archived after a period of inactivity (i.e: not connected for X days in a row,
where X is configurable as a parameter and 30 by default).
But archiving visitors is not really useful either.
We don't see any specific cases where you would want to restore some visitors.
That means we are better off unlinking the visitors completely to save database
storage space.
We want to make exceptions and avoid deletion of inactive visitors in some
cases:
- When they are linked to a partner (meaning most likely linked to a
registered user)
- When they are linked to leads
- When they are registered to events
Several tests were added to ensure that leads matching these conditions are not
unlinked.
We also took this opportunity to enforce the "_link_to_visitor" rules in those
tests to make sure that:
- When visitors are linked, the leads are merged into the main visitor
- When visitors are linked, the event tickets are merged into the main visitor
- When visitors are linked, the wishlisted tracks are merged into the main
visitor
This is also preliminary work for a commit that will move the push_token of
website.visitors to a separate table.
That will in turn allow us to link the push_tokens within the
"_link_to_visitor" method and delete the linked visitor instead of archiving
it.
LINKS
Task-2410217
Part-of: odoo/odoo#65113
The concept of 'parent_id' on website.visitors was introduced in the saas-13.3
stable while implementing the "event online" feature:
However, it should have been part of the website module from the start since
it's a 'global' concept that does not depend on events at all.
See #53540 for more details.
This commit aims to clean the code by moving the field to the website module,
which allows a nice cleaning of associated overridden methods as well.
Along with that, we move the website.visitor demo data from the event module to
the website module, allowing a fresh install of website to showcase some of our
visitors feature.
We also took this opportunity to do some minor improvements in the visitors
kanban view in order to make relevant information more visible.
Task-2429652
Part-of: odoo/odoo#65113
The delete icon of many2many tags disappears when the text is too long
for the column
Steps to reproduce:
1. Install Invoicing
2. Open Invoicing and create a new invoice
3. Add any product (a tax should be added for that product) and reduce
the size of the 'Taxes' column until the tag is too long for the column
4. The tag's content overflows and the delete icon is not accessible
anymore
Solution:
Change \<span> element back to \<t>
Problem:
This commit https://github.com/odoo/odoo/commit/0915ac5a0e95ef9511559fded7cf1e149b19ce67
changed the element of `_badge_text` to \<span> which broke the
adaptability of the many2many tags
opw-2755293
closesodoo/odoo#84824
X-original-commit: d859c6328b3374b17f0b0be190ca62fe2597289d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>