Monday, January 11, 2021
15 changes · master
Miscellaneous changes
Steps to reproduce the bug: - Go to Accounting>Configuration>Journals - Create a new bank journal J Bug: Impossible to select a bank account. PS: In some cases, default_account_id with a different default_account_type are needed Example for Bank journal, accounts with type Credit Card are needed. opw:2424109 Forward-Port-Of: odoo/odoo#63895
Original PR description
Steps to reproduce the bug: - Go to Accounting>Configuration>Journals - Create a new bank journal J Bug: Impossible to select a bank account. PS: In some cases, default_account_id with a different default_account_type are needed Example for Bank journal, accounts with type Credit Card are needed. opw:2424109 Forward-Port-Of: odoo/odoo#63895
Fine tuning of 78286851034b8f3ef4dcab78e50b7220c0bdd213 The link to view Cash Statements on the dashboard openned the wrong action. Also in some cases, removing the context key `search_default_journal` was not enough so we set it to `False` instead. closes #64118 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64130
Original PR description
Fine tuning of 78286851034b8f3ef4dcab78e50b7220c0bdd213 The link to view Cash Statements on the dashboard openned the wrong action. Also in some cases, removing the context key `search_default_journal` was not enough so we set it to `False` instead. closes #64118 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64130
Steps: - Install accounting - On the dashboard, try to upload an "encrypted" PDF like this one https://launchpadlibrarian.net/24827090/DS-0157.pdf Bug: Traceback: PyPDF2.utils.PdfReadError: file has not been decrypted Explanation: In 13.0, these errors were caught in a catch all `except` as shown here: https://github.com/odoo/odoo/blob/4e089041252c25cc197a30f9e285d82f7162d809/addons/account_facturx/models/account_move.py#L303-L328 From this SO comment: https://stackoverflow.com/que
Original PR description
Steps: - Install accounting - On the dashboard, try to upload an "encrypted" PDF like this one https://launchpadlibrarian.net/24827090/DS-0157.pdf Bug: Traceback: PyPDF2.utils.PdfReadError: file has…
Steps: - Install accounting - On the dashboard, try to upload an "encrypted" PDF like this one https://launchpadlibrarian.net/24827090/DS-0157.pdf Bug: Traceback: PyPDF2.utils.PdfReadError: file has not been decrypted Explanation: In 13.0, these errors were caught in a catch all `except` as shown here: https://github.com/odoo/odoo/blob/4e089041252c25cc197a30f9e285d82f7162d809/addons/account_facturx/models/account_move.py#L303-L328 From this SO comment: https://stackoverflow.com/questions/52047944/pdfbox-extracting-blanks-from-pdf-encrypted-with-no-password#comment91054285_52047944 > A PDF can be encrypted with two passwords: a user password and an owner password. When a PDF is encrypted with a user password, you can't open the document in a PDF viewer without entering that password. When a PDF is encrypted with an owner password only, everyone can open a PDF without that password, but some restrictions may be in place. From time to time, we get a PDF encrypted with an owner password. The content is still readable, but PyPDF2 fails because it thinks the PDF is encrypted. With this fix, we try to unwrap the PDF by providing an empty user password. This way, PyPDF2 thinks the content is now decrypted. However, PyPDF2 only supports decrypting versions 1 and 2 of the encryption implementation. If the version is different, we skip reading the attachments and carry on to allow the user to upload the document. opw:2375993 Forward-Port-Of: odoo/odoo#62557
When running the scheduler, if one of the concerned product is a kit, it will always generate a RfQ for the components, even if there are already enough of them. To reproduce the error: (Need purchase) 1. Create 2 products P and P_compo - Both must be storable products - P_compo must have at least one vendor 2. Go on P-product page 3. Add a reordering rule (e.g., min: 5 and max: 10) 4. Add a BoM - Must be a Kit - Add P_compo to components 5. Inventory > Operations > Run Sched
Original PR description
When running the scheduler, if one of the concerned product is a kit, it will always generate a RfQ for the components, even if there are already enough of them. To reproduce the error: (Need…
When running the scheduler, if one of the concerned product is a kit, it will always generate a RfQ for the components, even if there are already enough of them. To reproduce the error: (Need purchase) 1. Create 2 products P and P_compo - Both must be storable products - P_compo must have at least one vendor 2. Go on P-product page 3. Add a reordering rule (e.g., min: 5 and max: 10) 4. Add a BoM - Must be a Kit - Add P_compo to components 5. Inventory > Operations > Run Scheduler 6. Go to Purchase, find the generated RfQ 7. Confirm the order, Receive Products, Validate 8. Go on P-product's page - As you can see, you have enough P-products on hand 9. Repeat steps 5-6 => You should not find any RfQ since you already have enough P-products. When checking the P-product's page, you can see the correct quantity on hand because it uses the `_compute_quantities` method and this one has been overridden in the mrp-module so a kit will be correctly computed. However, when running the scheduler, it uses another method to get the current quantities: `_compute_quantities_dict`. Since this method has not been overridden in mrp-module, it will use the basic implementation and this one does not consider the possibility for a product to be a kit. This fix creates an override of `_compute_quantities_dict` so it can compute the correct quantities of products with 'phantom' as BoM type. Moreover, for the code to be simpler and clearer, thix fix also merges `_compute_quantities` and the new `_compute_quantities_dict`. OPW-2421841 Forward-Port-Of: odoo/odoo#64277 Forward-Port-Of: odoo/odoo#63891
Free reservation is called each time an extra quantity is used on a move (and for each immediate transfer). It means that the function is called many times on a database with an inventoy activity. Also _free_reservation method do a search on fields that are not indexed, and is slow on large database. This index is specific to _free_reservation. On a live database with an important stock, the queries dropped from 265ms to 1.5ms. Forward-Port-Of: odoo/odoo#64311
Original PR description
Free reservation is called each time an extra quantity is used on a move (and for each immediate transfer). It means that the function is called many times on a database with an inventoy activity. Also _free_reservation method do a search on fields that are not indexed, and is slow on large database. This index is specific to _free_reservation. On a live database with an important stock, the queries dropped from 265ms to 1.5ms. Forward-Port-Of: odoo/odoo#64311
Commit c2c9d6d143 changed the inequality sign unintentionally. This commit change it to the right value Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64275
Original PR description
Commit c2c9d6d143 changed the inequality sign unintentionally. This commit change it to the right value Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64275
When sending several invoices, customers also receive those that do not concern them. To reproduce the error: (Need mailcatcher) 1. Go to Invoicing 2. Select two invoices - Status must be "Posted" - Customers must be different 3. Action > Send & Print 4. Uncheck "Print", then click on "Send" 5. Repeat 2-4 Err: Each customer receives both invoices. (In some cases, a third mail is event sent). Each customer must receive his own invoices. The mail composer wasn't correctl
Original PR description
When sending several invoices, customers also receive those that do not
concern them.
To reproduce the error:
(Need mailcatcher)
1. Go to Invoicing
2. Select two invoices
- Status must be "Posted"
- Customers must be different
3. Action > Send & Print
4. Uncheck "Print", then click on "Send"
5. Repeat 2-4
Err: Each customer receives both invoices. (In some cases, a third mail
is event sent). Each customer must receive his own invoices.
The mail composer wasn't correctly configured.
OPW-2422117
Forward-Port-Of: odoo/odoo#64314This commit updates owl from v1.2.0 to v1.2.1 See [1] for the list of changes. [1] https://github.com/odoo/owl/commit/25738a1bf08ff47b2d8cb7b7c57d3bf4a7e1caa7 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64267
Original PR description
This commit updates owl from v1.2.0 to v1.2.1 See [1] for the list of changes. [1] https://github.com/odoo/owl/commit/25738a1bf08ff47b2d8cb7b7c57d3bf4a7e1caa7 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64267
STEPS: * configure rounding: - cash_rounding=True - only_round_cash_method=True - round method: 1.0 Down * open a session * add products with subtotal in decimals (such as 6.35) * select Bank payment method and process the order BEFORE: error "You have to round your payments lines" AFTER: order is processed and marked as paid --- https://github.com/odoo/odoo/commit/42425996e36d9cb1fc1391402cf6d00df4aea019 opw-2426027 Description of the issue/feature this PR address
Original PR description
STEPS: * configure rounding: - cash_rounding=True - only_round_cash_method=True - round method: 1.0 Down * open a session * add products with subtotal in decimals (such as 6.35) * select Bank payment method and process the order BEFORE: error "You have to round your payments lines" AFTER: order is processed and marked as paid --- https://github.com/odoo/odoo/commit/42425996e36d9cb1fc1391402cf6d00df4aea019 opw-2426027 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#64270
Clicking on save on html editor is taking quite some time. The user might think something is not happening and need to click again. If he does click again, 2 write RPC will be sent, making the COW business code being triggered twice, ultimately leading to create 2 COW. Instead of ``` A / \ B B' ``` It will be ``` A / | \ B B' B' ``` With as many B' than there is click on save. This commit adds a generic helper to make a button load/spin. Forward-Port-Of: odo
Original PR description
Clicking on save on html editor is taking quite some time. The user might think
something is not happening and need to click again.
If he does click again, 2 write RPC will be sent, making the COW business code
being triggered twice, ultimately leading to create 2 COW.
Instead of
```
A
/ \
B B'
```
It will be
```
A
/ | \
B B' B'
```
With as many B' than there is click on save.
This commit adds a generic helper to make a button load/spin.
Forward-Port-Of: odoo/odoo#63417When a social.post is sent using the "use_visitor_timezone" feature, we compare the social.post's creating user timezone with the visitors' timezones. However, there can be cases where the visitor was not assigned a timezone. Before this commit, we used "self.env.user.tz" as a fallback, but the posts can be potentially sent by a CRON where the environment user has no timezone either, leading to a crash. To avoid that failure, we now fallback to the neutral 'UTC' timezone, which is as
Original PR description
When a social.post is sent using the "use_visitor_timezone" feature, we compare the social.post's creating user timezone with the visitors' timezones. However, there can be cases where the visitor was not assigned a timezone. Before this commit, we used "self.env.user.tz" as a fallback, but the posts can be potentially sent by a CRON where the environment user has no timezone either, leading to a crash. To avoid that failure, we now fallback to the neutral 'UTC' timezone, which is as good as any when we have no clue what the actual visitor's timezone is. A test was added to ensure that a visitor without a timezone doesn't create a raise. Task-2415790 Forward-Port-Of: odoo/enterprise#15381
The amount was computed as the sum of payment 'amount'. However, 'amount' in payment is always positif even if the payment is outbound. Even the batch is rectricted to be full inbound/outbound, there are some flows creating batch payment mixin both of them. In that case, the batch 'amount' is wrongly computed. Forward-Port-Of: odoo/enterprise#15658
Original PR description
The amount was computed as the sum of payment 'amount'. However, 'amount' in payment is always positif even if the payment is outbound. Even the batch is rectricted to be full inbound/outbound, there are some flows creating batch payment mixin both of them. In that case, the batch 'amount' is wrongly computed. Forward-Port-Of: odoo/enterprise#15658
Issue - Create a "Quality Control Point" for product X and set 'Operation' to 'YourCompany: Receipts' - Create a RFQ with product X (set more than 1 quantity) then confirm order - Click on "Receipt" stat button - Set quantity "Done" to 1 - Click on "Quality Checks", then on 'pass' or 'fail' - Validate the picking, then create the Back Order - With the breadcrumb, go back to related Purchase Order - Click again on "Receipts" stat button - Select the Transfer with "Ready" s
Original PR description
Issue - Create a "Quality Control Point" for product X and set 'Operation' to 'YourCompany: Receipts' - Create a RFQ with product X (set more than 1 quantity) then confirm order - Click on "Receipt" stat button - Set quantity "Done" to 1 - Click on "Quality Checks", then on 'pass' or 'fail' - Validate the picking, then create the Back Order - With the breadcrumb, go back to related Purchase Order - Click again on "Receipts" stat button - Select the Transfer with "Ready" status Missing "Quality Checks" button. Cause No quality check linked to the backorder. Solution Copy the quality check of the picking related to the backorder for products that are available in the move lines of the backorder. opw-2418697 Forward-Port-Of: odoo/enterprise#15373
Before this commit, when the user changes the SOL in a timesheet in ticket view form for instance, then we retrieve this update to recompute the qty_delivered in old sol. The problem is we do not check if the value in timesheet is a list and if it is tuple/list in this list. If it is not the case, we have a traceback. This commit checks if the value of timesheet_ids in vals is list/tuple. Then we also check if the containing in this list is only list/tuple too. Finally, we can do the pr
Original PR description
Before this commit, when the user changes the SOL in a timesheet in ticket view form for instance, then we retrieve this update to recompute the qty_delivered in old sol. The problem is we do not check if the value in timesheet is a list and if it is tuple/list in this list. If it is not the case, we have a traceback. This commit checks if the value of timesheet_ids in vals is list/tuple. Then we also check if the containing in this list is only list/tuple too. Finally, we can do the processing to search all old sols to recompute the qty_delivered. Forward-Port-Of: odoo/enterprise#15645
Forward-Port-Of: odoo/enterprise#15652
Original PR description
Forward-Port-Of: odoo/enterprise#15652