summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-05-22[FIX] l10n_fr_pos_cert: hash doesn't appear in ticket during reprintFlorent de Labarre
- Create a pos order, pay and valide - Close Pos - reopen pos - search this order - click print ticket --> Issue the hash doesn't appear on the ticket closes odoo/odoo#71172 Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-05-17[FIX] mail: prevent useless writeFlorent de Labarre
In database with frontend and live chat there are lot of bad query error. bad query: UPDATE "mail_channel_partner" SET "write_uid"=5,"write_date"=(now() at time zone 'UTC') WHERE id IN (328111) closes odoo/odoo#70506 Error: Could not serialize access due to concurrent update Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-23[CLA] newtratip signs Odoo's CLAnewtratip
closes odoo/odoo#71184 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-23[I18N] Update translation terms from TransifexOdoo Translation Bot
2021-05-21[FIX] sale, mass_mailing_sms, test_mail_full: correctly support partner-only ↵Thibault Delavallée
records When performing an sms marketing on a model having only a ``partner_id`` field available (aka no ``phone`` or ``mobile``) it crashes due to seen list computation (aka already contacted recipients). This is due to an SQL query not taking into account those models as it works only for those with a phone field. We fix it as done in ``mass_mailìng`` app, aka fetching information on the related partner if available. Some tests for models using a 2many relationships towards recipients are added. Note that this kind of model does not really support complete SMS notification, as only the first found partner is notified. Mass SMS on this kind of model is currently not possible as seen list is not supported. There is no standard use case of this in Odoo codebase. Correctly support sms marketing on sale model by defining the necessary methods. As sale order has only a partner_id field available we have to correctly override phone related methods for SMS. LINKS Task ID-2431217 COM PR odoo/odoo#71140 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-21[IMP] test_mail_full: add test for SMS mailing default domain and optoutThibault Delavallée
Purpose is to test specific behavior of opt-out for SMS marketing. This is currently not tested and working a bit strangely, as they are flagged as blacklist. This will soon be updated in another task but at least current behavior is logged somewhere. We also update some test models in order to reflect potential strange and non-default behavior, notably partner_id field used as contact field. It will be used soon when cleaning some opt-out behavior. Tests are added to check phone sanitized is correctly taken into account in default domains when inheriting from the phone blacklist mixin. Some counters notes are also updated next to some last updates. Task ID-2431217 COM PR odoo/odoo#71140
2021-05-21[FIX] mass_mailing: correctly update list subscriptions when updating contactsThibault Delavallée
There is a missing depends on subscription_ids fields, meaning it is not correctly refreshed when contacts are updated. When dealing with m2m using the o2m model as relational table, depends have to be specified on field itself to allow recomputing the fields. Task ID-2431217 COM PR odoo/odoo#71140
2021-05-18[FIX] web, website: display default company name on frontend layoutYounn Olivier
Before, the "Company name" placeholder was hardcoded in the frontend layout template, and the user had to change it with his company name from the website view, which was not user-friendly if the website module was not installed. Now, by default, the frontend layout template displays the user's company name. If the website module is installed, it is editable. task-2468472 closes odoo/odoo#69943 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-21[FIX] event_sale: ticket price with pricelistnie
Steps: - Install Events - Go to Events / Configuration / Settings - Enable Tickets - Go to Sales / Configuration / Settings - Enable Multiple Sales Prices per Product - Go to Sales / Products - Edit Event Registration - Sales tab - Pricing - Pricelist: Public Pricelist (USD) - Price: $6 - Go to Sales - Create a new quotation - Pricelist: Public Pricelist (USD) - Product: Event Registration - Event: Design Fair - Ticket: VIP Bug: The pricelist is not taken into account. Unit price should be $900 but is $1500. Explanation: The original issue comes from this commit: https://github.com/odoo/odoo/commit/379f1490c93dc599a74add2d678c18fbba1efa62 The advertised amount was not the one showing up in the cart. This is because the pricelist was not taken into account anymore when entering the payment process. Using `price_reduce` instead of `price` enables all kinds of discounts on the final price. However, `price_reduce` relies on the context to find the current pricelist. This commit adds the context needed to compute the price of the tickets. This context is the same as the one in the sales module since pricelists are working fine there: https://github.com/odoo/odoo/blob/b208570ce8399bc6d3e4a8ba02eef6558e0a6ccc/addons/sale/models/sale.py#L1494 The currency conversion is done in `product.price`. It's therefore already done when calling `price_reduce`. opw:2519453 closes odoo/odoo#71114 X-original-commit: e92282f712d485ca97feb8a729abe3b975183451 Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-05-21[FIX] l10n_it_edi: Vendor bill is not being created from PECPaolo (pgi)
When one or more vendor bills in Italian e-invoice format were sent to the registered PEC mailbox, if they are in the PKCS#7 format ('.xml.p7m'), nothing happened. The e-invoice content should be automatically decoded and the invoice should be created as soon as the xml file is fetched from the PEC mailbox. A new remove_signature function has been added in a tools/remove_signature.py file to handle this case. The OpenSSL and pyOpenSSL libraries must be installed. They are not in requirements.txt but they're probably available. New tests has been provided for the signed email reading method. opw-2460485 closes odoo/odoo#71138 Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-05-17[FIX] mrp: improve perf of explodeAurélien (avd)
Batch the bom_search of bom_lines in mrp_bom.explode. If we represent the bom hierarchy as a graph, essentially switch from a depth-first to a breadth-first search, allowing to batch search boms for each depth level, hence improving the overall performance. closes odoo/odoo#70853 X-original-commit: 0a39cd7ddf0e95a12abc7fbb87f4701e5ab72716 Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com> Signed-off-by: Aurelienvd <Aurelienvd@users.noreply.github.com>
2021-05-21[FIX] web: fix crash on editable list view when moving over a RO fieldAnh Thao Pham (pta)
This is a forward-port of commit https://github.com/odoo/odoo/commit/970387f91fea0cb47404612f7d519ffba2c9ad3b In editable list view, moving to next cell using TAB key crash when the following field is becoming read-only (i.e non-focusable) and an onchange() event is triggered. Consider an editable tree view like this: <form> <field name="o2m" onchange="1"> <tree> <field name="description"/> <field name="date" attrs="{'readonly': [('description', '!=', False)]}"/> <field name="type"/> </tree> </field> </form> 1. Edit 'description' 2. Issue a TAB keypress before 'date' becomes read-only It will crash while calling getSelectionRange() on an empty element. opw-2523630 closes odoo/odoo#71122 X-original-commit: bd6ba50e073ffff0bd51b1a02d51260f09e36357 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-05-20[FIX] sale: use correct currency in testswan
The main company can have something else than EUR or USD, especialy when testing localizations. closes odoo/odoo#71098 Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-05-20[FIX] l10n_cl: do not override `_onchange_journal``wan
This method was defined in `account` but overrided in `l10n_cl`. Prefix the method to avoid that.
2021-05-20[FIX] account: test taxes taking companies into accountwan
When multiple companies are created, and some taxes are used with the same tages, the query is not precise enough.
2021-05-20[FIX] base: confusion between werkzeug.urls and urls localXavier Morel
As part of the Python 3 compatibility effort, 01e35141479b8dfc4a390518f89fc52e7cec5396 moved all uses of urllib(2) to werkzeug & requests as the packages were renamed and reorganised between P2 and P3. For `module.py`, it looks like I confused the `urls` local variable for an already imported `werkzeug.urls` and just tried calling `url_parse` on that. Which doesn't work, because `urls` is a dict. Fixes #71076 closes odoo/odoo#71117 X-original-commit: 0cfe528de82c1de8971e5bb5f66103447eae781c Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com> Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-05-19[FIX] mrp: fix recursion error when updating quants for kit variantJordiMForgeFlow
When updating the quantities available for a product, an inventory move is generated without setting the product_tmpl_id, as this field is related to the product_id of the move. However, when creating the move, Odoo will consider it a default missing value and will try to fill it in the method default_get. When navigating to the product variants of a template from the template form, a default_product_tmpl_id is set in the context pointing to the template. This context is propagated to the update quantity action to create/update quants for the variant. The problem when dealing with kits is that the products available to update their quantities are the components of the kit. When navigating to a variant and updating the quantities of a component of the kit variant, the default product template in the context will be the kit template. This is causing that, when generating the inventory move, the move is created with product_id of the component, and product_tmpl_id of the kit template. This issue creates a critical data inconsistency as the component's template is set to the kit's template, which apart from making no sense generates a recursion error. To fix this, when triggering the action to create/update quants for a kit product, it must be ensured that no default product template is being set. closes odoo/odoo#71055 X-original-commit: bdeea73dc1efb6ff7d02cc2f58347a69762bcc3c Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-19[FIX] stock: fix the manual reservation optionDjamel (otd)
Steps to reproduce the bug: - Go to inventory settings > select "Reservation: Manually or based on Automatic scheduler" option - Create a storable product - Create a planned delivery order for a created product - Click on “Mark as to do” > the order status becomes "waiting" - Process a receipt for the same product Problem: The status of the delivery order is changed from "waiting” to "ready" and the product is automatically reserved solution: In this commit, we fix this by adding a parameter "stock.picking_no_auto_reserve" to ir.config_parameter when the manual reservation option is enabled opw-2520742 closes odoo/odoo#71033 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-20[FIX] sale_timesheet: fix domain of project on productPrakash Prajapati
Currently, create a service product and select a project or a project template from the 'sales' tab, it is not possible to select projects with allow_timesheets = false So in this commit, the domain of the project_id and the project_template_id fields should include projects for which allow_timesheets is false except if the 'Timesheets on tasks' option is selected as a service_policy Also if onchage of service_policy, the project field will be empty. TaskID-2522084 closes odoo/odoo#70609 Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-10[FIX] account: digest email revenu values correctionBVE
The value taken into account in the SQL for the calculation were wrong: - Not based on the state of the invoices (cancelled and draft were taken into account) - Had the tax included opw-2464004 feedback-2478356 closes odoo/odoo#70586 X-original-commit: fafea72843e25e0fee091ca935df61edb9133f6f Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-05-19[FIX] sale_product_matrix: avoid traceback when using Order Grid EntryAndrea Grazioso (agr-odoo)
- Enable 'product configurator' and 'variant grid entry' - Go to product [DEMO]: - Add an optional product. - Go to the variants tab and add some variants - Select 'order grid entry' - Remove all the variants - Create a SO adding [DEMO] Traceback will occur opw-2439764 closes odoo/odoo#71035 X-original-commit: da9541089fcf33c778748c4c3da0d81f6b5ea227 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-05-17[FIX] mrp: prevent MO validation with no consumptionTiffany Chang (tic)
If a MO is validated with all of its (component) move_raw_ids.quality_done = 0, then when trying to validate the nonsensical "The quantity to produce must be positive" validation error will occur. This is due to all move_raw_ids being marked as Cancelled, which auto-updates the MO state to cancelled, which prevents the validation from properly completing. To avoid this error, we prevent the user from having 0 consumption for all components. Task: 2422698 Related (v13 fix + bug description) Task: 2463893 ENT PR (test fixes): odoo/enterprise#18355 closes odoo/odoo#70900 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-19[FIX] project: display share action on only form viewSwapnesh Shah
Before this commit, Share action was displayed on list view as well which doesn't makes sense as it will always use `active_id` only. With this commit, we are displaying `Share` action on form view only. opw-2530652 closes #70821 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-27[FIX] hr_expense: do not create a payment when expense is paid by companyUrvi Soni
Currently, when we create an expense that is paid by company, then create and approve a report, then post entries, 2 entries are created. 1 is posted and is correct, the other one is in draft due to the creation of the payment for employee and should not be there. As when a company pays for an expense, in 99% of the cases, it's because employees have a credit card funded by the company. It happens often that company owners have this kind of card or even employees but that's more common in the US. In such case, it's just an account payable to visa or mastercard. so no need to create a payment for the employee. So this commit, draft entry will not be created when payment paid by the company while posting the entries from the expense. closes odoo/odoo#69875 Taskid: 2410551 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-19[IMP](stock,mrp)_account: use location valuation accountyhu-odoo
Previous fix f056254d1c5153467b10d9581214ff6d1348be76 didn't take the situation when production location has its own valuation accounts into consideration. Fix it in this commit. opw-2476417 closes odoo/odoo#67478 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-04-29[FIX] core: avoid deprecation warning in requests_toolbeltChristophe Monniez
The requests_toolbelt package < 0.9 uses `from collections import ...` which is deprecated in python 3.8 [0]. The request_toolbelt package is not a dependency of Odoo but is needed by zeep [1]. Unfortunately, the Ubuntu python3-requests-toolbelt package is still 0.8 [2]. This commit filters out the warning. [0] https://github.com/requests/toolbelt/commit/979f95266c2044893b05cb2314e94c899915748c [1] https://packages.ubuntu.com/focal/python3-zeep [2] https://packages.ubuntu.com/focal/python3-requests-toolbelt closes odoo/odoo#70137 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-05-19[FIX] core: computed editable one2many field with a domainRaphael Collet
Manually adding a line should not trigger the computation of the field, just like modifying the line fields that occur in the field's domain. In other words, the dependencies of the field should be limited to the ones declared on field or its compute method. closes odoo/odoo#71027 X-original-commit: 9000a50582db827ff12acdecf8ef91749122452d Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-05-19[FIX] web: update owl from 1.2.5 to v1.2.6Géry Debongnie
This commit updates owl to the latest release. It only contains a small fix to the router (route params handling) Release on github: https://github.com/odoo/owl/releases/tag/v1.2.6 closes odoo/odoo#71023 Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-05-18[FIX] account: fix reconcile rule percentage calculationjbw
In https://github.com/odoo/odoo/pull/52529/commits/078a3a0f760ff24d02070a343f28d2249a8b5ba7#diff-c217a13a40a3cc27dc516b899793abecfac8cab9a42fed407d4776bcbc9de9a8R812 the way the percentage is calculated is changed. This implies that a reconciliation rule allowing a 90% matching amount will not allow to reconcile a 90$ bank statement with a 100$ invoice (as it will calculate the % as 88.89%, not meeting the required 90 %) After cited commit: invoice 200, bank statement 180: (|-180| - |20|) / |-180| * 100 = 88.89% invoice 200, bank statement 220: (|-220| - |-20|) / |-220| * 100 = 90.91% credit note 200, bank statement -180: (|180| - |-20|) / |180| * 100 = 88.89% credit note 200, bank statement -220: (|220| - |20|) / |220| * 100 = 90.91% Now: invoice 200, bank statement 180: 100 - |20| / |(-180 - 20)| * 100 = 90% invoice 200, bank statement 220: 100 - |-20| / |(-220 - -20)| * 100 = 90% credit note 200, bank statement -180: 100 - |-20| / |(180 - -20)| * 100 = 90% credit note 200, bank statement -220: 100 - |20| / |(220 - 20)| * 100 = 90% closes odoo/odoo#70948 Task: 2427089 Signed-off-by: William André (wan) <wan@odoo.com>
2021-05-19[FIX] website_slides: close fullscreen mode when opening web editorAurélien Warnon
The web editor does not work well with the e-learning fullscreen view. It actually completely closes the fullscreen view and opens the edition on a blank page. To avoid this, we intercept the click on the 'edit' button and redirect to the non-fullscreen view of this slide with the editor enabled, whose layout is more suited to edit in-place anyway. A small testing tour was added to ensure this behavior is kept. Task-2507179 closes odoo/odoo#70606 X-original-commit: dcb6a3cea27f32d722d1a8dc87c34a846cf5ac23 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-05-18[FIX] base/ir_model: fix materialized views columns listingAlvaro Fuentes
When there is a materialized view that has not been populated any select on it will fail. Example of traceback: ``` Traceback (most recent call last): File "/home/odoo/src/odoo/12.0/odoo/service/server.py", line 1162, in preload_registries registry = Registry.new(dbname, update_module=update_module) File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 367, in load_modules registry.setup_models(cr) File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 262, in setup_models env['ir.model']._add_manual_models() File "/home/odoo/src/odoo/12.0/odoo/addons/base/models/ir_model.py", line 321, in _add_manual_models cr.execute('SELECT * FROM %s LIMIT 0' % Model._table) File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 148, in wrapper return f(self, *args, **kwargs) File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 225, in execute res = self._obj.execute(query, params) psycopg2.errors.ObjectNotInPrerequisiteState: materialized view "x_bi_sql_view_report_copy" has not been populated HINT: Use the REFRESH MATERIALIZED VIEW command. ``` Several upgrade requests have or had had this error which has been solved with specific scripts. Related to #40930 closes odoo/odoo#71002 X-original-commit: b208570ce8399bc6d3e4a8ba02eef6558e0a6ccc Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-03-24[FIX] web: disale autofill on input elementsMohammed Shekha
with this commit we disables autofill of autocomplete by setting autocomplete=off, this was previously done in commit: 64293fbdb0a247f689c1b0b0c580d9ce577af510 but it was not working because we were setting autocomplete=none it seems that none does not work all the time. task-2462676 closes odoo/odoo#68271 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-18[FIX] base: update API documentation linkSwapnesh Shah
Before this commit, link to the API documentation was referenced to the master version, instead of the current one, 14.0. Furthermore, the link wasn't adapted correctly following the documentation reorganisation, which is also fixed by this commit. closes odoo/odoo#61905 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-18[FIX] website: correctly set accordion idsSébastien Mottet (oms)
data-parent fields were set on tab link and not on the tabpanel div. It prevented the accordion of having the right behavior: closing all the other tabs when a tab is clicked to be opened. closes odoo/odoo#70960 X-original-commit: 32b2c17eb7bec5293dfc0cfb4bb07d19dc2ec5c3 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-03-25[IMP] mrp: no register number check after duplicate MOyhu-odoo
To reproduce: 1. create and confirm a MO with register number checks on operations 2. duplicate the MO The register number checks won't show up in the new MO We didn't set copy=False for workorder_id on stock.move, when copy a confirmed MO, the new moves are linked to old WOs on old MO. New WO didn't link to any moves. When create quality checks, we only create "register ..." checks for WOs with move_id. As a result, new WOs without move_id won't have those checks. To fix, set copy=False on workorder_id of stock.move Task 2484939 closes odoo/odoo#68348 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-18[FIX] purchase: message not translatedyhu-odoo
Some message are not translated. Fix them. closes odoo/odoo#68223 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-12[FIX] website_forum: add data-parent to fix faq accordionSébastien Mottet (oms)
website_forum.faq_accordion is not rendered by a drag'n'drop and data-parent is therefore not set on tabpanels by onBuilt. closes odoo/odoo#70759 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-18[FIX] web: update owl from 1.2.4 to v1.2.5Géry Debongnie
This commit update owl to the latest release. It only contains a small fix on the order of lookup for the t-component directive. Release on github: https://github.com/odoo/owl/releases/tag/v1.2.5 closes odoo/odoo#70935 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-18[FIX] fleet: new contract no vehicle no errorNicolas Lempereur
If you set the type (cost_subtype_id) of a new contract (fleet.vehicle.log.contract) before setting vehicle_id you got an error: name = record.cost_subtype_id.name + ' ' + name TypeError: can only concatenate str (not "bool") to str because vehicle name was False. opw-2527268 closes odoo/odoo#70929 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-18[FIX] sale: Traceback when changing date orderAchraf (abz)
When the user removes the readonly from the field date order and tries to modify it it crashes in some cases, this commit fix this opw-2523508 closes odoo/odoo#70895 Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-05-18[FIX] mrp: use MO's UoM on unbuild order creationAdrien Widart
On unbuild order creation, when the user selects a manufacturing order, the UoM of the quantity will be defined with the product's UoM instead of MO's UoM. To reproduce the error: (Use demo data) 1. In Settings > General Settings, enable "Units of Measure" 2. Create two products P_finished and P_compo - Both are storable - Qty on Hand of P_compo = 12 3. Create a Bill of Material - Product: P_finished - Component: 1 x P_compo 4. Create a Manufacturing Order MO - Product: P_finished - Quantity To Produce: 1 Dozen(s) 5. Check Availability, Produce, Mark as Done 6. Create an Unbuild Order: - Manufacturing Order: MO Error: The unit of measure of the quantity is incorrect, this is Unit(s), it should be Dozen(s) The method `onchange_mo_id` defines the product, therefore the method `onchange_product_id` is also called and here is the issue: `onchange_product_id` will override the UoM using the product's UoM. OPW-2467017 closes odoo/odoo#70904 X-original-commit: b80321acd5553466862b5c2c56cff014765ecf99 Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com> Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-05-17[IMP] mail: allow to force the FROM headers of the outgoing mail serverstd-odoo
Purpose ======= We want to be able to force the FROM headers when we sent email in SMTP. So we can avoid the emails to be considered as spam. Specifications ============== This is done with 2 system parameters. If the system parameter `mail.force.smtp.from` is set we encapsulate all outgoing email from with the given value. If the previous system parameter is not set and if both `mail.dynamic.smtp.from` and `mail.catchall.domain` are set, we encapsulate the FROM only if the domain of the email is not the same as the domain of the catchall parameter. Otherwise we do not encapsulate the email (same behavior as before this commit). Task 2367946 See odoo/odoo/pull/61853 closes odoo/odoo#70854 X-original-commit: 044532aed6f796cd93e37556b4a8ce47d2c23a7c Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com> Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-05-17[FIX] web: domain: (=)(i)like operatorsAaron Bohy
Before this commit, evaluating a domain containing a like/ilike operator with an evaluation context in which the value was false crashed. Moreover, those operators were wrong w.r.t. the case sensitivity: like was case insensitive, whereas ilike was case sensitive, and both =like and =ilike were case insensitive. This commit fixes thoses issues. The first issue was spotted on our prod, as we tried to add an invisible attrs in a form view, using the ilike operator (it thus crashed in create mode). The second issue was spotted while writting the test cases. To the best of our knowledge, those operators aren't used in attrs (for now), explaining why those issues haven't been found before. closes odoo/odoo#70876 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-05-17[FIX] pad_project: copy the content in the pad when use_pad=FalseXavier BOL (xbo)
Before this commit, when the user edits the description of a task with use_pad=True and then change the project of this task to one with use_pads=False. The description written in the pad server is not copied in the description field of the task. This commit copies the content of the pad for this case when the use_pad changes to become False and description_pad is set. Step to reproduce: ----------------- 1. Go to Settings of the Project App and enable the Collaborative Pads 2. Go to the Project App, in the Projects dashboard (kanban view of projects) 3. Create two Projects (one called "Project A" and the other called "Project B") 4. Edit the Project B to activate the pad, that is, check the Use collaborative pads checkbox. 5. Go to the view list of tasks in the "Project B" 6. Click on "Create" button to create a task in the task form view. 7. Write a description for this task. 8. Change the project of this task by the "Project A". With this change, the collaborative pad is disabled for this task since the Project A has not the pad, and then the description field is empty rather than have the content that we have just written. task-2515150 closes #70401 closes odoo/odoo#70901 X-original-commit: 32a8f598d6a958f2a08b204524007cc075697fda Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-17[FIX] pad: copy the pad_content_field content in pad when genrate pad urlXavier BOL (xbo)
Before this commit, in Project App, when the "Collaborative Pads" is enabled in the Settings of this app, if the user create a task without project or in a project that has not the pad enabled and he writes a description for his new task and select (another) project in which the pads is enabled then the description field in the form view changed to have the collaborative pad and the problem is the description is not copied in the pad and seems erase/delete for the user. This commit checks if the pad_content_field is not empty after generating the pad url for the new task/record, if it is the case then we copy the content in the pad and the user can continue his edition before saving the task/record. Step to reproduce: ----------------- 1. Go to Settings of the Project App and enable the Collaborative Pads 2. Go to the Project App, in the Projects dashboard (kanban view of projects) 3. Create two Projects (one called "Project A" and the other called "Project B") 4. Edit the Project B to activate the pad, that is, check the Use collaborative pads checkbox. 5. Go to the view list of tasks in the "Project A" 6. Click on "Create" button to create a task in the task form view. 7. Write a description for this task. 8. Change the project of this task by the Project B. With this change, the collaborative pad is actived for this task since the Project B has the pad, and then the description in the pad is empty rather than have the content that we have just written. task-2515150 closes #70401 X-original-commit: d2b55c775d705128fa65c859c5f47bdaf4b705fe
2021-05-17[FIX] point_of_sale: rounding down near 0Nicolas Lempereur
Before 03025520b rounding applied was eg. for these numbers and UP and DOWN rounding methods to multiple of 10: ``` Numbers | -8 | -2 | 2 | 8 | 12 DOWN | -2 | -8 | -2 | -8 | -2 UP | 8 | 2 | 8 | 2 | 8 ``` which is correct for positive numbers but UP and DOWN are inversed for negatives numbers. After 03025520b this became: ``` Numbers | -8 | -2 | 2 | 8 | 12 DOWN | 8 | 2 | 8 | -8 | -2 UP | -2 | -8 | -2 | 2 | 8 ``` which is correct for all cases except for positive numbers that are before HALF of the precision (eg. number 2) for which UP and DOWN are inversed. This is happening because 03025520b uses the sign of the rounded value => this does not work for 0 so number 2 is broken (and if fixed number -2 would be broken). With this commit, the adjustement of sign is done based on original number, so we get the equivalent of python equivalent methods: ``` Numbers | -8 | -2 | 2 | 8 | 12 DOWN | 8 | 2 | -2 | -8 | -2 UP | -2 | -8 | 8 | 2 | 8 ``` opw-2451841 closes odoo/odoo#70910 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-17[REVERT] sale: Fix fiscal pos. mapping taxes to price includedLaurent Smet
This reverts commit d89562e8fe473692296cb209651beb2ce7a715e4. Since this commit, the taxes mapped by fiscal position wasn't managed by the _fix_tax_included_price_company method anymore. Otherwise, some customizations exist on this method that are no longer called. The 2527940 issue is also due to a remaining bug: the total_excluded price should be divided by the quantity but: - what if the quantity & price_unit are both signed? - what if the number of digits for price_unit and the currency are different? Should we skip the rounding of taxes? Since this commit is not perfect and has a lot of dependencies in others modules, we decided to revert it. Original PR: https://github.com/odoo/odoo/pull/68997 Revert PR: https://github.com/odoo/odoo/pull/70858 closes odoo/odoo#70883 Issue: 2527940 X-original-commit: c9330e4af5b034fd81090478723ee3c18be58733 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com> Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-05-17[FIX] purchase: speed up search for purchase_vendor_bill_idIvan Yelizariev
When partner is not selected, Odoo sends name_search request `[..., ('partner_id', 'child_of', [False])]`. It's not obvious what does such domain mean ( see #70584 ). This commit clarifies what do we expect to get: we want all records without restrictions on `partner_id` value. This also fixes performance issue because domain leaf `('partner_id', 'child_of', [False])` is converted to where-clause `<table>.partner_id in <all or almost all ids>` --- opw-2524010 closes odoo/odoo#70842 X-original-commit: 39e0f1fb0f60f309be7f65562911b1236167dce7 Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com> Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-05-17[FIX]sale_timesheet : Convert the project overview values to the current ↵Djamel (otd)
currency Steps to reproduce the bug: - Go to Project app - See the overview of any project - Select at the top right another company with a different currency. But keep the company assigned to the current project selected Problem: The new currency is changed in the project overview, but the values are not converted to this currency. opw-2479364 closes odoo/odoo#70597 X-original-commit: eeeb18a28b0febd260c07069ce7a958b2e5038bb Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-17[FIX] payment: enable pay button when clicking back buttonNasreddin (bon)
Issue Use Safari (or equivalent) browser - Install e-commerce - Go to Website -> Configuration -> Payment Acquirers - Activate Ingenico in test mode (write aaa in required fields) - Go to shop, and add product to card - Go to checkout - Select Ingenico payment mode - Click on Pay button - When on the ingenico page, press back The page is blocked and the button is disabled. Cause When clicking on Pay button, the page is locked and the button is disabled. With Chrome, when coming back to previous page, this one is regenerated and therefore adapt the button. In Safari, it is not the case. Solution On `pageshow` event, if event have `persisted` attribute set to to true, meaning using cache, then reload page. Fixes https://github.com/odoo/odoo/issues/69453 opw-2510281 closes odoo/odoo#70834 X-original-commit: f2eb6d3ce8b31d3f14f45482060d4ef5c362e7c3 Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com> Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com> Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>