Skip to content
Snippets Groups Projects
  1. May 30, 2021
  2. May 28, 2021
  3. May 27, 2021
    • nie's avatar
      [FIX] mail: use template lang on layout and display name · 74da8e27
      nie authored
      
      Steps:
      - Install sale
      - Go to Settings / Translations / Languages
      - Activate Dutch
      - Go to Settings / Users & Companies / Users
      - Edit demo
        - Language: Dutch
      - Go to Sales
      - Create a quotation:
        - Customer: demo
      - Go to Settings / Technical / Automation / Scheduled Actions
      - Create a new action:
        - Model: Sales Order
        - Python code:
        ```python
        last_id = model.search([], order='id desc', limit=1)[0].id
        env.ref('sale.email_template_edi_sale').send_mail(last_id, notif_layout='mail.mail_notification_paynow')
        ```
      - Click "Run Manually"
      - Go to Settings / Technical / Email / Emails
      - Open the last email you just sent
      
      Bug:
      Parts of the email are not in Dutch
      
      Explanation:
      This commit makes a template pass the rendering language to the layout
      and the display name when calling `template.send_mail()`.
      
      opw:2467640
      
      closes odoo/odoo#68656
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      74da8e27
  4. May 28, 2021
  5. May 20, 2021
  6. May 28, 2021
  7. May 24, 2021
  8. May 05, 2021
    • Joseph Caburnay's avatar
      [FIX] point_of_sale: double dipping in COGS and stock delivered accounts · 74e12f9a
      Joseph Caburnay authored
      
      To reproduce:
      
      1. Sell an anglo product (inventory valuation = automated) in the pos app.
      2. Go back to the backend, find the pos.order and invoice it.
      3. Close the session.
      4. Open the journal items related to the session (click the Journal Items
      button in the session form).
      5. You will see COGS (Expenses) Account and Stock Interim (Delivered) are
      debited in two journal entries - one from the invoice and one from the
      created picking after the closing of session.
      
      This is because we are not properly skipping the invoiced order when
      generating the global picking for the session. This commit fixes the
      described issue.
      
      closes odoo/odoo#70374
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      74e12f9a
  9. May 27, 2021
    • Ivan Yelizariev's avatar
      [FIX] core: fix formatting issues for --test-tags docs · fcc60e21
      Ivan Yelizariev authored
      
      `./odoo-bin -h` prints unnecessary spaces between sentences.
      
      ---
      
      task-2431630
      Finetuning of #71130
      
      closes odoo/odoo#71331
      
      Signed-off-by: default avatarVictor Feyens (vfe) <vfe@odoo.com>
      fcc60e21
    • xO-Tx's avatar
      [FIX] website, web_editor: fix colorpicker preview · fd31c9a1
      xO-Tx authored
      Issue:
      
      > Set bg color combination for a snippet... > Save
      > Edit mode > Select the snippet
      > Open color palette in bg option
      > Hover a color option
      > When a color button is left, the preview is cancelled
        but the color combination class is not applied anymore.
      
      In '_computeWidgetState' (for 'selectStyle' method), the right
      value ('o_cci') is not returned because we get empty "colorNames"
      (the "colorPalette" is not rendered on start).
      
      The goal of this commit is to fix this behaviour by rendering the
      colorPalette in start for snippet options, this way, the new code
      won't affect the speed fix added in [1] for 'OPTIONS' tab.
      
      [1]: https://github.com/odoo/odoo/pull/65223/commits/ce54c3f21293513673cb1fc6073ada5f0a2b5641
      
      
      
      task-2538326
      
      closes odoo/odoo#71174
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      fd31c9a1
    • Ivan Yelizariev's avatar
    • Alvaro Fuentes's avatar
      [FIX] core: correct imports from `odoo.addons.base.maintenance.migrations` · 0d0458a0
      Alvaro Fuentes authored
      
      This legacy package was supposed to be an alias to `odoo.upgrade`.
      However, depending on how your import its sub-packages (and in which
      order), we were ending with the module being loaded multiple times,
      breaking the expectation of a singleton.
      
      ```python
      In [1]: from odoo.addons.base.maintenance.migrations import util as m1
      
      In [2]: import odoo.addons.base.maintenance.migrations.util as m2
      
      In [3]: m1
      Out[3]: <module 'odoo.upgrade.util' from '/Users/chs/devel/odoo/odoo/stable/odoo/addons/base/maintenance/migrations/util.py'>
      
      In [4]: m2
      Out[4]: <module 'odoo.addons.base.maintenance.migrations.util' from '/Users/chs/devel/odoo/odoo/stable/odoo/addons/base/maintenance/migrations/util.py'>
      
      In [5]: from odoo.addons.base.maintenance.migrations import util as m3
      
      In [6]: m3
      Out[6]: <module 'odoo.addons.base.maintenance.migrations.util' from '/Users/chs/devel/odoo/odoo/stable/odoo/addons/base/maintenance/migrations/util.py'>
      
      In [7]: m2 == m3
      Out[7]: True
      
      In [8]: m1 == m3
      Out[8]: False
      
      In [9]:
      ```
      
      Now, with this import hook, we ensure that the modules imported from
      `odoo.addons.base.maintenance.migrations` are aliases to ones imported
      from `odoo.upgrade`.
      
      ```python
      In [1]: import odoo.addons.base.maintenance.migrations.util as m2
      
      In [2]: m2.__name__
      Out[2]: 'odoo.upgrade.util'
      ```
      
      closes odoo/odoo#71323
      
      X-original-commit: b2ea37f1
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      Co-authored-by: default avatarChristophe Simonis <chs@odoo.com>
      0d0458a0
    • Anh Thao Pham (pta)'s avatar
      [FIX] stock_account: fix computation of anglo saxon price unit · 83136c8e
      Anh Thao Pham (pta) authored
      
      - Create a product with Category configured with:
        * Costing Method: First In First Out (FIFO)
        * Inventory Valuation: Automated
      - Create a PO to buy 2 units at $100 (PO1) and receive the products
      - Create a SO to sell 2 units (SO1) and deliver the products
        => COGS of SO1 should be $200 ($100 * 2)
      - Return 1 unit from previous delivery
        => COGS of SO1 should be $100
      - Create a SO to sell 1 unit (SO2) and deliver product
        => COGS of SO2 is $100
      - Create a PO to buy 1 unit at $200 (PO2) and receive the product
      - Re-deliver the returned unit from SO1
        => COGS of SO1 should be $300 ($100 + $200)
      - Create invoice for SO1 and post it
      The journal items (account.move.line) corresponding to the COGS have an incorrect
      value: $200 ($100 + $100), instead of $300 ($100 + $200)
      
      The issue comes from the method computing the anglo saxon price unit.
      It does not take into account quantities from stock moves that have been returned.
      
      This commit computes the number of units that have been returned for each stock
      moves used to compute the anglo saxon price unit and to take the result into account
      during the computation (of the anglo saxon price unit).
      
      opw-2501260
      
      closes odoo/odoo#71317
      
      X-original-commit: 4d3147a0
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      83136c8e
  10. May 11, 2021
  11. May 27, 2021
  12. May 26, 2021
    • Fabien Meghazi's avatar
      [FIX] server: prevent inotify watches leak · e5bd3780
      Fabien Meghazi authored
      Before this commit the PyInotify filesystem watcher used by the code
      autoreload feature (`--dev=reload`) would not get a chance to free
      it's inotify watches before the reexec, hence at each reexec triggered
      by a code reload the inotify watches where accumulated until potentially
      reaching the kernel limit `fs.inotify.max_user_watches`.
      
      This patch ensures that inotify properly closes it's file descriptor
      before we reexec:
      https://github.com/dsoprea/PyInotify/blob/f77596a/inotify/adapters.py#L79
      
      
      
      closes odoo/odoo#71284
      
      X-original-commit: 8703ff1e
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      e5bd3780
    • nie's avatar
      [FIX] base: remove non-fictional number from demo data · 79d3cf45
      nie authored
      Steps:
      - Install Website
      - Go to Website
      - Click "Go to Website"
      
      Bug:
      The default phone number on the website is not fictional and may cause
      unwanted spam.
      
      Explanation:
      In North America, only 555-0100 through 555-0199 are specifically
      reserved for fictional use.
      > The industry also reserved a block of 100 numbers as fictitious,
      > non-working numbers (555-0100 through 0199) for use by the
      > entertainment and advertising industries.
      
      Source: https://www.nationalnanpa.com/pdf/NRUF/ATIS-0300115.pdf
      
      
      
      opw:2530388
      
      closes odoo/odoo#71281
      
      X-original-commit: 5a047574dde6b207697244c866749d3cd439922c
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      79d3cf45
    • Adrien Widart's avatar
      [FIX] mrp: use work center's TZ to plan operations · 012de9c8
      Adrien Widart authored
      
      When planning a Manufacturing Order, if an operation takes place in work
      center with a different time zone, the computed date may be incorrect
      (the start date may be outside the working hours)
      
      To reproduce the error:
      (Use demo data. Current timezone: Europe/Brussels)
      1. In Settings, enable "Work Orders"
      2. Open an existing Work Center
      3. Click on "Standard 40 hours/week"
      4. Set Timezone to "Asia/Bangkok"
          - Note that all slots are between 8:00-12:00 and 13:00-17:00
      5. Create two storable products P_compo and P_finished
      6. Create a Bill of Materials BM:
          - Product: P_finished
          - BoM Type: Manufacture this product
          - Components: 1 x P_compo
          - Operations: 3 x Operation with existing work centers
      7. Create a Manufacturing Order:
          - Bill of Material: BM
          - Quantity: 100
      8. Save, Confirm, Plan
      
      Error: (it depends on the time the test is done) The 'Scheduled Start
      Date' of the second operation is incorrect. Adding the time zone
      difference gives a time that is outside the work center's timetable
      (i.e., outside 8:00-12:00 and 13:00-17:00).
      
      The computations do not consider the time zone of the work center.
      
      OPW-2393330
      
      closes odoo/odoo#70841
      
      Related: odoo/enterprise#18524
      Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
      012de9c8
  13. May 25, 2021
  14. May 26, 2021
  15. May 18, 2021
    • Younn Olivier's avatar
      [FIX] portal: fix copyright color on the portal · d2e93463
      Younn Olivier authored
      
      Before this commit, for default colors, the text-muted class color was
      set as !important from the portal and could not be overriden by the
      website, leading to inconsistent display between the website and the
      portal for the copyright.
      
      As a fix for stable, we do not change the text-muted color from the
      portal when using default colors.
      
      task-2468472
      
      closes odoo/odoo#70538
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      d2e93463
  16. May 26, 2021
    • Robin Heinz's avatar
      [FIX] point_of_sale: Load all existing Payment Method but displayed linked ones · e44219b1
      Robin Heinz authored
      
      Before, when using the manage order, if a payment method was used and then removed from the pos.config,
      we couldn't load the old order anymore because of unknow reference.
      To fix this, we load all methods at the opening of the pos but when we display the payment methods we only show those in the pos.config.
      
      closes odoo/odoo#71263
      
      Task-id: 2541708
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      e44219b1
    • Adrien Widart's avatar
      [FIX] mrp: use correct UoM for each component in MO · aff3a2e0
      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#71146
      
      Signed-off-by: default avatarSteve Van Essche <svs-odoo@users.noreply.github.com>
      aff3a2e0
  17. May 25, 2021
    • Joseph Caburnay's avatar
      [FIX] point_of_sale: show pack lot input popup when scanning product · ff58fb0f
      Joseph Caburnay authored
      
      When scanned product is tracked by lot or SN, the popup that asks
      for lot should be shown, just like as when a tracked product is clicked
      from the product list.
      
      We accomplish this by introducing a new method that can be used both
      by `_clickProduct` and `_barcodeProductAction`, and by making the
      `_barcodeProductAction` be independent from `scan_product` method
      from `PosModel`. So instead of calling directly `scan_product`, we
      indentify the product first based on the barcode, then we call the
      newly introduced method to ask for the lot inputs, then we call
      `add_product` with proper options including the type of the parsed
      barcode.
      
      closes odoo/odoo#71209
      
      Signed-off-by: default avatarpimodoo <pimodoo@users.noreply.github.com>
      ff58fb0f
    • Joseph Caburnay's avatar
      [FIX] point_of_sale: compare the quantity to number type · 02d9b51e
      Joseph Caburnay authored
      When identifying whether to show the decrease quantity popup or not,
      the current quantity of the selected orderline is compared to the
      new input quantity. This fix properly compares the current quantity
      to the new input quantity in number format.
      02d9b51e
    • Joseph Caburnay's avatar
      [FIX] point_of_sale: dot input should be recognized even at different lang · a37935b4
      Joseph Caburnay authored
      Language such as FR recognizes `,` as the decimal separator. However, it is
      possible that the keyboard setting is American so the decimal point in the
      numpad will send `.` when pressing it. POS should be able to recognize both.
      This fix allows `.` sent from keyboard to be interpreted as decimal separator
      even at language where the decimal separator is `,`. This is okay because
      number inputs in POS doesn't take into account the thousand separator.
      a37935b4
  18. May 26, 2021
    • Nicolas Lempereur's avatar
      [FIX] mail,test_mass_mailing: unblacklist with mass mailing · 965c67cb
      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#71239
      
      X-original-commit: 8ffd8224
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      965c67cb
    • Guewen Baconnier's avatar
      [FIX] stock: fix check of package all in move lines · d53d8bdf
      Guewen Baconnier authored
      
      The `groupby` function is used to builds groups of(product, lot) keys
      and their corresponding move lines / quants. `groupby` groups
      *consecutive* keys, which is why the input is sorted by the keys.
      
      `sorted` on recordsets keys will not sort as we would expect in this
      particular situation, as the comparison operators on records act as
      Set Comparison operators on the record ids, i.e. to compare the sets
      superset/subset relationships:
      
      ```
      >>> env["product.product"].browse(1) < env["product.product"].browse(2)
      False
      >>> env["product.product"].browse(1) < env["product.product"].browse([1, 2])
      True
      ```
      
      Example of sorted on stock.move.line records, where the product id 7313
      is both in the slots 4 and 12 instead of being consecutive:
      
      ```
      >>> [l.product_id.id for l in sorted(lines, key=itemgetter('product_id'))]
      [7436, 7437, 7352, 7423, 7313, 7351, 7423, 7424, 7320, 7398, 7312, 7352, 7313, 7436, 7437, 7442, 7443, 7320, 7423, 7424, 7318, 7396, 7368, 7355, 7316]
      ```
      
      Now when we group by id the 2 ids 7313 are correctly placed together in
      slots 1 and 2:
      
      ```
      >>> [l.product_id.id for l in sorted(lines, key=attrgetter('product_id.id'))]
      [7312, 7313, 7313, 7316, 7318, 7320, 7320, 7351, 7352, 7352, 7355, 7368, 7396, 7398, 7423, 7423, 7423, 7424, 7424, 7436, 7436, 7437, 7437, 7442, 7443]
      ```
      
      This commit aims to sort by "id" of the related records, to ensure the
      same (product, lot) couples are consecutive.
      
      closes odoo/odoo#71126
      
      X-original-commit: 3317249d
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      d53d8bdf
  19. May 25, 2021
  20. May 26, 2021
    • std-odoo's avatar
      [REV] mail: fix a traceback when sending a message in a "email channel" · 123dce51
      std-odoo authored
      
      Bug
      ===
      Since 4da64b3f , if multiple users of
      different companies are in the same channel, and if the type of the
      channel is "email", a traceback is raised when sending a message.
      
      Technical
      =========
      "with_user" drop the SU flag and is not enough to bypass the multi
      company ACLs. Moreover, we do not want to send a "channel_seen" bus
      notifications and we can mark the message as seen on the JS side
      directly.
      
      Changes
      =======
      So now, the traceback is not raised anymore in that case, and the
      message is marked as seen if the receiver has the web client open.
      
      But, if the receiver has not the web client open, when he will login,
      the message will not be marked as seen. This can be improved but at the
      moment we just want to revert the fix that cause the traceback and fix
      the issue in most cases.
      
      Task 2427790
      
      closes odoo/odoo#65185
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      123dce51
  21. May 25, 2021
    • Alvaro Fuentes's avatar
      [FIX] core: fix filtered_domain for hierarchical terms · cb996aef
      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#71233
      
      X-original-commit: e7a5ba95
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      cb996aef
  22. May 21, 2021
  23. May 12, 2021
    • Nasreddin (bon)'s avatar
      [FIX] survey: display right date format in datepicker · f3c5dd79
      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#70273
      
      X-original-commit: ddfcecc6
      Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
      f3c5dd79
Loading