The rte_translator tour that test translation on the frontend could not
be started from the "[debug menu]" > "Start Tour" for two reasons:
- the start URL is not specified, so the test was started on current
backend page wich is wrong (in python the start url is "/")
- the backend original state (params after #) does not work with ?k=v
inside argument value, so `#return_url=/?debug=true`.
To solve this issue, we encode the return_url value and add a start url
when rte_translator is started manually.
opw-1998623
closes#33443
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Create a tour with only one step for Community
`edition: 'community'`
- Install a database in Enterprise
`tip.in_modal` in `_check_for_tooltip` cashes since `tip` is undefined.
opw-1998603
closesodoo/odoo#33430
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Include the Google Error message in the error message showed on screen.
Fine tuning of da13c70484 : missing transiflex translations, empty body,
wrong string format.
opw-1966309
closesodoo/odoo#33216
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
The snippets "Latest Posts - List" and "Latest Posts - Big Images" have
a "Number of columns" options but:
- these snippets are not taking the option into account and are
specifically size (in large "list" => 100% width, "big image" => 50%)
- the snippet content is dynamically generated, so the column sizing
set on preview when saving is lost when content is displayed
- the option "Number of posts" contradicts the option
"Number of columns" and can leads to have several lines that are not
taken into account in "Number of columns" (the column number is the
number of child)
Thus, this changeset disable the option for these snippets.
opw-1984899
closes#33393
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Fine tuning of 5ef86ef6c874ab4dc78402493d05b2460c69e7f6
Steps to reproduce:
Set a custom language settings for date by switching the %m and %d.
Create a sales order
Current behavior:
Invalid date error boxes was raised two times
fixes#33408
opw:1998971
closesodoo/odoo#33415
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When a leave type is in hours, before this commit:
- in the leaves request list the request duration is shown in days.
- the name of the leave shown duration in days.
- the rounding after the conversion from hours to days, generates some
misunderstandings. If you have a day of 7.5 hours, and you take a leave
of 2 hours, it would be round it to 0.25 days, and not to 0.27 days as
it should be. This occurs because we round to the 1/16 of the day.
Now:
- in the leave request list, the request is shown either with days or
hours depending on the leave type.
- the name of the leave shown duration either with days or hours
depending on the leave type.
- the leaves are shown in the correct unit, there is not more
misunderstandings occurring because of the rounding.
related to commit : 5c33ebef5f and 2c366acbf0
opw-1974691
closes#29804closes#33290closesodoo/odoo#33369
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Activate online payment of invoices
- Activate and configure Stripe
- Create an invoice, access it through the portal
- Pay it with Stripe
The user is redirected to `/my` instead of `/my/invoices/<id>`.
The root cause is because Stripe creates 2 transactions, the second
being created at:
https://github.com/odoo/odoo/blob/43295c2a3741fb98f9c5d1a506652442efed0a82/addons/payment_stripe/static/src/js/stripe.js#L108
This second transaction, which is used to record the payment, doesn't
contain the appropriate `success_url`.
The best fix would probably be to either:
- prevent the creation of the second transaction by refactoring
`stripe.js`
- pass the appropriate `success_url` to the `stripe_form` template
- reuse existing draft transactions instead of creating a new one
None of these solutions is really suitable for stable since it might
require some heavy modification. However, a simple workaround is to
change the fallback `success_url`since we have all the necessary information
to build it.
opw-1997283
closesodoo/odoo#33404
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Go to the website settings and activate the option 'Tax-Included' for
the pricing in the website.
- Go to Sales > Configuration > Delivery methods and create a new method
based on rules. For example:
Price is 10.0 when the weight <= 100
Attach a product (with taxes) to it.
- Publish on website
- Buy a product on the eCommerce
- Checkout, go up to payment step and choose the delivery method created
The 'Delivery:' field on the left shows the delivery price with taxes
excluded although they are included. Funny thing: going back to the
'Address' step show the correct price.
This is because the `delivery_price` field does not take into account
the tax configuration.
We can use the `amount_delivery` field (hum hum) which does it
correctly.
opw-1981808
closesodoo/odoo#33394
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Install discuss, change the general setting in dev mode to disable the
"Show Effect" checkbox. Change the preferences of the user to let odoo
handle notifications. Ask another user to ping you on a chatter then go
to discuss and click the "Mark as Read" button. Traceback.
The `notification_manager` agent has been replaced by another agent in
07cd24b1ec, the code has been updated to use the new agent.
opw-1986844
closesodoo/odoo#33363
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
This reverts commit dbaef7de17 since it
causes issues (unbalanced moves). Temporary revert so we have time to
analyze the issue.
opw-1997794
closesodoo/odoo#33380
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Go to any field Date
- Enter wrong date
Bug:
A traceback was raised.
Now a warning is raised and the wrong value is removed.
opw:1974747
closesodoo/odoo#33362
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Before this commit and since 2f7c03d9ca, the admin user has not ID=1
anymore.
Thus, some old condition were not doing what they were expected to.
Firstly, the admin was not considered as such on the forum, and if its karma
points were not high enough, it would not be possible to do anything for the
admin. Note that it was fixed in saas-12.1 with 1dac413130
Secondly, some _search functions would not return a truthy value anymore.
closesodoo/odoo#33359
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Commit 98ee15977a made the Stock Interim accounts reconciliable,
and introduced auto-reconciliation of related entries. This has the
advantage to clean-up entries in these accounts. However, since these
accounts are reconciliable, the entries will show up in the manual
reconciliation widget (expected) and the bank reconciliation widget (not
expected).
There are 2 cases where it causes issues:
- after migration from v11, the entries were not reconciliced. Although
this will be fixed in the near future, it is too late for already
migrated databases
- using MRP. A list of components i costing Xi might be used to create a
finished product of cost Y != sum(Xi). Indeed, the routing cost has to
be taken into account. In this case, the entries are not fully
reconcilied.
The result is that the bank reconciliation widget ends up with an
growing number of unreconcilied lines, and in the end making it
impossible to use.
In order to work around the issue, we prevent any account used as a
stock interim account to be included in the bank reconciliation widget.
For performance reasons, we directly search the `ir.property` table for
the corresponding accounts instead of filtering AML thanks to
`excluded_ids`.
Closes#32611
opw-1963025
opw-1967462
closesodoo/odoo#32957
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When using `sales_team.team_sales_department` as fall back default
team, last condition that checks if such team can be default was
incorrect, because `active` value check was mixed with lead type check.
In other words: True or False and False => True
But intention is: (True or False) and False => False
opw 1997715
closesodoo/odoo#33316
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
The field session_ids is fetched from the server for what seems to be no
good reason at all; for database with a lot of sessions (test case with
40k+ sessions), this can lead to an extremely slow dashboard.
closesodoo/odoo#33303
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
By this commit, in sales by channel report of product page we are able to show the quanity of product which is just in 'sale' and 'done' state.
Before this commit, the quantity of product included every state except 'cancel'.
This commit is related to issue: #27643closesodoo/odoo#28948
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
- Create 2 companies C1 and C2
- Do not share partners between companies
- Create a partner P1 in C1:
Name: PartnerA
AccountNumber: 1234
- Create a partner P2 in C2:
Name: PartnerA
AccountNumber: 1234
- Create an invoice in C2 for P2, validate and pay
- Add the fields `account_number` and `partner_name` to the bank
statement lines for convenience.
- Create a bank statement with a line:
Partner Name: PartnerA
Account Number: 1234
- Run the following query (on which no record rule is applied for bank
statement reconciliation):
```sql
SELECT
st_line.id AS id,
COALESCE(p1.id,p2.id,p3.id) AS partner_id,
p1.id AS p1,
p2.id AS p2,
p3.id AS p3
FROM account_bank_statement_line st_line
LEFT JOIN res_partner_bank bank ON bank.id = st_line.bank_account_id OR bank.acc_number = st_line.account_number
LEFT JOIN res_partner p1 ON st_line.partner_id=p1.id
LEFT JOIN res_partner p2 ON bank.partner_id=p2.id
LEFT JOIN res_partner p3 ON p3.name ILIKE st_line.partner_name
WHERE st_line.id IN (XX);
```
The result is:
| id | partner_id| p1| p2| p3|
|----------|-------------|--------|------|------|
| XX| P1| null| P1| P1|
| XX| P2| null| P2| P1|
P1 should not appear in any of the results. In some configuration, P1
will be selected for matching and will trigger an access error.
Commit 1fc0b08e14 introduced the record
rules for `p3`, but was wrongly set at the end of the query. We
introduce the rules for `p3` as well as `bank`, so the result is now:
| id | partner_id| p1| p2| p3|
|----------|-------------|--------|------|------|
| XX| P2| null| P2| null|
Which is the expected result.
Fixes#32954
opw-1974649
closesodoo/odoo#33245
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When the clickEverywhere js test is started with base only, the
web client opens the first app by default (see openFirstApp call in
web_client.js). Unfortunately, the test clicks immediately on the apps
menu and the client does not invalidate openFirstApp.
Then, when trying to click on a filter, it does not exists anymore and
leads to a timeout.
The present timeout should solve the problem without refactoring the web
client.
closesodoo/odoo#33339
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
When Odoo is stopped using CTRL+C on Windows, a Traceback is thrown
because the SIGXCPU signal does not exists on Windows.
With this commit, the check for SIGXCPU only occurs on supported
platforms.
Fixes#33311closesodoo/odoo#33333
Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit aims to make unit tests pass when creating a new database
with only 'survey' installed.
The tour 'test_survey' was not loaded before reaching /survey/start,
causing tests to fail.
The js asset is now loaded within web.assets_common because the tour
should also work with the 'public' user. For this reason,
'web.assets_backend' is not a good fit.
Widget 'root.widget' was undefined too. Appropriate js file is now
loaded.
Closes#33330
Signed-off-by: Christophe Simonis <chs@odoo.com>
Before this revision, the public user of your website could be changed
upon saving the general settings if you added users in the public group.
Case:
- Install website
- Add a user in the "public" group,
with a login sorted alphabetically before "public", let's say "1public"
- Open the general settings and save directly
- Notice the public user of the website has been changed to "1public",
and it did not keep "public", while you haven't changed anything
in the settings.
That said, the current heuristic to find the public user of a company
might not be the best, as you could automatically find users in the group
public that you would not like to use as the public user of your website.
In master, maybe a field `public_user_id` could be added on
`res.company`, and the `user_id` of the website could become
a related of the company public user.
In addition, when `_get_public_user` creates a new public user,
it could link it to the company in `public_user_id` field.
closesodoo/odoo#33332
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Steps to reproduce the bug:
- Create two storable products A and B
- Create a BOM for A with B as component and A as by product
- Set this BOM as "To manufacture"
- Create a MO for A and try to process it
Bug:
Ensure one error was raised by function check_finished_move_lots defined in module mrp
because the variable produce_move must be one record.
Now, it's not possible to create a MO for A if A has a BOM with A as by product.
opw:1974863
closesodoo/odoo#33280
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When creating a new crm lead from the kanban view, using the quick add
button, the default probability is the one of the first stage, and not
the one of the selected stage.
Now, the default probability is the one of the selected stage.
opw-1986047
closesodoo/odoo#33267
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Since the changes introduced in cdcdebc6cb,
the tax amounts were not showing in the Sale Details Report.
closesodoo/odoo#33007
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.
The traceback is a DOM `IndexSizeError`, that error is thrown when the
boundaries of a DOM Range (`document.createRange`) are outside of the
ranged elements. In this context, the error happens because the element
is empty and the range has an end bound set to the size of the selected
text.
Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.
opw-1981751
closesodoo/odoo#33257
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Creating a new database with only sale_stock installed will lead the
boot_tests.js test to fail.
That's because commit 033608eb11
introduces an implicit dependency on a sale_management tour. This seems
to be a mistake since sale_stock does not depend on sale_management.
The tour only makes sense if both sale_stock and sale_management are
installed though. That's why the additional steps will be run
conditionally.
After this commit, the extra steps will only be run when sale_management
is installed.
Technically, this is done by checking whether odoo._modules contains
sale_management.
opw-1964469
closes#33275
Signed-off-by: Christophe Simonis <chs@odoo.com>
- specify the correct separators on the language
- add the address format
- add street addres format for croatia
closesodoo/odoo#33205
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
avoid to get journal_entry_ids, to avoid pushing those ids in cache and
having them read uselessly when accessing an account.move.line
recordset.
Use search and search_read instead of ORM __get__
closesodoo/odoo#33192
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Co-authored-by: william-andre <wan@odoo.com>
Commit c7773f9f introduced a duplicated term to the file .pot, which
causes the following error when trying to re-load translations:
```
ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same
command have duplicate constrained values.
```
This commit removes on eof the duplicates, leaving only the valid one.
In addition, field string is modified to match the one defined at the
`website_sale` module, to prevent this from happening again, as had also
in 6af6da5c.
closesodoo/odoo#33223
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When a new request of leave is created, some fields are computed to
calculate if it's possible or not, to take the leave
(virtual_remaining_leaves, leaves_taken, remaining_leaves and
max_leaves).
These fields are computed using the fields :
allocation : hr_leave_allocation.number_of_days.
and request : hr_leave.number_of_days.
When a leave type is in hours, both of these fields are calculated
differently:
allocation: The allocation field is calculated dividing the number of
hours registered by the user per the average hour per working day.
(https://github.com/odoo/odoo/blob/d809b476819968837b61bdd78fbf101caac73adc/addons/hr_holidays/models/hr_leave_allocation.py#L236)
request : The request field is calculated by finding the real number of
requested days.
(https://github.com/odoo/odoo/blob/d809b476819968837b61bdd78fbf101caac73adc/addons/hr_holidays/models/hr_leave.py#L360)
If in the company each day have different working hour, then the number
of days calculated with the average hours didn't represent the real
number of days that the employee can take. This issue can avoid the
employee to take a leave even if he has the correct number of hours to
take it.
Now, the fields (virtual_remaining_leaves, leaves_taken,
remaining_leaves and max_leaves) are calculated using either the days
fields or the hours fields depending on the leave type.
opw-1972133
closesodoo/odoo#33244
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When a leave type is in hours, before this commit, in the allocation
list the allocation is shown in days. The problem is that the number of
days its calculated with the average hour per day. If in the company
each day have different working hour, then the number of days calculated
with the average didn't represent the actual number of days that the
employee can take.
Now, in the allocation list, the allocation is shown either with days or
hours depending on the leave type.
opw-1972133
- Activate cash basis
- Set a tax
Tax Due: Based on Payment
Include in Analytic Cost: true
- Create an invoice, add the tax and an analytic account on the invoice
line
- Validate and pay
The analytic account is correctly set on the tax line, but it is not set
on any of the cash basis entries.
Partial backport of 079a13a349.
opw-1971751
closesodoo/odoo#33236
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The `_search` is override in `calendar.event` to return both ids and
virtual ids of recurrent events. Calling `.get_recurrent_ids` after the
search is wrong.
The entire request has been copied from the original
`_find_allowed_model_wise` function defined in `mail.message` to ensure
his correctness.
The purpose here is to ensure every virtual event id is mapped to the
real event id so the original function doesn't throw KeyErrors for
virtual ids.
opw-1972563
closesodoo/odoo#33246
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
- Set a product barcode to a 8 letters value, e.g. 'AAAAAAAA'
- Print 'Product Barcode (PDF)' (or any other report containing the
barcode)
The barcode doesn't print.
All templates assume that:
- a 13 characters barcode is EAN13
- a 8 characters barcode is EAN8
But this assumption is too restrictive: one could want to generate
barcodes with such length without following the EAN13 or EAN8 structure.
We fall back on Code128 when the barcode generation fails.
Backport of 06cfdbaab8
opw-1981988
closesodoo/odoo#33240
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
There was a syntax improvment in the commit merged but it was not
intended to be unfinished.
fixes#33228
opw-1981839
closes#33239
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When paying an eCommerce order with an acquirer which doesn't
redirect (payment_flow: s2s) the "Pay Now" button is correctly
disabled after clicking it. This prevents a user from clicking it
multiple times and being charged multiple times.
When paying with an existing payment token however the button was not
disabled and the user gets no feedback his request is being
processed. Charging an existing payment token takes a while (~5
seconds with Authorize) and so it's possible users will hit the button
multiple times.
This disables the button when reusing an existing payment
token. Additionally it now uses the correct font awesome icon (fa-lock
instead of fa-plus-circle).
opw-1981064
closesodoo/odoo#33196
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Python2 uses byte strings by default and python3 text string, so adapt
the code communicating with blackbox to still only use bytestring.
Also raspbian image has been updated in posbox 17 to Raspbian 9
(stretch) so ifconfig command returns has different format output (
`ether {MAC address}` instead of `HWAddr {MAC address}`) so the way we
get the MAC address is changed.
opw-1981839
closes#33150
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Install the 'Maintenance' app
- Create a maintenance request, set a day and a duration of 6 hours
- Go the calendar view, month mode
- Move the maintenance request from one day to another
The duration is changed with a non-sense value.
In month mode, the hours are not represented in the calendar so it is
not possible to compute the `date_delay`. Moreover, when a record is
moved from one date to another (`_onDropRecord`) in month mode, there is
actually no point recomputing the duration; the `date_start` is enough.
Note that `date_delay` is used (at the time of writing) in 2 views and
absolutely not tested.
opw-1984637
closesodoo/odoo#33193
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Have sections order lines on each Sale Order
Have multiple Sale Orders on which the action "invoice order" is triggered
(to make one invoice for all of them)
Before this commit, the real invoice lines were not under their respective
section line
This was because we kept the sequence of the order line when making the order line
which makes little sense in a case where we merge the orders
After this commit, the invoice lines are under their respective section
OPW 1985080
closesodoo/odoo#33219
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
ONLINE:
make an order, chose a customer, click on "invoice"
Make the payment, validate
Just **before** the request to download the pdf of the invoice
go OFFLINE
(to achieve this, just put a debugger before the do_action() fires, and kill the server)
Before this commit, the button validate on the payment screen stayed inactive forever
This was because the deferred representing the invoicing flow was still pending
After this commit, we handle the case to invite the waiter to print the invoice
from the backend
OPW 1972301
closesodoo/odoo#33188
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>