- Create 5 vendor bills with a long reference (> 1000 characters), for
the same partner.
- Select the bills and register a payment
An error arise: 'psycopg2.OperationalError: index row size 3256 exceeds
maximum 2712 for index "account_move_line_partner_id_ref_idx"'.
As mentioned, the index row size limit is 2712 bytes, which is exceeded
in that use case. Indeed, the reference of the payment is computed based
on the vendor reference of all bills.
We limit the number of characters to 2000. This seems reasonable knowing
that UTF-8 characters use sequences of 1 to 4 bytes [1]. Characters with
a code less than 128 require 1 byte only, and it is expected that most
vendor references will only use these characters. It is indeed unlikely
that special characters (such as Chinese characters, taking up to 4
bytes) are used for such references.
[1] https://tools.ietf.org/html/rfc3629
opw-1998823
closesodoo/odoo#33457
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Traceback generated when trying to pass a datetime object into a function tag
in xml.
<function name="action_name" model="model_name" eval="datetime.date.today"/>
Used to fail.
With this commit now one can pass time, datetime, timedelta, relativedelta,
version, ref, pytz in function tag in xml
Task-id: 1772614
Closesodoo/odoo#29212
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Dhaval Limbuwala <dli@odoo.com>
If destroy is called before start, there will be a crash before this commit.
At the time of this commit, this can be reproduced in master by dropping the
image gallery snippet, clicking on add images (double click, which opens the
media dialog twice for some reason), selecting 2 images to add on the
media dialog, and clicking on add. The error will be in the JS console.
closesodoo/odoo#33440
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Open a mail.compose.message wizard.
Select a template that generates an attachment.
Reselect it. A second attachment has been generated.
Can be repeated ad infinitum.
At template onchange, the template is rendered to overwrite the composers values
This includes the attachments.
Let L1 be the list of attachments generated by the template.
When _convert_to_write(values) is called with {'attachment_ids': L1},
it gets self.attachments_ids = L2, and generates a [(6, 0, L1 + L2)] command.
As a result attachments are only added,
the previous ones need to be removed manually.
Since c6d718f, the semantics of _convert_to_write changed.
Before, it always returned an empty list for new records (without an id).
In other words, wa always had L2 == [].
As a result we need to adapt the wizard to keep its old behaviour.
To solve it we bypass the _convert_to_write for 'attachment_ids' and directly
generate the 6 command with the list of ids L1 generated by the template.
We only do this for templates that add attachments to keep the templates
composable (a template only overwrites the values it defines).
Unfortunately, we don't have any way to know which attachments have been added
manually, so we can't preserve these (which was the old behaviour anyway).
opw 1997430
opw 1987169
opw 1998115
opw 1998782
closesodoo/odoo#33387
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
When multiple emails (`mail.mail`) are linked
to the same message (`mail.message`),
all the message notifications were being marked as sent
as soon as one of the mail was sent, and not all of them.
This is indeed possible to have multiple emails linked to a single
message, for instance when there are employees and customers in
the followers of a thread, and some must therefore have
the buttons meant for the employees ("Assign me") and some not.
In other words, it was possible notifications were marked
as sent while their associated email was not sent yet.
This revision also comes as an addition to
5d6656d739
as it was possible to receive a bounce coming from
the previous mail sent which wrote on the same notifications `email_status`
than the current message being sent before we could acquire the lock on
them (see commit message of the above mentioned revision),
as it was writing the `email_status` on more notifications that it
should have, including notifications of the previous email.
e.g
- Mail 1
- Message 1
- Recipient A, B, C
- Mail 2
- Message 1
- Recipient D, E
Let's say recipient A bounces
If the email notifying the bounce arrives during the processing of the "Mail 1",
it will be blocked until we release the lock on the `mail.notification` `email_status`
we acquire thanks to having written `exception` on `email_status` before sending the email.
But, as soon as it is unblocked (after the `cr.commit()`),
it will immediately re-attempt the delivery of the bounce email,
therefore writting "bounced" in `email_status` of recipient A,
while the transaction of the second email already began.
When the second email sending will try to write the `email_status`
of recipient A as well
(as it used to write the `email_status` on all the message notifications,
not just the one related to the current email),
it raised a concurrent update.
Therefore:
1. Interrupting the loop, as psycopg2 exceptions are raised and not passed,
2. Replay the sending of the second email a second time.
opw-1984293
closesodoo/odoo#33431
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Since cdca5d4751, the field company_id
on account.payment is not stored anymore, so, it doesn't make sense to be able to group on it
OPW 1998427
closesodoo/odoo#33428
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
If the smtp session was dead, it would lead the whole mail batch to fail.
opw 1949270
closesodoo/odoo#32424
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
closesodoo/odoo#33350
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
When an exception is raised during the course of a normal SMTP session,
smtplib's `sendmail()` method will close the channel automatically,
so any further attempt at sending SMTP commands will fail with an
SMTPServerDisconnected error, even just calling `smtp.quit()`.
This will shadow the original error, and make debugging harder.
Fixes#1493
Having :
- a pricelist with 10% of discount for all the products.
- the discount policy in the pricelist set to : "Show public price &
discount to the customer"
- a product with negative price (ex : -$125)
- add the product in a SO with the 10% pricelist
Before this commit, the unit price was the price with the discount
already applied: -$112.5, and not the original price as expected; The
subtotal price was $101,25 (the discount is applied twice) which is
wrong.
Now, the unit price is -$112.5 as expected, in Odoo surcharge are always
included in the display price.
opw-1986582
closesodoo/odoo#33717
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
oe_view_nocontent_smiling_face does not exists in css
when using this classname, the smiling face does not appear
closesodoo/odoo#33519
Signed-off-by: Christophe Simonis <chs@odoo.com>
When recreating the auto-generated view of user base.user_groups_view (e.g.
with a '-u base'), the view was generated in the language of the admin.
In case the database was in a different language than English, the source arch,
stored in database in arch_db field, was translated.
Instead, the source must be in English and translations must change the content
based on the user's language.
This was introduced at 894143cb4c as the view content was not translated.
At that time, the arch field was not translatable and the xml_translate mode
did not existed yet
Fixesodoo/odoo#33482closesodoo/odoo#33566
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
- Create a lead without Salesperson assigned
- Edit the lead, set a Salesperson => the Assignation Date is set
- Edit the lead, change the Salesperson
The Assignation Date is reset.
There is no reason to change the Assignation Date in the second case.
Indeed, in many cases the Salesperson is modified for a good reason
(e.g. the first person left the company). From a customer perspective,
that doesn't change anything: he was always in contact with a
salesperson and the lead was handled. Moreover, the reporting becomes
incorrect.
We only change the Assignation Date if no Salesperson was assigned.
opw-2001912
closesodoo/odoo#33640
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create a SO for a stockable product
- Validate the SO
- Change the 'Delivery Address'
Nothing warns the user that the address was not changed on the
corresponding pickings.
opw-2002084
closesodoo/odoo#33636
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Usecase to reproduce:
- Install stock, mrp, purchase
- Go on warehouse form view
- Click on Routes button
Either one of the route manufacture or buy is missing.
All implementations/overrides of stock.warehouse._get_all_routes()
call their parent's implementation of get_all_routes_for_wh().
which is a reference to stock.warehouse._get_all_routes() but that means
that the route 'mixin' behavior can be skipped.
(the reference is to the base implementation of _get_all_routes())
Fixes#33286Fixes#33288
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
When website_customer is not installed, some endpoints are not handled
by the router, causing the following tests to fail:
- test_10_crawl_public
- test_20_crawl_demo
- test_30_crawl_admin
Those tests were failing due to /customers responding with 404.
Indeed, the route /customers is defined in website_customer, but had
some usage within website_crm_partner_assign, causing tests to fail when
the former module is not installed.
The new behavior can be explained as follows:
- module website_crm_partner_assign on its own will lose the hyperlink.
- module website_customer will now inherit the view definition in order
to wrap the targeted HTML text elements with an anchor tag.
Closes#33344
Signed-off-by: Christophe Simonis <chs@odoo.com>
Purpose: filter product by location of warehouse failed due to the
control panel refactoring (odoo#29106). This commit fix the way the
product quantities are computed when location/warehouse into filter
context.
Task:1941639
Co-Authored-By: Martin Geubelle <mge@odoo.com>
closesodoo/odoo#31316
Signed-off-by: Simon Lejeune (sle) <sle@openerp.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>
resolve_2many_commands() is bugged and returns different outputs for new
vs existing records. It is to be removed, so it is replaced with a call
to new()
closesodoo/odoo#33222
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Before this fix, in 12.3, with taxes affecting subsequent taxes' base, tax_ids was used to store the taxes whose tax lines impacted current tax line's base. Before 12.3, this field was used to store the taxes whose base line has to be impacted by the current tax line.
This old behavior was changed by mistake. We restore it for consistency.
closesodoo/odoo#33471
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>