Skip to content
Snippets Groups Projects
  1. Feb 22, 2021
    • Nicolas Lempereur's avatar
      [FIX] web_editor: can set bg position on root editor · 33fc445a
      Nicolas Lempereur authored
      
      Scenario:
      
      - go to /slides and start editing the page
      - change the position of background banner
      - save
      
      => traceback
      
      Why:
      
      The code for pan tool duplicates the target element in an overlay. In
      the given use case, it means a node with .o_editable class is created
      that will cause an error when saving because the code expect the cloned
      element to be an editor (in `RTEWidget.save()`) but it is not (and is
      eg. missing `.data('options')`).
      
      opw-2427560
      
      closes odoo/odoo#66643
      
      X-original-commit: 96c22e81
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      33fc445a
    • Tiffany Chang (tic)'s avatar
      [FIX] stock: make package level package consistent v2 · 571ebf0b
      Tiffany Chang (tic) authored
      
      Commit e5ab8cf9 missed a use case.
      
      Steps to reproduce:
      
      - Activiate "Packages" setting in Inventory
      - Configure an operation type to "Move Entire Packages"
      - Create a "Planned Transfer" picking with that operation type and add a
        package to be moved
      - Turn off "Move Entire Packages" and try set the destination
        package of the move line to nothing (False).
      
      Expected result:
      Move line has no destination package + package level is deleted as
      expected.
      
      Another bug will still exist due to the design of package_level where if
      in addition to the above use case, if a different package is used instead
      of deleting it and "Move Entire Packages" is reactived => final package
      shown in the Detailed Operations will show all move lines as being part
      of the same package even though they are not. Data appears to be correct
      in the database otherwise and a reasonable fix doesn't seem feasible for
      now so we leave this bug as is.
      
      Related to Task: 2418907
      
      closes odoo/odoo#66638
      
      Fixes: odoo/odoo#66542
      Fixes: odoo/odoo#66517
      X-original-commit: a73505dd
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      571ebf0b
    • nie's avatar
      [FIX] event_crm: prevent access rights issues on leads · 3e1cea43
      nie authored
      
      Steps:
      - Login as an admin user
      - On a fresh branch install event_crm
      - Give a "test" user access rights of "Own Document only" in the "Sales"
        app, nothing in "Events"
      - Assign any lead to "test" user
      - Login as "test" user and try to access your own leads
      
      Bug:
      Error: While parsing modifiers for button: for modifier "invisible":
      Unknown field registration_count in domain
      
      Explanation:
      The button `event_registration_action_from_lead` tries to access event
      registrations even if the user doesn't have access to events.
      
      opw:2462127
      
      closes odoo/odoo#66599
      
      X-original-commit: 29be9761
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      3e1cea43
    • Adrien Dieudonne's avatar
      [FIX] hr_work_entry: unit of period not aligned · 67272fb9
      Adrien Dieudonne authored
      
      Before this commit, 'hours' was on the next row instead of the same line.
      
      closes odoo/odoo#66640
      
      X-original-commit: 6820eef1
      Signed-off-by: default avatarPierre Paridans <pparidans@users.noreply.github.com>
      Signed-off-by: default avatarAdrien Dieudonné (adr) <adr@odoo.com>
      67272fb9
    • nie's avatar
      [FIX] payment: link to order when not connected · aac9fd5b
      nie authored
      Steps:
      - Install sales,payment
      - Go to Sales
      - Create a quotation
      - Click Actions > Generate a Payment Link
      - Browse the link in a private window
      - Pay
      
      Bug:
      The transaction is not linked to the sale order in the link table
      `sale_order_transaction_rel`
      
      Explanation:
      When not connected, the user doesn't have the rights to read the order.
      This leads `order_id` to be set to `None`:
      https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L177-L178
      When paying without `order_id`, the app is not able to make a link
      with the transactions:
      https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L276-L277
      This raises problems such as not being able to capture an amount as seen
      here:
      https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/sale/views/sale_views.xml#L254-L257
      
      
      
      If we ensure a `partner_id` is present, using `sudo` here shouldn't be a
      problem as the data is protected by the token. Everything we get from
      `order_id` should already be in the URL.
      
      opw:2451564
      
      closes odoo/odoo#66631
      
      X-original-commit: f1f73fd2
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      aac9fd5b
    • Raphael Collet's avatar
      [IMP] core: write x2many fields last · e6369c25
      Raphael Collet authored
      
      Writing on x2many field should be done last, because deleting x2many
      lines causes pending computations and updates to be flushed.  Writing on
      column fields after that inevitably adds extra update queries.
      
      We introduce an attribute `write_sequence` on fields to order fields for
      write.  The prescribed order is: all fields except monetary and x2many,
      monetary fields, x2many fields.
      
      closes odoo/odoo#65959
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      e6369c25
    • Raphael Collet's avatar
      [IMP] core: better way to set/update magic fields · 84060997
      Raphael Collet authored
      
      The goal of this change is to simplify the code managing `create_date`
      and `write_date` in methods `create()` and `write()`, and also to remove
      weird behaviors caused by the way those fields were updated.
      
      Assume we update a simple field on a record.  This adds pending updates
      for the field and `write_date`.  However, the value of `write_date` is
      not known yet: it will be updated as `NOW() AT TIME ZONE 'UTC'` in SQL.
      So `write_date` is actually given a dummy value in pending updates, and
      it is invalidated from cache, until its value is flushed to the database
      and fetched again.
      
      Now assume we access another field on the record, and that field is not
      in cache.  The prefetching mechanism will read all column fields,
      including `write_date`, and flush them first.
      
          # this adds pending updates foo: 42, write_uid: 1, write_date: False
          record.foo = 42
      
          # assume 'bar' is not in cache; this prefetches all column fields,
          # which flushes the pending updates above before reading them back
          result = record.bar
      
      We can avoid flushing pending updates if the values read from database
      do not overwrite existing values in cache.  If you assume that the value
      of a pending update is in cache (in the example, `foo: 42`), you don't
      need to flush the corresponding field.  Indeed, the value of `foo` will
      remain 42 in cache, whatever its value in the database.  This assumption
      (pending updates are in cache) is true for all fields *except* for
      `write_date`: it is invalidated from cache, and given a dummy value in
      pending updates.  This branch actually makes this assumption true for
      all fields.  The avoidance of flushing pending updates will be done in
      another commit.
      
      In order to directly assign `write_date` its value, we use a cache for
      the value `NOW() AT TIME ZONE 'UTC'` from the database.  This costs at
      most one query per transaction, and potentially saves a few queries.
      
      Co-authored-by: default avatarVictor Feyens <vfe@odoo.com>
      84060997
    • Raphael Collet's avatar
      [FIX] *: query counts · 75d2f995
      Raphael Collet authored
      Adapt some query counts to their optimal value, in order to measure the
      effect of the following commits on queries.
      
      In module test_performance, some query counts were actually not correct:
      the initial flush() done by the context manager assertQueryCount() may
      prefetch some data to the cache, and that prefetching is not accounted
      for in the query count.  This is very true when assertQueryCount() is
      preceded by a cache invalidation.  We have to move the invalidation
      inside the context manager, so that the prefetching is now counted.
      75d2f995
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] website: show thumbnails for img gallery in tabs snippet · 371ae55a
      Andrea Grazioso (agr-odoo) authored
      
      - Go to the website
      - Drag a "Tabs" block on the page, you will have 3 example tabs
      - Click on the tab "Contact" and drag in the block "Image Gallery"
      - Add multiple images to the image gallery
      - Click on one of the other tabs so that the image gallery is hidden
      - Save
      
      The image gallery do not have the thumbails anymore.
      This occurs because when the carousel-indicator is hidden, jquery is not
      able to fetch its real length, so no icons are added.
      
      opw-2438513
      
      closes odoo/odoo#66608
      
      X-original-commit: eeb6eea9
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      371ae55a
    • Benjamin Frantzen (bfr)'s avatar
      [FIX] l10n_be_edi: only add the pdf to the xml if it exists · edc76b5f
      Benjamin Frantzen (bfr) authored
      
      Before this commit, in some cases the attachment of the Belgian EDI might not exist any longer when printing the pdf, which caused a crash when trying to embed it into the xml.
      
      closes odoo/odoo#66605
      
      X-original-commit: ec72e3f0
      Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
      Signed-off-by: default avatarbfr-o <bfr-o@users.noreply.github.com>
      edc76b5f
    • Aaron Bohy's avatar
      [FIX] web: correctly close confirm dialog · c14622fc
      Aaron Bohy authored
      
      Let's assume the following scenario:
       - have an action in target new (e.g. a form view)
       - in the dialog, have an action/object button with confirm
         attribute
       - when clicking on that button, a confirm dialog opens
       - if validated, the following action returned by the server
         is again an action in target new
      
      Before this commit, the confirm dialog remained in the DOM.
      
      This issue occurred because it's parent wasn't correctly set (wrong
      use of `this`), so when the first dialog was destroyed, the confirm
      dialog wasn't automatically destroyed in turn.
      
      OPW~2440712
      
      closes odoo/odoo#66597
      
      X-original-commit: 98f9cb4f
      Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
      c14622fc
    • Nicolas (vin)'s avatar
      [IMP] account: add mail template for send&print credit note · 7c9c9e39
      Nicolas (vin) authored
      
      There is only a single mail template for invoices at the moment.
      To make things easier to work with, this will add a new template for
      credit notes.
      
      Task id #2343331
      
      closes odoo/odoo#58244
      
      Signed-off-by: default avatarWilliam André (wan) <wan@odoo.com>
      7c9c9e39
    • Mohammed Shekha's avatar
      [FIX] web: fix issue of notebook page with invisiblity modifier · 43ada221
      Mohammed Shekha authored
      
      before this commit: when there is only one page in the notebook tag and
      there is a boolean field in form to show/hide that notebook page based on
      invisibility attrs, if we toggle boolean field notebook hides, that's OK
      but when we toggle boolean field again then notebook page is displayed but
      it is not active and due to that content of notebook page is not displayed.
      
      after this commit: when there is only one page in notebook and it has attrs
      for invisibilty, when we toggle boolean field to hide/show notebook page
      then notebook page as well as content is toggled.
      
      task-2449053
      
      closes odoo/odoo#66582
      
      X-original-commit: a0b5ecd3
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      43ada221
  2. Feb 19, 2021
  3. Feb 22, 2021
    • Géry Debongnie's avatar
      [FIX] web: race condition in crash manager test · 02a75a56
      Géry Debongnie authored
      
      Since commit 2716828f, the error dialog
      has an additional JS lib dependency, which means that it may needs to
      perform a request before it opens up. However, a test in the
      crashmanager was only waiting for a next tick, which is possibly too
      short for a network request.
      
      So, depending on the network speed (and on the test order), this test
      could fail. To fix it, we simply make sure that the test also wait for
      the library to be loaded
      
      closes odoo/odoo#66546
      
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      02a75a56
  4. Feb 18, 2021
  5. Feb 09, 2021
  6. Feb 19, 2021
  7. Feb 17, 2021
    • Mohammed Shekha's avatar
      [FIX] web: do not display cover images in sample data · 8aecb159
      Mohammed Shekha authored
      
      Before this commit, in sample mode, cover images might be displayed
      in kanban views. It isn't what we want as those images are real
      images from the database, not sample ones, but randomly linked to
      the sample records (the id of many2one fields is randomly generated).
      
      This commit tweaks the SampleServer to always set many2one fields
      pointing to model 'ir.attachment' to false.
      
      task-2368505
      
      closes odoo/odoo#66381
      
      X-original-commit: f7b2a582
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      8aecb159
  8. Feb 19, 2021
  9. Feb 18, 2021
  10. Feb 17, 2021
  11. Feb 19, 2021
  12. Feb 18, 2021
    • Francois (fge)'s avatar
      [IMP] base: add sourcemap support for CSS files. · 4627c224
      Francois (fge) authored
      
      Improve the development experience in debug=assets mode by reducing the
      number of requests to the server. We are adapting the solution used for
      the JS files to the CSS files. This solution consists of no longer
      sending all the files separately, but sending only the bundles
      associated with their sourcemap. This allows us to keep the same
      debugging experience while drastically reducing the number of requests
      to the server.
      
      Benchmark:
      saas 14.2                   917 requests    domcontentloaded after 3.76s
      master (bundling du js)     299 requests    domcontentloaded after 2.03s
      branch (bundling js+css)    36  requests    domcontentloaded after 1.01s
      
      Task id : 2463840
      
      closes odoo/odoo#66169
      
      Related: odoo/design-themes#453
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      4627c224
  13. Feb 19, 2021
  14. Feb 18, 2021
  15. Feb 19, 2021
    • Francois (fge)'s avatar
      [FIX] base: properly renegerate assets in debug=assets · f22cf20b
      Francois (fge) authored
      
      Recently, the debug=assets mode was changed to use a bundle with
      sourcemap instead of serving static files.  Therefore, when someone
      modifies a javascript file, refreshing the browser does not load the new
      code anymore.
      
      We did not notice that because this is only an issue when the server is
      not started in dev mode.  In dev=all (or xml), the assets code does not
      use a cache and checks everytime the file checksum number to determine
      if a new bundle needs to be done.
      
      It is probably not common for developers to modify source code
      without restarting the server and/or using dev=all, but it is a case
      that is easy to handle anyway: we just need to make sure that in
      debug=assets, the assets code does not use the cache and checks directly
      the files checksum.
      
      closes odoo/odoo#66460
      
      Signed-off-by: default avatarGéry Debongnie (ged) <ged@openerp.com>
      f22cf20b
  16. Feb 18, 2021
    • Martin Trigaux's avatar
      [FIX] mail: translate report name field · 7124d701
      Martin Trigaux authored
      
      When genrating an attachment in a mail message (e.g. the pdf attached
      to a confirmation email), the filename was not translated into the
      language of the recipient (unlink the email content).
      
      The variable `template` has the contact language in the context while
      `self` contains the language of the user executing the action.
      
      Fixes odoo/odoo#66420
      
      closes odoo/odoo#66498
      
      X-original-commit: 6001e758
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      7124d701
  17. Feb 19, 2021
  18. Feb 18, 2021
    • Anh Thao Pham (pta)'s avatar
      [FIX] sale_timesheet: fix (re-)invoiced amount computed as other revenue · 99101cbd
      Anh Thao Pham (pta) authored
      
      - Install sale_timesheet and hr_expense
      - Create a Service Product with "Create a task in sales order's project" as Service Tracking (i.e. Service X)
      - Create a Product with "Can be Expensed" and "At cost" as "Re-Invoice Expenses" (i.e. Expense X)
      - Create a SO with Service X (i.e. Unit Price: 50.0) and confirm it
      - Go to Expenses and create an Expense:
        * Product: Expense Y
        * Unit Price: 25.0
        * Customer to Reinvoice: [select the created SO]
      - Create Report, Approve and Post journal entries
      - From SO, create an Invoice (Service Y + Expense Y) and confirm it
      In Project Overview, the expense is computed in Other Revenues and
      Re-invoiced costs. Therefore, the amount of the expense is added twice
      in the Profitability total.
      In Project > Reporting > Project Costs and Revenues, for Project linked
      to SO, Untaxed Amount Invoiced and Untaxed Amount Re-Invoiced are also
      computed in Other Revenues.
      
      opw-2444237
      
      closes odoo/odoo#66490
      
      X-original-commit: 4d9305d1
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      99101cbd
Loading