Skip to content
Snippets Groups Projects
  1. Jan 21, 2020
    • Tiffany Chang (tic)'s avatar
      [IMP] Mail: Add optional activity domain for systray · b786adf2
      Tiffany Chang (tic) authored
      Addition of this optional 'domain' value for systray activity related
      lines allows the restriction of which activities will be included in
      the view opened when the line is clicked on.
      
      One use case is when a model is split between 2 systray activity lines.
      In this case we most likely do not want the same activities of the
      model to show up when we click on either line. For example, say we
      have 2 modules using the same model, but the module instances of that
      model are distingushed by a field.Selection value. Then we would only
      want to show the activities related to each module when we click on
      their appropriate systray activity lines based on that field.Selection
      value.
      
      Task: 2169498
      b786adf2
    • Tiffany Chang (tic)'s avatar
      [IMP] mass_mailing_(sms): split systray activities · abaae1e4
      Tiffany Chang (tic) authored
      Due to 'mass_mailing_sms' inheriting mailing.mailing from
      'mass_mailing', activities for these two modules would show up as one
      "Mass Mailing" line in the systray. This commit adds additional logic
      to remove this "Mass Mailing" line and replace it with 2 lines: "Email
      Marketing" and "SMS Marketing" with their appropriately matching module
      icon. For consistency, when only the 'mass_mailing' module is installed,
      it will still display "Email Marketing".
      
      Task: 2169498
      abaae1e4
    • Adrian Torres's avatar
      [IMP] core: improve mapped and filtered performance · 1d139287
      Adrian Torres authored
      
      Previously, mapped was following a very naive approach, which was simply
      calling the field name passed as input for every record in a recordset,
      sequentially.
      
      The problem with this approach is that we will potentially recompute the
      same fields multiple times for differents records, when this could be
      done once per field for ALL records, and store this value in cache for
      further access.
      
      Another potential problem is that we don't take advantage of the ORM's
      prefetching to fetch all the records that are not in cache at once,
      instead of doing the same query for every record in the recordset.
      
      Yet another problem is the conversion of each cache value to a record
      format and then combining all of the individual records into a single
      recordset, which, depending on the size of the recordset, can take an
      unbelievable amount of CPU time.
      
      With this new implementation of `mapped()` we take care of all of these
      problems:
      
      This is done by first delegating `mapped()` from the model to the field,
      this mapped takes a recordset as input and it will try to batch compute
      and prefetch as much as possible for the entire recordset, but it will
      not keep these values for the actual output, it just stores everything
      in cache and then at the end, retrieves everything from the cache to
      guarantee the same order.
      
      After the mapped, the conversion from cache format to record format is
      delegated to the new `convert_to_record_multi` which will fetch all the
      ids and then perform a single browse to encapsulate all of the records
      into a single recordset with the least amount of overhead possible.
      
      Part of Task 2170344
      
      closes odoo/odoo#42611
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      1d139287
    • odooqs's avatar
      [FIX] point_of_sale: payment method name not displayed · 279d3ce0
      odooqs authored
      
      When a payment line is created, and then the order is reloaded, by the
      synchronization feature for example, the name displayed on the payment
      line is empty.
      
      This happens because the field name is not saved on the server, so
      instead of using it, we are directly taking the name of the payment
      method linked to the payment line.
      
      closes odoo/odoo#43615
      
      X-original-commit: ae4322cd81814cf4cdc462ff9d271f83ce2870c4
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      279d3ce0
    • Jeremy Kersten's avatar
      [IMP] web: remove unused controller · e18ac096
      Jeremy Kersten authored
      
      This controller is no more used, probably used in the past with calendar invitation.
      
      closes odoo/odoo#43657
      
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      e18ac096
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] website_sale_wishlist: fix pricelist assignation · 892a7a7b
      Andrea Grazioso (agr-odoo) authored
      
      Steps to reproduce:
      - Install website_sale_wishlist,stock,sale_management,contacts
      - General Settings>Sales>Multiple Sales Prices per Product
      - Create or edit a product, assign 2 different prices in pricelists A and B
      - Publish it to the website
      - If your user is Mitchell Admin, go to its related res.partner, Sales &
      Purchases tab/Pricelist, choose pricelist B
      - Create a public user and assign it pricelist A
      - Go to the website/shop
      - Reach out the product and add to the wishlist
      
      When the current user is internal the product page will display price of B,
      but if you add the product to the wishlist, whishlist displays public price
      Same for the portal user.
      This happend because to avoid returning 500 when the product is
      unpublished c93f371d the product is
      filtered using sudo() but the recordset is also returned with the sudo
      environment. Using it just to filter solve the issue
      
      opw-2166484
      
      closes odoo/odoo#43646
      
      X-original-commit: 4335f9db
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      892a7a7b
    • Aaron Bohy's avatar
      [FIX] sale_product_configurator: display multiple dialogs · 37462d8a
      Aaron Bohy authored
      
      Create a new quotation, add a row with product Customizable desk.
      The product configurator dialog opens. Click on 'Add'. A second
      dialog opens (to select optional products).
      
      Before this commit, the second dialog was displayed behind the
      first one.
      
      This bug is present since the introduction of Owl dialogs
      (34bbdd88). It is due to an override of the 'open' function that
      doesn't call _super (and thus, doesn't go through the code that
      makes the last opened dialog active).
      
      closes odoo/odoo#43424
      
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      37462d8a
    • Aaron Bohy's avatar
      [IMP] web: properly throw errors in MockServer · 7ab364b6
      Aaron Bohy authored
      Otherwise, they could be catched (by a guardedCatch) and thus would
      not make the test fail.
      7ab364b6
    • Aaron Bohy's avatar
      [FIX] web,*: fix race condition with m2o quick create · 50bf8309
      Aaron Bohy authored
      *sale,sale_product_configurator
      
      Let's assume a form view containing a many2one with an onchange
      that updates the value of a one2many. Do a quick create in the
      many2one. While the name_create request is pending, add a row to
      the one2many but do not leave it. When the name_create returns, and
      the onchange has been performed, the one2many is reset, and the row
      is no longer in edition (worse, it could be invalid, i.e. in a state
      that the user could not have reached in a normal situation).
      
      This commit fixes this issue by considering the whole [name_create +
      onchange] operation as one. This operation is executed in the mutex
      of the model, so the other request (adding a row to the one2many) is
      delayed until the many2one value has been correctly set.
      
      This fixes an issue with the sale and rental tours (on sale_order),
      that had been deactivated for a while.
      50bf8309
    • mcm-odoo's avatar
      [REF] web: pivot: use owl_compatibility tools · 01e3a599
      mcm-odoo authored
      
      This commit changes ControllerAdapter to a mixin that inherits
      WidgetAdapterMixin and RendererWrapper now extends ComponentWrapper.
      
      This commit also changes PivotController base class/mixin and uses
      the Odoo legacy custom_events because of the adapter.
      
      closes odoo/odoo#43256
      
      Related: odoo/enterprise#7744
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      01e3a599
    • mcm-odoo's avatar
      [IMP] web: WidgetAdapterMixin: add some tests · 083ba2a8
      mcm-odoo authored
      083ba2a8
    • Aaron Bohy's avatar
      ed0b5c26
    • mcm-odoo's avatar
      [IMP] web: Owl compatibility: add WidgetAdapterMixin · a8e65f22
      mcm-odoo authored
      and ComponentWrapper
      
      This commit adds the necessary tools to use when an Odoo legacy
      widget has to instantiate Owl components.
      a8e65f22
    • Aaron Bohy's avatar
      [IMP] web: Owl compatibility: add ComponentAdapter · 671a5471
      Aaron Bohy authored
      This commit adds the ComponentAdapter, an Owl component meant to
      be used as universal adapter for Owl components that embed Odoo
      legacy widgets.
      
      This component will be a precious tool during the transition phase
      of converting our JS codebase from the legacy (widget) framework to
      Owl.
      671a5471
    • Aaron Bohy's avatar
      [FIX] web: utils: fix typos in patch and unpatch · 45246a3b
      Aaron Bohy authored
      The use of 'this' to call other utils adds a restriction on the
      way utils are called from the outside:
      
        utils.patch(...); // works fine
      
        const patch = utils.patch;
        patch(...); // doesn't work
      45246a3b
    • yhu-odoo's avatar
      [FIX] survey: get certification of failure back · 1110ea43
      yhu-odoo authored
      
      PURPOSE
      
      As Certification PDF can be called on failed user input, generate a
      certification of failure in that case.
      
      SPECIFICATIONS
      
      In the survey_report_templates.xml, when user_input.quizz_passed is
      false, a certification of failure can be generated.
      
      This commit is actually about applying again 57fef7c1 that has been lost
      while performing major cleaning in survey templates.
      
      LINKS
      
      PR #42811
      Task ID 2148449
      
      closes odoo/odoo#43274
      
      X-original-commit: 6206e0e6213be14a977db028b8f4dc4f755bf11c
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      1110ea43
    • Jorge Pinna Puissant's avatar
      [FIX] account: display name of journal entries · 7fe7d0ac
      Jorge Pinna Puissant authored
      
      1- create a group payment (10 ~ 15 invoices);
      2- Open the created journal entry.
      
      The first issue we see is that the breadcrumb is too big to the size of
      the screen.
      
      3- Open the 'Reconciled Entries'.
      
      Before this commit, the screen was completely shifted and not visible.
      This occurs also because the breadcrumb is too big.
      
      Now, the references added to the name of the entry is limited to 50
      characters.
      
      opw-2166551
      
      closes odoo/odoo#43644
      
      X-original-commit: d679c75b
      Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
      7fe7d0ac
    • Damien Bouvy's avatar
      [FIX] account, base: Creating contacts from their parent or setting their parent · 2f900d4f
      Damien Bouvy authored
      
      Bug in 13.0 regarding company_id field of partners when creating them from
      their parent contact or when setting their parent.
      The field 'company_id' of res.partner is set by an onchange on 'parent_id'
      to that of it's parent; unfortunately the field is readonly if parent_id
      is set and not set to force_save.
      Furthermore, creating a child partner from the main one (in the 'Contact'
      tab of the main partner form view) does not follow the same behaviour
      (company_id is unset in that case, meaning that children don't have
      the same company as their parent).
      Since the company_id is already set by an onchange when we change 'parent_id'
      and set to readonly in that case, I assume the expected behaviour is actually
      that children partners should have the same company as their parent by default.
      
      Fine tuning of 7b49f583
      
      opw:2176384,2167106
      
      closes odoo/odoo#43621
      
      X-original-commit: 92737f21
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      2f900d4f
    • Debauche Stéphane's avatar
      [IMP] web_gantt: add documentation · e3ad9c89
      Debauche Stéphane authored
      
      Add documentation about the new gantt parameter, `dynamic_range`,
      The parameters were added in enterprise (odoo/enterprise#7640).
      
      Task #2168740
      
      closes odoo/odoo#43052
      
      Related: odoo/enterprise#7640
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      e3ad9c89
    • Victor Feyens's avatar
      [FIX] sale: discount_amount in sale report · 9a952862
      Victor Feyens authored
      
      The discount_amount didn't consider the quantity on Sales Order Line.
      
      e.g:
      
      100€ | 10% discount | 8 products
      
      --> discount_amount was 10 € instead of 80€
      
      Fixes #43242
      
      closes odoo/odoo#43624
      
      X-original-commit: b8a1370c
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      9a952862
    • Xavier Bol (xbo)'s avatar
      [IMP] base: add default image for users + placeholder if unassigned · 51b36c3d
      Xavier Bol (xbo) authored
      
      1/ When the new database is created without demo data, the admin has a
         'silhouette' as a default picture. When a new user is created without
         picture given by the current user, the new user will have a 'silhouette'
         as a default profile picture.
      
      2/ web: image for fa-user-slash. This image will be used when a record is
         unassigned.
      
      3/ web, *: Change placeholder by default when record is unassigned.
         We want to have a fa-user-slash icon when a record is unassigned instead
         of 'placeholder.png'. A method is created in the BaseModel to have a
         generic method to change easily the placeholder for other models.
      
      4/ Adapt kanban test to keep the same behaviour. Attention the behaviour is
         a bit different. Because, now the default image is given by the server to
         change easily the default image when a record doesn't have an image.
         Thus, we don't say if it's the default placeholder, but we can say it's
         not the same image of the record (in this test, the record, it's the
         partner).
      
      5/ misc: display 'Unassigned' in the hover on kanban cards if record is unassigned
      
      closes odoo/odoo#41356
      
      Taskid: 2060206
      Related: odoo/enterprise#7758
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      Co-authored-by: default avatarjdoutreloux <jud@odoo.com>
      Co-authored-by: default avatarYannick Tivisse <yti@odoo.com>
      51b36c3d
    • Adrian Torres's avatar
      [IMP] api: move cache_key to the Environment and cache it · be01db2f
      Adrian Torres authored
      
      Computing the `cache_key` turned out to be a big factor during the
      lifespan of a `BaseModel.mapped` call and a lot of this time is spent
      computing the same `cache_key` over and over.
      
      These unnecessary computations can be easily reduced to a couple by
      moving the `cache_key` method on the environment (instead of the field)
      and by implementing a memo for that method.  The rationale is that the
      `cache_key` of a field does not change for a given environment.
      
      The result of this patch is up to 50% faster `Field.__get__` which in
      turn means a GLOBAL gain in performance, especially for methods /
      functions that rely heavily on `__get__` such as `BaseModel.mapped`.
      
      closes odoo/odoo#42674
      
      Signed-off-by: default avatarAdrian Torres (adt) <adt@odoo.com>
      be01db2f
    • Adrian Torres's avatar
      [FIX] website_sale: do not pollute the environment · 8645e318
      Adrian Torres authored
      Instead of polluting an existing environment, use the method that was
      intended for changing the company `with_company` which returns a brand
      new environment and leaves the existing one unchanged.
      8645e318
  2. Jan 20, 2020
  3. Jan 14, 2020
    • Goffin Simon's avatar
      [FIX] delivery: Delivery Order Adding Freight Cost W/O Markup · 632767d8
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Let's consider a delivery method DM with fixed price of 10€ and a margin of 20%
      - Let's consider a storable product P
      - Create a SO for P and get the rate (12€) but don't add it on the SO
      - Confirm the SO and process the delivery
      
      Bug:
      
      A SO line was created for the freight cost without the margin. So it was 10€
      instead of 12€.
      
      opw:2144894
      
      closes odoo/odoo#43279
      
      X-original-commit: 621dac80
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      632767d8
  4. Jan 20, 2020
  5. Jan 17, 2020
    • Nicolas Lempereur's avatar
      [FIX] point_of_sale: 0 => +/- => backspace => 0 and not - · 74be8c0f
      Nicolas Lempereur authored
      
      When writting number on the point of sale keypad, if you click on the
      "+/-" button, you will get 0 (with buffer "-0"), but then you need to
      backspace 2 times to remove "-".
      
      This seems odd since this mean that:
      
      => "+/-" "backspace" "backspace" "5" will get 5.0 units
      => "+/-" "backspace" "backspace" "backspace" will remove line
      
      instead of what would be expected:
      
      => "+/-" "backspace" "5" will get 5.0 units
      => "+/-" "backspace" "backspace" will remove the line
      
      opw-2169157
      closes #43495
      
      closes odoo/odoo#43507
      
      X-original-commit: d3489146
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      74be8c0f
  6. Jan 20, 2020
    • Jeremy Kersten's avatar
      [IMP] base: improve log for wrong xpath · 5198b209
      Jeremy Kersten authored
      
      Before create_multi, in case of invalid syntax used in an XPath, only
      the problematic record was displayed. It was not ideal for long
      definition but still usable.
      Since the views are created using create_multi, the whole file content
      is displayed in the error traceback, making it almost impossible to
      locate on files with multiple records.
      
      closes odoo/odoo#43590
      
      X-original-commit: 8622469e
      Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
      5198b209
  7. Jan 08, 2020
  8. Jan 20, 2020
    • Rémy Voet (ryv)'s avatar
      [IMP] mrp: remove groups of post inventory button · d165a8ce
      Rémy Voet (ryv) authored
      
      Show the Post Inventory button to manufacturing users,
      also if they are not in debug mode.
      
      task-1887035
      
      closes odoo/odoo#43294
      
      Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
      d165a8ce
    • Simon Lejeune's avatar
      [REF] stock: move line: some guidelines · b9334c53
      Simon Lejeune authored
      - move all the constrains at the same place, make sure they are private
      - move all the onchanges at the same place, make sure they are private
      - move `_get_similar_move_lines` helper at the bottom of the file with
        the other helpers
      b9334c53
    • Rémy Voet (ryv)'s avatar
      [REF] stock: clean imports · 177a479c
      Rémy Voet (ryv) authored
      Clean imports of the main stock module:
      - Remove unsued import
      - Follow odoo guidelines
      - Sort them
      177a479c
    • Rémy Voet (ryv)'s avatar
      [REM] stock: remove dead-code · 53ebf749
      Rémy Voet (ryv) authored
      Remove dead code of the main stock module:
       - Unused actions
       - Unused private methods
       - Unused helper methods test
      53ebf749
    • Raphael Collet's avatar
      [FIX] expression: performance of search on one2many fields · 238e7436
      Raphael Collet authored
      
      We optimize the search on domains like `[('line_ids', 'in', ids)]`.
      The condition is rewritten `('id', 'in', ids1)` where `ids1` is the
      result of
      
          SELECT <many2one_field> FROM <comodel_table> WHERE id IN <ids>
      
      The issue is that the latter potentially returns many duplicate values.
      The fix consists in having as few duplicates as possible in `ids1`.
      
      Note that domains like `[('line_ids.foo', '=', 42)]` implicitly benefit
      from the optimization, as they are rewritten as the one above with
      
          ids = comodel.search([('foo', '=', 42)]).ids
      
      closes odoo/odoo#43574
      
      X-original-commit: a13c05fa
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      238e7436
    • Antoine Prieels's avatar
      [FIX] point_of_sale: Lost payment info · 029ee8dc
      Antoine Prieels authored
      
      Payment information for terminal transactions (payment_status,
      transaction_id & card_type) was lost when going back to the floor
      plan in pos_restaurant. Validated transactions were then considered as
      not processed yet.
      
      closes odoo/odoo#43550
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      029ee8dc
    • Sébastien Theys's avatar
      [FIX] mail: reintroduce `fatype` for message status "envelope" · 7588e3a2
      Sébastien Theys authored
      
      This was incorrectly reverted during 116057b26e71db4692280463669f3e80d813ddcc
      
      closes odoo/odoo#43564
      
      X-original-commit: 73e3afca18fae954552d8cbecb6afddf1b08539b
      Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
      7588e3a2
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] account: avoid base being included twice in group · a1c52212
      Andrea Grazioso (agr-odoo) authored
      
      Create multiple tax and assign them to the same tax group.
      Create an invoice, with two lines, each one with one tax of the group.
      Save and click on "Preview" or print invoice.
      
      The tax group will be reported applied on just the first line
      This append because of 4d62a94a.
      Reverting commit to restore the former behavior in which the tax base
      amount is added for every line in which the tax group component is
      found. While this other behavior could be an issue for some user the
      behavior is more consistent accounting-wise and the template could easily
      be changed to adapt to user needs.
      
      opw-2170069
      
      closes odoo/odoo#43553
      
      X-original-commit: 43de214b
      Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
      a1c52212
    • Damien Bouvy's avatar
      [FIX] product: incorrect super call · 4c427de6
      Damien Bouvy authored
      
      Unfortunately caught in a really wide try/except clause where it was
      completely silenced, causing a lot of stuff to be archived instead of
      deleted.
      
      closes odoo/odoo#43543
      
      X-original-commit: cfa29936
      Signed-off-by: default avatarDamien Bouvy (dbo) <dbo@odoo.com>
      4c427de6
    • qsm-odoo's avatar
      [REF] web_editor: review left-panel unknown dependency behavior · e927d1e8
      qsm-odoo authored
      
      Left panel widgets can define the widgets they depend on to be visible.
      Up to now, if such a dependency was defined but that the related widget
      was not found, the dependency was considered as not met. Now, it acts
      as if that particular dependency was not defined at all.
      
      This is useful for controlling the visibility of a generic option in the
      case of a specific snippet without having to duplicate and restrict that
      generic option.
      
      E.g. There is a generic "color" option on all snippets. For my snippet
      "hello" I only want that generic "color" option to be visible if my
      "world" option is enabled. I then add `data-dependencies="world"` on the
      generic "color" option. In the case, any other snippet than "hello" is
      used, since the "world" option does not exist there, the "color" option
      acts as if it had no dependency.
      
      closes odoo/odoo#43511
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      e927d1e8
Loading