Skip to content
Snippets Groups Projects
  1. May 26, 2021
  2. May 25, 2021
    • Alvaro Fuentes's avatar
      [FIX] core: fix filtered_domain for hierarchical terms · 14036869
      Alvaro Fuentes authored
      The method filtered_domain() is broken for domains with hierarchical
      terms ('child_of'/'parent_of').
      
      To see *one* of the ways the implementation is broken, let `A` be a
      model with `parent_id` pointing to `A`, and `a1` a record of model `A`
      without parent (`a1.parent_id` is `False`), then this fails:
      
          assert a1 in a1.filtered_domain([("parent_id", "child_of", a1.id)])
      
      The reason it fails is that on
      https://github.com/odoo/odoo/blob/f5519586d214a9b34ad24683a7f97c47802a3bad/odoo/models.py#L5377-L5380
      `data` is empty since `a1` has no parent, thus
      https://github.com/odoo/odoo/blob/f5519586d214a9b34ad24683a7f97c47802a3bad/odoo/models.py#L5403-L5404
      
      
      fails, therefore the result of `filtered_domain` is empty.
      
      Note: the implementation of the hierarchical operators is full of quirks
      that are hard to emulate otherwise than by reusing the original code.
      As a consequence, the current implementation may be broken in more than
      one way.
      
      Let's see another way the implementation is broken: let `B` be a model
      without a `parent_id` field and with a `friend_id` field pointing
      to `B`, and let `b1` be a record of model `B`.  Then
      
          b1.filtered_domain([("friend_id", "child_of", b1.id)])
      
      throws an exception of the form shown below:
      
          ValueError: Invalid field 'parent_id' in leaf "<osv.ExtendedLeaf: ('parent_id', 'child_of', 1) ...
      
      Meanwhile the following code is still valid and returs b1:
      
          B.search([("friend_id", "child_of", b1.id)])
      
      closes odoo/odoo#71237
      
      X-original-commit: e7a5ba95
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      14036869
    • Thibault Delavallée's avatar
      [FW][FIX] sale, mass_mailing_sms, test_mail_full: correctly support partner-only records · b1c90b96
      Thibault Delavallée authored
      
      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
      
      X-Original-Commit odoo/odoo@987d974ccb8c75c6eca899adb5be50fe48c8eb2c
      
      closes odoo/odoo#71178
      
      closes odoo/odoo#71205
      
      X-original-commit: 642816d0a819bf74927ed5aa11b6843cbb97d4df
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      b1c90b96
    • Thibault Delavallée's avatar
      [FW][IMP] test_mail_full: add test for SMS mailing default domain and optout · a274f4a4
      Thibault Delavallée authored
      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
      
      X-Original-Commit odoo/odoo@3ba3054f0aabd7307545712519594e9273dc7f28
      
      X-original-commit: a9ac2582eb508daa21fd0d3a5a551261ecc18f8b
      a274f4a4
    • Thibault Delavallée's avatar
      [FW][FIX] mass_mailing: correctly update list subscriptions when updating contacts · dce3fa2f
      Thibault Delavallée authored
      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
      
      X-Original-Commit odoo/odoo@11ffeddf23f6e40012e4a4a664d48193ec134ce3
      
      X-original-commit: 37bad522bcaf9a6db2f676286fb9ceb1a188dcab
      dce3fa2f
    • Florent de Labarre's avatar
      [FIX] l10n_fr_pos_cert: hash doesn't appear in ticket during reprint · ee2ee1ee
      Florent de Labarre authored
      
      - 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#71217
      
      X-original-commit: 40adcce221ab882d034b2f4ed2987a234ba434f5
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      ee2ee1ee
    • Florent de Labarre's avatar
      [FIX] mail: prevent useless write · 72a929d3
      Florent de Labarre authored
      
      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#71207
      
      Error: Could not serialize access due to concurrent update
      X-original-commit: 36a9e761
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      72a929d3
    • newtratip's avatar
      [CLA] newtratip signs Odoo's CLA · a0529acd
      newtratip authored
      
      closes odoo/odoo#71200
      
      X-original-commit: c49bcce2
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      a0529acd
    • Pierre Masereel's avatar
      [FIX] point_of_sale: rounding issue with cash rounding · 935d96b9
      Pierre Masereel authored
      
      The method that computs what is due and the change of an order is based
      on the selected payment line which is wrong, because if you add and
      remove a payment line, none will be seleced, that lead to issue in this
      case because a change is computed, and it won't match the invoices
      because an amount_return is sent to server.
      
      To reproduce you can follow this simply procedure:
          - set rounding half-up to 0.05
          - create a product at 0.98
          - open POS and create an order with the product
          - go to payment screen
          - add cash payment (1€ auto filled)
          - add bank payment (It'll autofill -0.02 not really a problem)
          - remove the bank payment => It'll show 0.02 due (it is caused because of no payment method is selected)
          - Set a customer and check the invoice => unbalanced (0.02 probably because it is set in amount_return of the request)
      
      closes odoo/odoo#71195
      
      X-original-commit: af5a88e8
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      935d96b9
    • Sébastien Geelen (sge)'s avatar
      [FIX] web_editor: add missing title on toolbar button · d193e5a1
      Sébastien Geelen (sge) authored
      
      closes odoo/odoo#71194
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      d193e5a1
  3. May 19, 2021
    • William Braeckman's avatar
      [IMP] hr,hr_contract: hide fields according to country · a5bcd6b1
      William Braeckman authored
      
      Hide fields related to belgian localisation when not using a belgian
      company.
      
      Task Id: 2496597
      
      closes odoo/odoo#69691
      
      Related: odoo/enterprise#17881
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      a5bcd6b1
    • Nicolas Seinlet's avatar
      [IMP] mail: better join improve query execution time · 13ff10d8
      Nicolas Seinlet authored
      
      - using join on required fields ease PostgreSQL planner guessing
      - skip useless join, the fastest code is the not executed one
      - skip dynamic `or` insertion and replace with a union all in CTE
      - replacing `where exists` with a join is then possible
      - a bit of alignment
      
      from some s to some ms execution time.
      
      Submit an "Apply for a job" on website , goes from
      `"POST /website_form/hr.applicant HTTP/1.0" 200 - 182 2.649 0.106`
      without this patch, to
      `"POST /website_form/hr.applicant HTTP/1.0" 200 - 185 0.492 0.107`
      when this patch is applied
      
      closes odoo/odoo#71028
      
      X-original-commit: 783280375ff04955978a14f007f96d6c4d7443b1
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      13ff10d8
  4. May 21, 2021
  5. May 20, 2021
  6. May 21, 2021
    • Sébastien Mottet (oms)'s avatar
      [FIX] website: launch action todo on website creation · 4900cee8
      Sébastien Mottet (oms) authored
      
      When website is installed through CLI, the ir.actions.todo
      'website_configurator_todo' is not launched and stays in
      'open' state. In this case the FIRST time we create a new
      website, this ir.action.todo is launched at the end of the
      configurator wheter it fails or not.
      
      - If configurator fails, the ir.actions.todo is returned
        by button_choose_theme when choosing a theme in the
        theme_view_kanban view. /website/configurator is called
        and since configurator_done was not correctly set to true
        on current website, the screen theme_view_kanban was
        rendered a second time.
      
      - If configurator succeeds, the ir.actions.todo is returned
        by button_choose_theme in configurator_apply. The route
        /website/configurator is called a second time and since
        configurator_done is set to true the route redirect to the
        website homepage but not in edit mode.
      
      The fix consits in correctly setting configurator_done in
      configurator_skip and in launching the configurator through
      the ir.actions.todo in create_and_redirect_configurator.
      
      closes odoo/odoo#71148
      
      X-original-commit: 1752548fabc9b184b5b67b659b505c4cfe8dc0c7
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      4900cee8
    • Laurent Smet's avatar
      [FIX] account: Fix corner cases of https://github.com/odoo/odoo/pull/70303 · f985eaa7
      Laurent Smet authored
      
      Original issue:
      Create a payment like follow:
      
      Payment type: receive money
      Partner type: customer
      Destination account: whatever receivable
      Amount: define an amount (i.e. 90.00)
      On Save, open the draft jounral entry created.
      Lower the liquidity or counterpart amount and add a writeoff
      Go back to the payment, change the amount and save.
      The journal entry writeoff will swap from debit to credit at every
      change made to the amount. This occur also when changing currency on the
      payment
      
      opw-2475223
      
      Otherwise, this fix is not covering all cases:
      inbound with write-off in debit
      inbound with write-off in credit
      outbound with write-off in debit
      outbound with write-off in credit
      
      closes odoo/odoo#70903
      
      X-original-commit: 01b9bff35e85fafb1a50bb0819123d186acf4925
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      f985eaa7
  7. May 11, 2021
    • Rushi Sathawar's avatar
      [IMP] base: open upgrade apps page in a new tab · 6b9acb23
      Rushi Sathawar authored
      
      Currently, clicking on the "upgrade" button from Apps in community
      opens the corresponding page in the same tab. As a consequence, the
      user completely leaves his database and it can quickly become tedious
      to get back to it.
      
      so in this commit, clicking on the 'upgrade' button should open the
      corresponding webpage in a new tab
      
      closes odoo/odoo#70636
      
      Taskid: 2513785
      Signed-off-by: default avatarArnaud Joset <arj-odoo@users.noreply.github.com>
      6b9acb23
  8. May 21, 2021
  9. May 20, 2021
    • Thibault Delavallée's avatar
      [FIX] mass_mailing: subject and preview should not be user translatable · 0ba617ca
      Thibault Delavallée authored
      
      Having those fields as translatable lead people to think those will be
      translated into recipient's language. This is incorrect as translations
      in Odoo are based on current user, not about any recipient who would
      see the field value.
      
      In this commit we therefore remove translation capabilities for
      subject and preview. Indeed mailings currently offer no multi languages
      support. Instead people should create separate mailings targetting
      some specific recipients, based on lang or country for example.
      
      Task ID-2535807
      
      closes odoo/odoo#71093
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      0ba617ca
  10. May 21, 2021
    • Antoine Guenet's avatar
      [IMP] web_editor: move icon and image tools to snippet option · d934b81a
      Antoine Guenet authored
      
      Wherever there is a sidebar, this moves all icon and image options to
      their own section of it. This also enables previews.
      The "spin" option was deemed unnecessary and therefore removed.
      
      TODO: restore the link option for icons. It wasn't working properly
      before this and was removed until it is fixed so as not to do any
      unnecessary coding for a broken option.
      
      closes odoo/odoo#70952
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      d934b81a
    • Aurélien (avd)'s avatar
      [FIX] mrp: improve perf of explode · 2e527b4c
      Aurélien (avd) authored
      
      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#71137
      
      X-original-commit: 44ae26e4477e1b76b3dbb0f1acd50e8553b14d71
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      2e527b4c
  11. May 20, 2021
    • Xavier Morel's avatar
      [FIX] core, mass_mailing: preserve markup status in prepend_html_content · a1f45aab
      Xavier Morel authored
      
      In `prepend_html_content`, if body `html_body` and `html_content` are
      `Markup` objects, the processing of `html_content` through `re.sub`
      will strip away the `Markup` flag, leading to the later concatenation
      of the body and content first escaping the content (to safely convert
      it to a `Markup`) before performing the concatenation proper.
      
      As a result, the `preview` of a `mailing.mailing` would be
      double-escaped, and the markup hiding it would instead be printed as
      part of the body.
      
      Assume that the type of `html_content` is str-compatible, and
      immediately rewrap the value after processing it through
      `re.sub`. This should do nothing if `html_content` was an actual
      `str`, and will re-flag it as a `Markup` if it was one.
      
      Also change the finding of the insertion point to use `re.search`, I
      don't understand why this uses `finditer`, it just makes the code more
      complicated.
      
      closes odoo/odoo#71090
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      a1f45aab
  12. May 21, 2021
    • Mohammed Shekha's avatar
      [IMP] web: add icons to boolean_toggle widget · 45b687ea
      Mohammed Shekha authored
      
      With this commit we improve boolean_toggle widget design, now widget will
      display fa-check-circle icon if it is enabled i.e. it has true value, widget
      will display fa-times-circle icon it is disabled i.e. it has false value.
      
      task-2488999
      
      closes odoo/odoo#68772
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      45b687ea
    • Mohammed Shekha's avatar
      [IMP] web: improve many2one_avatar widget for form edit mode · 5a0a1e76
      Mohammed Shekha authored
      
      with this commit: we improve many2one_avatar widget for editable form view,
      previously many2one avatar in edit mode was not displaying image, it was
      displaying only many2one selection input, this commit adds image before
      many2one input to have unify design with readonly form view.
      
      This is especially motivated by the fact that we plan on getting rid of the
      readonly formview to always be in edit mode.
      
      task-2451340
      
      closes odoo/odoo#67366
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      5a0a1e76
  13. May 20, 2021
Loading