- Sep 08, 2023
-
-
Richard deMeester authored
There is code to block the UOM changing if there are done moves. Because it searches in non-sudo mode, it does NOT currently stop you changing the UOM if the product has moves in a different company. closes odoo/odoo#134780 X-original-commit: 42674464 Signed-off-by:
Tiffany Chang (tic) <tic@odoo.com>
-
std-odoo authored
Bug === When we enrich a partner we don't have access to, it will try to read it, but because of the ACL if will crash. To fix that issue, we don't return the partner if we can't access it and we show an error message in the UI instead of letting it crash. Task-3344536 closes odoo/odoo#134767 Signed-off-by:
Thibault Delavallee (tde) <tde@openerp.com>
-
Adrien Widart (awt) authored
When getting the available quantity of a product, it is possible to specify the warehouse and/or the location in the context. However, it does not correctly work. For instance, if we provide the stock location ID (8) and the warehouse ID (1): we first use the view location of the warehouse, and we then get the intersection between this view location and the provided locations: nothing. In such case, we should keep the stock location. Few other examples are given in the test. OPW-3450169 closes odoo/odoo#134680 Signed-off-by:
William Henrotin (whe) <whe@odoo.com> Co-authored-by:
Simon Schmid <simon.schmid@braintec.com>
-
Mathieu Walravens authored
Before this commit: Packages were computed using a for loop, skipping any picking without any packages. After this commit: Packages are computed using a read_group, speeding up the computed method for large pickings with hundreds of stock move lines. opw-3461706 closes odoo/odoo#134556 X-original-commit: 8dcad6e4 Signed-off-by:
Arnold Moyaux (arm) <arm@odoo.com> Signed-off-by:
Walravens Mathieu (wama) <wama@odoo.com>
-
- Sep 07, 2023
-
-
Arnaud Joset authored
Before this commit, simple user could not use the novatim API since https://github.com/odoo/odoo/commit/160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa closes odoo/odoo#134715 Taskid: 3497580 X-original-commit: 43763618 Signed-off-by:
Arnaud Joset (arj) <arj@odoo.com>
-
Hardik Prajapati authored
When creating a record from the menu named 'Coupon programs' - Before fix: value of 'promo_code_usage' is blank - After fix Value of 'promo_code_usage' is 'code_needed' OPW-3460238 closes odoo/odoo#134350 Signed-off-by:
Victor Feyens (vfe) <vfe@odoo.com>
-
Julien Van Roy authored
Add IEPS taxes and tax groups. Make sure the IEPS taxes are `include_base_amount` and have a lower sequence than the IVA taxes. Unify the names of the taxes and their labels on invoice. Resequence the taxes to group them by nature. task-3100679 closes odoo/odoo#134574 X-original-commit: 734e18eb Signed-off-by:
Laurent Smet (las) <las@odoo.com> Signed-off-by:
Julien Van Roy (juvr) <juvr@odoo.com>
-
Walid authored
Steps to reproduce: - Enable multistep routes (3 steps delivery) - Create a new storable product (0 on hand quantity) - Confirm an SO with that product Bug: forecast button is correctly red on the SO line but it's green on the stock pickings Fix: button should be green if it's possible to reserve quantity red otherwise opw-3440627 closes odoo/odoo#134335 Signed-off-by:
Quentin Wolfs (quwo) <quwo@odoo.com>
-
tsm-odoo authored
Before this commit, the push to talk key combination was wrongly detected. Indeed, it was dependent on which key was pressed first. Steps to reproduce: - Register "ctrl + alt" as the push to talk key - Press control then alt, push to talk does not work - Press alt then control, push to talk works - If you unpress the alt key, the push to talk will stop as expected - If you unpress the control key, the push to talk will keep going This commit fixes the issue. closes odoo/odoo#134639 Signed-off-by:
Thanh Son Dodeur (tso) <tso@odoo.com>
-
Adrien Widart (awt) authored
To reproduce the issue: 1. In Settings, enable: - Multi-Routes 2. Unarchive the route MTO 3. Create three storable product P1, P2, P3: - P2: - With route MTO 4. Create and confirm a MO: - Product: P1 - Components: - 1 x P2 - 1 x P3 - 1 x P3 5. Set the produced/consumed quantities: - For P2, set 1.5 6. Mark the MO as done Error: an error message is displayed: "Record does not exist or has been deleted." In `SM._action_done`, we create some extra moves: https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/stock/models/stock_move.py#L1705-L1710 Because of the exceed quantity on the first components line, we create a new SM (qty 0.5). There is a difference between both SM: the `procure_method` (MTO for the initial SM, MTS for the new one). Because of that difference, when confirming the new SM, we don't provide any `merge_into` (the `else` block): https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/stock/models/stock_move.py#L1684-L1690 Confirming the new SM leads to the `_merge_moves` method. In this method, because we didn't provide any `merge_into`, we first try to get some candidates: https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/stock/models/stock_move.py#L866-L868 And at that point, we will provide with all components SMs: https://github.com/odoo/odoo/blob/e029abe649573350e633999e42ab040c57b8fe4e/addons/mrp/models/stock_move.py#L494-L497 So, we will also provide the two SM of C02. Therefore, the method will merge these SMs and unlink the second one. Then, back to the extra moves creation in `SM._action_done`, the for loop will iterate on the deleted record, hence the error. OPW-3454899 closes odoo/odoo#134632 Signed-off-by:
William Henrotin (whe) <whe@odoo.com>
-
Adrien Widart (awt) authored
To reproduce the issue: 1. In Settings, enable: - Storage Locations - Package 2. Create a product P - Type: Storable - Tracked by SN 3. Process a receipt with 1 x P, serial S 4. Return P in a package 5. Process a new receipt with 1 x P, still S as SN Error: An error is displayed "The serial number has already been assigned [...]". This is incorrect, the user should be able to receive that SN. After step 3, there exists a quant Q1: -1 x P at Supplier Location with S. Then, after step 4, a new quant Q2 is created: 1 x P at Supplier Location with S and the package. Because the field `package_id` is not the same on Q1 and Q2, both quants are not merged. As a result, step 5, we will update Q1 and have -2 x P at Supplier Location with S. This will trigger the constraint, hence the error message. OPW-3390615 closes odoo/odoo#134478 Signed-off-by:
William Henrotin (whe) <whe@odoo.com>
-
Michael Tietz authored
Backport from version 16.0 of _get_default_amls_matching_domain To decrease the amount of account.move.lines which should be reconciled Exclude amls of payment move lines where the account is configured as receivable or payable closes odoo/odoo#134535 X-original-commit: 8b711569 Signed-off-by:
Olivier Colson (oco) <oco@odoo.com>
-
hmai authored
Steps to reproduce: 1. add a paragraph 2. add a blockquote => the cursor will jump in the paragraph This commit fixes a bug detected when inserting a blockquote. The cursor jumps to nearby paragraph on insert, and other issues. The cause of the bug is tied to the fact that we rely on a complex behavior when inserting paragraph related elements (within the insert command). The way to make blockquote behave like the other paragraph related elements is simply to add it to the list as done in this commit. Task-3383441 closes odoo/odoo#130829 Signed-off-by:
David Monjoie (dmo) <dmo@odoo.com>
-
- Sep 06, 2023
-
-
Saurabh Choraria authored
When a user tries to import the CSV file with a different separator at that time, the values in mapper and rows_to_import are not correctly mapped. So the traceback will be generated. Steps to reproduce: 1. Click on import in the bank statement. 2. Select any CSV file for the bank statement line or can download and import this file https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link 3. Select any separator other than a comma. 4. Click on the test or Import button. 5. Error will occur. Error: IndexError: list index out of range. To solve this issue, a row's length is checked with the number of fields. sentry-4021250095 closes odoo/odoo#131153 Signed-off-by:
Achraf Ben Azzouz (abz) <abz@odoo.com>
-
Preksha Chouhan authored
When user access template at the time of export with deleted field. The traceback will be generated. To reproduce the issue(any model, here- 'account.move.line'): - Install 'account_accountant' module - Go to Settings > Technical > Database Structure > Fields - Create a new field with model as 'Journal Item' and save - Go to Accounting > Miscellaneous > Journal Items - Select any record in list view and click on export and generate a new export template with newly created field - Go to 'ir.model.fields' and delete that field - Go to 'Journal Items' and select that template while export Error: A traceback appears: KeyError: 'tax_audit' When a field gets deleted from 'ir.model.fields' but it does not get deleted from export template. And selecting that template to export the records will lead to traceback. See - https://github.com/odoo/odoo/blob/59669e9943158e51dcbb9ae69ad758df8f7c7976/addons/web/controllers/main.py#L1815-L1818 sentry-4331986723 closes odoo/odoo#134275 X-original-commit: 814fb43e Signed-off-by:
Julien Castiaux (juc) <juc@odoo.com>
-
Arnaud Joset authored
Before this commit, the useragent was harcoded as an Odoo one and if it was blacklisted by the osmfoundation policy https://operations.osmfoundation.org/policies/nominatim/ all Odoo instances were forbidden to access the service. This parameter allows to override the user agent with a system parameter. closes odoo/odoo#134276 X-original-commit: 160e8bfb Signed-off-by:
Yannick Tivisse (yti) <yti@odoo.com> Signed-off-by:
Arnaud Joset (arj) <arj@odoo.com>
-
- Sep 05, 2023
-
-
Abderraouf Ghrissi (abgh) authored
Before this commit: - There is a bug in odoo enterprise. project.project form view > invoicing notebook > services created using create and edit should be configured by default with an 'invoicing policy' set to 'based on timesheets'. Technically, while we're using 'default_service_policy' with the right value, we're getting a different value in the form. After this commit: - The bug is fixed. closes odoo/odoo#134360 X-original-commit: fa034b2a Signed-off-by:
Xavier Bol (xbo) <xbo@odoo.com>
-
Maitri Patel authored
This error occurs when recurrence_id has no records when the user tries to delete the sync calendar which has recurrent events. Error: 'Expected singleton: calendar.recurrence()' See- https://github.com/odoo/odoo/blob/15.0/addons/calendar/models/calendar_event.py#L715 sentry-4367276387 closes odoo/odoo#131155 Signed-off-by:
Arnaud Joset (arj) <arj@odoo.com>
-
Jinjiu Liu authored
Reproduction: 1. Install Event, Sales, Website, Contacts 2. Login as Admin, create a new portal user 123, set the password as 123 3. Go to Contacts, find the created user, add a shipping address, leave the name blank 4. Open another tab login as the portal user, place an order 5. At the Address step, Edit the billing address, change the name from empty to “Test Name”, click next 5. An error is thrown cause the new name is not equal to empty value Fix: this fix aimed the conditions we have in the previous PR: https://github.com/odoo/odoo/pull/111708 This change will allow the user to add a name for shipping address at checkout.Without the fix, if you change the name of a shipping address, it won’t be able to get through. This is because of how we manage the shipping address, e.g. shipping address is managed as child partners. For shipping address, the check can_edit_vat is always false. See here: https://github.com/odoo/odoo/blob/14.0/addons/portal/models/res_partner.py Another check, e.g. if shipping is being edited, is added to make sure name/email can be changed for delivery address. For internal user, the editing of shipping address is not blocked because of the `share` check. But the same condition is used to ensure the consistency in case we change how the shipping address is managed in the future. Note: if the data is '' for name for example, the pre-process will convert it to `False`. Thus the edge case that `'' != False` doen't exist anymore Related PR: https://github.com/odoo/odoo/pull/111708 opw-3126325 closes odoo/odoo#134328 X-original-commit: 38ca3917 Signed-off-by:
Antoine Vandevenne (anv) <anv@odoo.com> Signed-off-by:
Jinjiu Liu (jili) <jili@odoo.com>
-
Yann Papouin authored
`read_group` signature is not respected: the offset integer param is filled with a list closes odoo/odoo#134265 X-original-commit: d805521d Signed-off-by:
Xavier Bol (xbo) <xbo@odoo.com>
-
Andrea Grazioso (agr-odoo) authored
Set Default UoM on Timesheet Settings page: Hours Set [Employee] Timesheet Cost (HR Settings tab): 65.00/hour Create a product [TEST] as follows: - Product type: service - Invoicing Policy: Based on Timesheets - Create on Order: Project & Task - Unit of Measure: Days - Purchase UoM: Days - Sales Price: 1.00 - Cost: 0.00 Create a sales order Add an order line with product [TEST], quantity 1 Confirm. Project and task will be created On the task add a 1 hour timesheet entry for [Employee] Save and go back to the SO Issue: SO line cost is incorrectly computed. opw-3378688 closes odoo/odoo#133448 Signed-off-by:
Xavier Bol (xbo) <xbo@odoo.com>
-
tsm-odoo authored
Before this commit, the push to talk key was not correctly captured. Indeed, Alt/Control/Shift/Meta was condifered twice when present, resulting in an incorrect HotKey registration. Steps to reproduce: - Go a discuss channel - Access the call setting menu - Try to set your push to talk key to "Ctrl + Alt" - The HotKey is incorrect ("Ctrl + Alt + Alt"). task-3058665 closes odoo/odoo#134248 Signed-off-by:
Alexandre Kühn (aku) <aku@odoo.com>
-
Adnan Saiyed authored
Current behaviour before commit: -When pasting copied content from editor inside link inserts text with HTML content, in result the pasted content seems isolated from the link. e.g. <a href="#">te[]st</a> + pasting <h1>123</h1> <=> <a href="#">te<h1>123</h1>st</a> Desired behaviour after commit: -Now only text content is pasted which makes pasted content as a part of the link. e.g. <a href="#">te[]st</a> + pasting <h1>123</h1> <=> <a href="#">te123st</a> closes odoo/odoo#125776 Signed-off-by:
David Monjoie (dmo) <dmo@odoo.com>
-
- Sep 04, 2023
-
-
prye-odoo authored
When a user tries to create a leave request without linking an employee with the user and without a configured login user timezone, a traceback will be generated. Steps to reproduce: - Install the "hr_holidays" module. - Create a new user, e.g., "Test user", and login with another browser. - Login as an admin user and go to Settings > Users & Companies. - Search for "Test user" and set Timzone as empty. - Go to the Time Off menu and create a leave request; after that, a traceback will be generated. Error: AttributeError: 'bool' object has no attribute 'upper' When a user tries to create a leave request without linking an employee with the user and without a configured login user timezone, the _get_start_or_end_from_attendance() function of the "hr.leave" object will call at that time timzone not getting. Code reference: https://github.com/odoo/odoo/blob/15.0/addons/hr_holidays/models/hr_leave.py#L111 Sentry-4441512696 closes odoo/odoo#133955 Signed-off-by:
Sofie Gvaladze (sgv) <sgv@odoo.com>
-
Nicolas Bayet authored
Before this commit, when the browser was offline and when an attempt to make a RTCPeerConnection was made, a traceback was raised by firefox: > InvalidStateError: Can't create RTCPeerConnections when the network is > down This commit prevents the creation of the RTCPeerConnection when the browser is offline. task-3186872 closes odoo/odoo#133770 Signed-off-by:
David Monjoie (dmo) <dmo@odoo.com>
-
utag-odoo authored
Steps to reproduce: 1. Go to the website 2. Add website languages 3. Drag Table Of Content 4. Select snippet block 5. Go to customize the block 6. Select visibility conditionally - set visible/hide for languages. Before the commit, selecting block visibility conditionally makes only the block is invisible but not the navbar content is invisible due to the absence of the `data-visibility-id` attribute. In this commit, handling conditional visibility of the navbar when the the snippet block is invisible. Also, This PR addresses an issue where a scroll bar was appearing on `list-group-item` elements in Bootstrap 4.1.3. The scroll bar was caused by the CSS property `margin-bottom: -1px;`. task-3373943 closes odoo/odoo#126705 Signed-off-by:
Romain Derie (rde) <rde@odoo.com>
-
Odoo's Mergebot authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. RATIONALE Two main use case of corner case usage of 'email' fields are tested in this PR and their support is improved * formatted emails: `"Full Name" <email@domain.com>` stored into the 'email' field; * multi emails: `email1@domain.com, email2@domain.com` stored into a single 'email' field; IMPLICATION Email field is generally managed as "containing a valid email". This means it is sometimes used as it in 'formataddr' as well as to perform searches or identification checks. Example of issue: partner 'Raoul' has a formatted email like "Raoul" <raoul@raoul.fr>. Using 'formataddr' in email_from leads to from: "Raoul" <"Raoul" <raoul@raoul.fr>> -> which is incorrect (but often dynamically corrected by email servers); Email field holding multi-emails are not normalized, as current normalize is done only if the field holds a single email. It means * no easy finding based on 'email_normalized', e.g. various tools like '_mail_find_partner_from_emails' or 'find_or_create' do not find partners based on this email; * no exclusion list management; * issue with formatting, like to: "Raoul" <raoul@raoul.fr,raoul.other@raoul.fr> -> which is incorrect (but often dynamically corrected by email servers); USAGE: OUTGOING EMAILS Those use cases currently generate faulty outgoing emails. This is valid for recipients ('email_cc', 'email_to') as well as author ('email_from'). For formatted emails: `email_to` is formatted again based on name and email which leads to sending emails to `"Full Name" <"Other"<email@domain.com>>`. Note that multi emails without formatting may work as it leads to email_to `"Full name" <email1@domain.com,email2@domain.com>`. Some outgoing email servers correctly send multiple emails. It depends on their fault tolerance. USAGE: FIND BASED ON EMAIL (NORMALIZED) When searching for partners (e.g. using '_mail_find_partner_from_emails' or 'find_or_create') normalized version of input is used. In case of multi emails sanitize is 'False', as normalization expects a single email in the field. Therefore no partner is found. In processes that do a "search or create" (e.g. using a template on a record) this leads to creating a new partner (or several partners in case of multi emails) each time. USAGE: OTHER FLOWS Other flows are build on top of '_mail_find_partner_from_emails' / 'create' of outgoing emails and are impacted by formatted email / multi email usage. Those include notably * mass_mailing: '_message_get_default_recipients' should be defensive to give correct values when creating mailing emails; * mass_mailing: faulty emails is based on normalize and multi-emails are considered as faulty and ignored; * after post hook: '_message_post_after_hook' tries to link messages without author (but email_from) with newly-created partners, when partners are created from chatter. It is therefore impacted by those corner cases; * marketing_automation: built on top of mass_mailing and suffers from the same issues; USAGE: UNICODE Unicode in emails should be supported. 'formataddr' and IrMailServer notably received fixes to support unicode. Some check performed on email addresses fail when unicode is involved, which leads to some emails not being sent while they could. USAGE: WRONG EMAIL FORMATTING With input 'name email@domain.com' (missing chevrons allowing to clearly spot the email part) 'getaddresses' returns ('', 'name email@domain.com) i.e. the whole input is considered as being the email. To improve the heuristic we can add a fallback by recalling 'getadresses' on the input with spaces replaced by commas when it found only an email and no name. The new email will be split into sub pairs allowing to find the real email and various name parts, allowing to make a new name / email pair. Emails should not contain spaces thus this is coherent with email formation. This fallback actually comes from a specific code done in '_parse_partner_name' of Partner model. Supporting it directly at tools level make the behavior coherent for all models. SPECIFICATIONS This PR contains first tests to cover current support of those use cases. Then we gradually improve support of multi-emails and formatted emails in various layers of mail code, from mail.mail to mass_mailing or email formatting. See individual commit for more explanation, each of them solving a specific issue / use case. Task-2612945 (Mail: Defensive email formatting) closes odoo/odoo#133958 Forward-port-of: odoo/odoo#74474 Related: odoo/enterprise#46698 Signed-off-by:
Thibault Delavallee (tde) <tde@openerp.com>
-
Thibault Delavallée authored
Formatted emails using our own formataddr contains quotes to correctly separate name from emails, like'"Name" <email@domain.com'. However JS parse function does not correctly handle quotes, assuming everything being left of opening chevron is the name. Task-2612945 (Mail: Defensive email formatting) Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
With input 'name email@domain.com' (missing chevrons allowing to clearly spot the email part) 'getaddresses' returns ('', 'name email@domain.com) i.e. the whole input is considered as being the email. To improve the heuristic we can add a fallback by recalling 'getadresses' on the input with spaces replaced by commas when it found only an email and no name. The new email will be split into sub pairs allowing to find the real email and various name parts, allowing to make a new name / email pair. Emails should not contain spaces thus this is coherent with email formation. This fallback actually comes from a specific code done in '_parse_partner_name' of Partner model. Supporting it directly at tools level make the behavior coherent for all models. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@b2f3f0f3e13cef993541bcd093e61ffbb6a8c92e Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS As of rfc5322 section 3.4.1 local-part is case-sensitive. However most main providers do consider the local-part as case insensitive. With the introduction of smtp-utf8 within odoo, this assumption is certain to fall short for international emails. We now consider that * if local part is ascii: normalize still 'lower' ; * else: use as it, SMTP-UF8 is made for non-ascii local parts; Concerning domain part of the address, as of v14 international domain (IDNA) are handled fine. The domain is always lowercase, lowering it is fine as it is probably an error. With the introduction of IDNA, there is an encoding that allow non-ascii characters to be encoded to ascii ones, using 'idna.encode'. Also remove usage of 'email_re' in mailing email check. It is too restrictive compared to real formatting we support (or try to). Valid outgoing emails were directly canceled, notably when containing unicode. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@a70327daaf3b88af887f657c222222e7baec29c1 Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS: MAIL COMPOSER IN MAILING When using the composer with a mailing, it currently skips recipients whose email is a multi-email due to the strict usage of 'email_normalize'. We can improve multi-email support by effectively checking for the first email found, using the "less strict" mode of normalize. It means more emails are detected as valid, and therefore sent. Due to lower support of multi-emails when sending emails, this even allows to send multiple emails as all emails are mailed. SPECIFICATIONS: DEFAULT RECIPIENTS Mailings are generally done using default recipients, aka using a model method that returns the people to mail: customers ('partner_id'), customer emails ('email_from'), specific implementation, ... This is implementation using '_message_get_default_recipients' that returns 'partner_ids', 'email_to' and 'email_cc' that are then used in the mail composer to generate final recipients. In this commit we better handle the content of email fields to avoid issues with multi-emails. For that purpose we correctly split the content of those fields. We now have several 'email_to' for records having multi-emails instead of a single badly-formatted 'email_to'. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@516ccbc9e716b887cbf712c72af37fd2a3c7dbe9 Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS Post-message hook is used in various apps to link records to a newly created created partner. This is the case notably when used with a template as it creates partner on the fly based on emails to always handle partners. We now check either the complete 'email', either the normalized version of it to avoid comparison issues with multi emails and formatted emails. As 'email_normalized' now supports multi-emails by storing the first found one it helps finding the partner. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@62f28f1b898ff9f37bb74345a814e83b37386181 Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS Tool method '_mail_find_partner_from_emails' that searches for partners based on email is improved to support multi-emails input. Instead of skipping multi-email (current behavior of 'email_normalize') we now consider first found email in the input. It is used notably to match incoming email / partners or suggest recipients in Chatter. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@b8458b092089245c5123f272e4b772beb9b387ed Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS When having multi-emails input in an email field, 'email_normalized' field is currently 'False', as they expect the field to contain a single email. This has several drawbacks * searching partners or fetching information based on emails does not work as most tool methods use 'email_normalized' which is False (see e.g. '_message_partner_info_from_emails', '_mail_find_partner_from_emails' or 'find_or_create'); * blacklist is not available as it is based on 'email_normalized'; * mass_mailing wrongly considers those emails as invalid and cancel their mail and related trace, as it tries to skip sending emails to invalid emails; Be more defensive and use first found email in case of multi-emails field. Other emails are ignored. It is already an improvement that does not break flows in stable and allow more emails to be sent. before -> email: '"Raoul" <raoul1@raoul.fr>, raoul2@raoul.fr' -> email_normalized: False after -> email: '"Raoul" <raoul1@raoul.fr>, raoul2@raoul.fr' -> email_normalized: raoul1@raoul.fr A side effect is that it helps finding back some partners, as indicated in tests where less phantom partners are created. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@bafc060f639539475abf06221ab590637e6fb8dc Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS When building the final 'from' of outgoing emails using 'formataddr' we have issues if email contains multi emails or formatted email. Having a wrongly formatted email in 'email_from' leads to issues as it is badly recognized by email providers, could be considered as being phishing and also breaks reply_to mechanism. Main fix of this commit is to extract emails and rebuild the 'email_from' based on found emails. 'from' of sent emails is now the first found email in 'email_from' field of related <mail.mail> record like -> before: email_from: '"Raoul" <raoul@raoul.fr>, raoul2@raoul.fr' -> after: email_from: '"Raoul" <raoul@raoul.fr>' and raoul2 is ignored Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@441746d0119b72125b0338f5cfb97db0b10c399c Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS When possible, use 'email_formatted' field on partner, instead of calling 'format_addr'. That way management of corner case input (multi emails and double encapsulation) is managed by the computed field itself. When 'format_addr' has to be used, ensure email part is normalized to avoid formatting issues. Also use tools to extract emails instead of 'email_re' regex when possible. That way all code extracting and managing emails go through the same stack. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@9ef715fb994564af9e933ba31933a09eca97c24f Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS When building the final 'email_to' of outgoing emails using 'formataddr' we have issues if email contains multi emails or formatted email. Main fix of this commit is to extract emails and rebuild the 'email_to' list based on found emails. E.g. partner Raoul - email: "Raoul" <raoul@raoul.fr> -> before: to: "Raoul" <"Raoul" <raoul@raoul.fr>> (double format) -> after: to: "Raoul" <raoul@raoul.fr> E.g. partner Raoul - email: raoul1@raoul.fr, raoul2@raoul.fr -> before: to: "Raoul" <raoul1@raoul.fr, raoul2@raoul.fr> single email with multiple emails, depends on server fault tolerance) -> after: to: "Raoul" <raoul1@raoul.fr>, "Raoul" <raoul2@raoul.fr> multi emails Fix that computation by using all normalized emails found in 'email' fields and rebuilding a formatted email based on name + those emails. We do not use `email_formatted` as it is not really multi-enabled. We prefer a local defensive approach to be as tolerant as possible with respect to user inputs. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@0058013c86231fc608f1324bc03586e3764760fe Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
PURPOSE Be defensive when dealing with email fields, notably when having multi-emails or email field containing an already-formatted email. SPECIFICATIONS Main fix in this commit: fix multiple nested formatting in 'email_formatted' computation for <res.partner>. Other use cases are mainly left untouched as we let users deal with their input. In summary : * double format: if email already holds a formatted email, we should not use it to compute email_formatted, like name: Name / email: 'Format' <email@domain.com> -> before '"Name" <"Name" <email@domain.com>>" -> after '"Name" <email@domain.com>'' * multi emails: sometimes this field is used to hold several addresses like email1@domain.com, email2@domain.com. We currently let this value globally untouched by extracting emails and joining them, as we do not expect email_formatted to be a list of emails. Extractin emails allows to filter out extra text stored in email field, like name: Name / email: text, email1@domain.com, email2@domain.com -> before: "Name" <text, email1@domain.com, email2@domain.com> -> after: "Name" <email1@domain.com,email2@domain.com> * invalid email: if something is wrong, better keep it in email_formatted than harcoding "False". Indeed this eases management and understanding of failures at mail.mail, mail.notification and mailing.trace level. This behavior does not change as it was already implemented like that even if not sure it was intended; Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@853bb98b81bcc6376c7f468391643306aea25d99 Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
When having several possible emails to contact the first one is saved on the trace model. Indeed a trace is normally linked to a unique recipient but in case of multi-emails in an email field, several emails are available. This commit ensure computation keeps the original mail_to when making emails adresses uniques before sending mails and creating traces. Followup of odoo/odoo@213d5d396c811d8e07ce928c0d31a7f47756a644 Task-2612945 (Mail: Defensive email formatting) Part-of: odoo/odoo#133958
-
Thibault Delavallée authored
This method is still not really tested, except its override of 'mail.thread.cc'. So better have a test, especially in CRM that has some specific overrides. Formatted email and multi-email input are tested, to check their current support. Next commits will try to improve that, notably avoid formatting issues. Task-2612945 (Mail: Defensive email formatting) X-original-commit: odoo/odoo@340c362798b1cdb2ddb171de385bca45677724af Part-of: odoo/odoo#133958
-