Skip to content
Snippets Groups Projects
  1. May 26, 2021
    • Adrien Widart's avatar
      [FIX] mrp: use correct UoM for each component in MO · afda6659
      Adrien Widart authored
      
      In a Manufacturing Order, the components' quantities are rounded using
      the rounding precision of the produced product's UoM. This leads to
      incorrect values.
      
      To reproduce the error:
      1. In Settings, enable "Units of Measure"
      2. In UoM, edit Units:
          - Rounding Precision: 1
      3. Create two products P_finished and P_compo
          - P_compo's Product Type: Consumable
          - P_compo's UoM: L
          - P_finished's UoM: Units
      4. Create a Bill of Materials
          - Product: P_finished
          - 1 Component:
              - Product: P_compo
              - Quantity: 0.2
              - UoM: L
      5. Create a Manufacturing Order:
          - Product: P_finished
      6. Confirm, Mark as Done
      
      Error: Qty to consumes became 0 and consumed qty is 0. Both values
      should be 0.2L, but they have been rounded using the rounding precision
      of Units
      
      OPW-2529462
      
      closes odoo/odoo#71293
      
      X-original-commit: aff3a2e0
      Signed-off-by: default avatarSteve Van Essche <svs-odoo@users.noreply.github.com>
      Signed-off-by: default avatarAdrien Widart <adwid@users.noreply.github.com>
      afda6659
    • Nicolas Lempereur's avatar
      [FIX] mail,test_mass_mailing: unblacklist with mass mailing · 55f6d29a
      Nicolas Lempereur authored
      
      The optimization 2ccf0bd0 does not take into account that to
      "unblacklist" a user, you have the archive the mail.blacklist record so
      only mail.blacklist active records need to be taken into account.
      
      Added test without the fix fails with:
      
          AssertionError: False is not true : MailTrace: email
          test.record.02@test.example.com (recipient res.partner(), state:
          sent, record: mailing.test.blacklist(166,)): found 0 records (1 expected)
      
      opw-2536304
      
      closes odoo/odoo#71277
      
      X-original-commit: 965c67cb
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      55f6d29a
  2. May 25, 2021
    • Nasreddin (bon)'s avatar
      [FIX] survey: display right date format in datepicker · d8244c64
      Nasreddin (bon) authored
      
      Issue
      
      	- Install 'Survey' & 'website' module
      	- Enable "es_VE" language and activate on main website
      	- Go to Website Homepage
      	- Switch to "Spanish (VE)" language (footer)
      	- Go to "Survey" module
      	- Create a survey:
      	- Add a question of type 'Date' then save
      	- Click on "TEST" button
      	- Start survey and add a date with the datepicker
      	- Submit survey
      
      	Error message : 'This is not a date'
      
      Cause
      
      	When submit survey, not using the database date format.
      
      Solution
      
      	When validating form (on submit), check if date is formated
      	with database format and (not the moment locale since user can
      	alter date and datetime format).
      
      opw-2452237
      
      closes odoo/odoo#71228
      
      X-original-commit: f3c5dd79
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      Signed-off-by: default avatarbon-odoo <nboulif@users.noreply.github.com>
      d8244c64
  3. May 21, 2021
  4. May 17, 2021
  5. May 26, 2021
    • nounoubensebia's avatar
      [IMP] mail_plugin, crm_mail_plugin: add translation support for email plugins · 24d5c789
      nounoubensebia authored
      In mail_plugin module, add a method which returns translatable modules,
      this method will be overridden in the other modules to add their module names.
      
      Translations are prepared via the _prepare_translations method which uses
      the get_translations_for_webclient method, this way we can easily fetch
      translations without having to write python code.
      
      We also add xml files in "static/", these files contain terms to be translated,
      for each plugin we create a separate xml file so that we can easily update each
      plugin separately.
      
      This implementation will allow having translations handled by Odoo, which has
      several advantages:
      - existing system, nothing to develop
      - it will use transifex and the terms will be translated by the community
      - forces that mail_client implementations to have the same logic (consistency)
      - compared to other solutions which rely on python code to return translations,
        this solution is more robust as it avoids having to type the string to
        translate twice
      
      Task-2480075
      
      closes odoo/odoo#69118
      
      Ent-pr: https://github.com/odoo/enterprise/pull/17626
      Plugin-pr: https://github.com/odoo/mail-client-extensions/pull/6
      
      
      Related: odoo/enterprise#17626
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      24d5c789
    • Mohammed Shekha's avatar
      [IMP] hr: support many2many_avatar_employee widget · ffe768f2
      Mohammed Shekha authored
      
      closes odoo/odoo#67515
      
      Related: odoo/enterprise#17081
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      ffe768f2
    • Mohammed Shekha's avatar
      [FIX] web: do not show cursor pointer on m2m badge without color · 8962edf4
      Mohammed Shekha authored
      before this commit: when many2mnay_tags widget does not have color_field in
      options still hovering over many2many_tags badge shows cursor pointer, while
      it should display default cursor and if there is color field given in options
      then cursor should be pointer.
      
      after this commit: cursor pointer will be displayed only when color field is
      given in options else shod cursor default.
      
      task-2451204
      8962edf4
    • Mohammed Shekha's avatar
      [IMP] mail,web: add many2many_avatar_user widget to open chat · d25459e6
      Mohammed Shekha authored
      with this commit, we adds many2many_avatar_user widget to have same behaviour
      as many2one_avatar_user where clicking on avatar image opens chat box, so to
      have same feature on many2many_tags which is related to res.users we adds
      many2many_avatar_user widget.
      
      task-2451204
      d25459e6
    • Tiffany Chang (tic)'s avatar
      [FIX] stock: fix multi-step immediate transfer receipts · f4639270
      Tiffany Chang (tic) authored
      
      Steps to reproduce:
      1. activate routes setting + multi-step incoming shipments (2 or 3,
         doesn't matter)
      2. create an immediate transfer receipt
      3. add a done quantity (optional: validate)
      4. open corresponding 2nd step internal transfer
      
      Expected result:
      - amount done in immediate transfer receipt will be demand of internal
        transfer
      
      Actual result:
      - demand (and all other values) will be 0
      
      closes odoo/odoo#68885
      
      Task: 2492994
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      f4639270
  6. May 25, 2021
  7. May 26, 2021
  8. May 24, 2021
  9. May 26, 2021
    • Thibault Delavallée's avatar
      [IMP] mass_mailing_{event/event_track/sale}: add default mailing domains · 500b845b
      Thibault Delavallée authored
      
      When performing an email or SMS mailing on functional models a default domain
      is a good start to avoid sending notifications to dead records, aka
      
        * canceled registrations;
        * canceled tracks;
        * canceled sale orders;
      
      Task ID-2431217
      COM PR odoo#67322
      ENT PR odoo/enterprise#16876
      UPG PR odoo/upgrade#2236
      
      closes odoo/odoo#67322
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      500b845b
    • Thibault Delavallée's avatar
      [REF] mass_mailing: move mailing capability on model · ed508ee1
      Thibault Delavallée authored
      PURPOSE
      
      Remove hardcoded list of models on which mailing is possible. Indeed it is
      not modular and not really smart with enterprise code not being reachable
      in community.
      
      SPECIFICATIONS
      
      Replace hardcoded list of models on which mailing (both mail or sms) is
      possible by a computed searchable field on ``ir.model`` based on a class
      attribute.
      
      It allows to cleanly define models having mass mailing capabilities and add
      this attribute in bridge modules (when existing) or directly on base model
      definition to avoid bridge modules.
      
      In this commit we introduce a basic ``_mailing_enabled`` class attribute
      activating mailing on model.
      
      Mailing models may also have a ``_mailing_get_default_domain`` method allowing
      to define a custom default domain when sending a marketing mailing on records
      on this class.
      
      Mailing models can now define a ``_mailing_get_opt_out_list(_sms)`` method
      allowing to define custom behavior to fetch opt-outed records. Instead of
      defining a model-based behavior on Mailing itself, it now calls the model
      defined one. We still have two methods, one for mailing and one for SMS
      opt out computation as it relies on different underlying models and fields.
      
      LINKS
      
      Task ID-2431217
      COM PR odoo/odoo#67322
      ENT PR odoo/enterprise#16876
      UPG PR odoo/upgrade#2236
      ed508ee1
    • Thibault Delavallée's avatar
      [IMP] mail: concatenate all Base class code in a single override · 3ffd6acc
      Thibault Delavallée authored
      Merge two overrides of Base into the same file. Just moving code to clean
      module, nothing changes functionally or technically.
      
      LINKS
      
      Task ID-2431217
      COM PR odoo/odoo#67322
      ENT PR odoo/enterprise#16876
      UPG PR odoo/upgrade#2236
      3ffd6acc
  10. 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
  11. 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
  12. May 21, 2021
  13. May 20, 2021
Loading