Skip to content
Snippets Groups Projects
  1. Jan 08, 2021
    • Adrien Widart's avatar
      [FIX] mrp: reordering rules for BoM product · de40662a
      Adrien Widart authored
      
      When running the scheduler, if one of the concerned product  is a
      kit, it will always generate a RfQ for the components, even if there
      are already enough of them.
      
      To reproduce the error:
      (Need purchase)
      1. Create 2 products P and P_compo
      	- Both must be storable products
      	- P_compo must have at least one vendor
      2. Go on P-product page
      3. Add a reordering rule (e.g., min: 5 and max: 10)
      4. Add a BoM
      	- Must be a Kit
      	- Add P_compo to components
      5. Inventory > Operations > Run Scheduler
      6. Go to Purchase, find the generated RfQ
      7. Confirm the order, Receive Products, Validate
      8. Go on P-product's page
      	- As you can see, you have enough P-products on hand
      9. Repeat steps 5-6
      
      => You should not find any RfQ since you already have enough P-products.
      
      When checking the P-product's page, you can see the correct quantity on
      hand because it uses the `_compute_quantities` method and this one has been
      overridden in the mrp-module so a kit will be correctly computed.
      
      However, when running the scheduler, it uses another method to get the
      current quantities: `_compute_quantities_dict`. Since this method has
      not been overridden in mrp-module, it will use the basic implementation
      and this one does not consider the possibility for a product to be a
      kit.
      
      This fix creates an override of `_compute_quantities_dict` so it can
      compute the correct quantities of products with 'phantom' as BoM type.
      Moreover, for the code to be simpler and clearer, thix fix also merges
      `_compute_quantities` and the new `_compute_quantities_dict`.
      
      OPW-2421841
      
      closes odoo/odoo#63891
      
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      de40662a
    • nie's avatar
      [FIX] portal: Due in %d days is not translated · c8b72641
      nie authored
      Steps:
      - Install Invoicing and load French
      - Go to Invoicing
      - Click an invoice due in the future
      - Click Preview
      - Switch the preview to French by modifying the URL like this: example.com/my/invoices/6 -> example.com/fr_FR/my/invoices/6
      
      Bug:
      "Due in %d days" is still displayed in English. The rest of the page is in French.
      
      Explanation:
      This is due to two things:
      1. `mail` and `portal` are both installed and we cannot have more than one `code` translation of a source [1]. Since `mail` is loaded before, alphabetically, `portal` doesn't add the duplicated translations with its own module name. When loading a web page, only the modules returned by `_get_translation_frontend_modules_domain()` are sent to the frontend. `mail` is not one of them and the duplicated translations are not sent. Since sending all the `mail` translations is overkill, this commit is modifying the format string. This won't change the text outcome, but will make the new sources unique and make the backend send these translations to the frontend.
      2. Translations in `portal_sidebar.js` are queried before the translation DB [2] is made. This results in an empty array and `_t()` returns the source. `session.is_bound` will wait until the app is fully loaded before querying.
      
      [1] https://github.com/odoo/odoo/blob/ad2d96db8ad3e1fd7af2edda218fc34c0c1d259a/odoo/addons/base/models/ir_translation.py#L290
      [2] https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/web/static/src/js/core/translation.js#L51
      
      
      
      opw:2421501
      
      closes odoo/odoo#64254
      
      X-original-commit: 118d79192cf0fc923a121745c78e6dd0da563df0
      Signed-off-by: default avatarbackspac <backspac@users.noreply.github.com>
      c8b72641
  2. Jan 07, 2021
    • Samuel Degueldre's avatar
      [FIX] web_editor: fix icons losing classes when modifying them · 99531f5d
      Samuel Degueldre authored
      
      Previously, when double clicking and image, video, icon, or document in
      the web-editor and replacing it with a different media type, it would
      lose its custom classes. This means among other things, that it would
      lose margins and paddings from bootstrap classes, or in the case of the
      three columns snippet, that the new media would not be properly rounded
      in its top corner, or not show up at all in the case of the video. The
      only exception was when changing any media type to an icon, but in that
      case it would also keep some of the media-specific classes that are
      supposed to be removed (eg img-fluid or media_iframe_video).
      
      This commit fixes that as well as some _clear behaviour that didn't
      remove all classes that had to be removed, eg some fa-classes would
      linger depending on their order, and the o_image class from documents
      would always remain
      
      Part of: odoo/odoo#60450
      Linked to: #60432 #60443
      task-2282542
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      99531f5d
  3. Nov 10, 2020
    • Samuel Degueldre's avatar
      [FIX] web_editor: fix replacing media leaving unexpected elements · 63f80995
      Samuel Degueldre authored
      Previously, changing a media from a video/icon/document to a different
      type would leave empty elements in the DOM, this is because summernote's
      range API `range.insertNode` function deletes the content but not the
      structure (HTML elements).
      
      This commit fixes that by using jQuery's replaceWith method instead of
      summernote's insertNode when a media was found, and only using
      summernote in case no media was found (eg. a text range).
      
      Part of: odoo/odoo#60450
      63f80995
  4. Jan 07, 2021
  5. Jan 06, 2021
    • Goffin Simon's avatar
      [FIX] sale: Discount on re-invoicable product · 8815f4d9
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Let's consider a re-invoicable and expensable product P at 100€
      - Let's consider a pricelist PL with 20% of visible discount on every product
      - Let's consider a confirmed sale order SO with PL set on it
      - Create an expense E with P at 100€ and reinvoice customer set to SO
      - Generate the entries of E
      
      Bug:
      
      A new sale order line was created with 80€ as unit price and no discount instead of
      20% discount.
      
      opw:2423147
      
      closes odoo/odoo#64145
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      8815f4d9
    • Yannick Tivisse's avatar
      Revert "[FIX] google_drive: fix traceback when add filter" · a08be36a
      Yannick Tivisse authored
      
      This reverts commit 82f236d9.
      
      The fix is actually not solving all the issues, and also introduce
      a behavior change. Actually, the expected result for filters like
      
      <filter string="My Pipeline" name="my" domain="[('user_id', '=', uid)]"/>
      
      will result into a evaluated filters, but invalid as the uid is set to
      the person configuring the google configuration, not the user who will
      use it.
      
      As it is tricky (or even impossible) to solve the issue properly in all
      the cases, we prefer to warn the user that the filter is invalid instead.
      
      closes odoo/odoo#64142
      
      X-original-commit: 35fff5d26f20ad5cfacffaf9335fc8580a7f4793
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      a08be36a
    • Achraf (abz)'s avatar
      [FIX] mail: send notification mail with right access link when using mail.thread · 2b6d2b71
      Achraf (abz) authored
      
      PURPOSE
      
      Notification may be sent using a generic mail.thread record, notably when
      sending user notifications. In that case links to view document are
      incorrect.
      
      HOW TO REPRODUCE
      
      Issue
      
          - Install "Approvals"
          - Submit new approval with you as "Request Owner"
          - Click on "View Approval Request" in your mailbox
      
          The link redirects to a 505 error
      
      Cause
      
          The model is not the correct one and the res_id is undefined
      
      Solution
      
          Specify the model and the res_id to _notify_get_action_link
          when creating the link with kwargs
      
      SPECIFICATIONS
      
      Propagate message value through various notification sub methods. That way
      we can rely on them if model seems void.
      
      Also limit values given as URL parameters to some white listed values.
      
      LINKS
      
      opw-2358846
      Task ID-2379766
      Followup of odoo/odoo#60998
      Followup of odoo/odoo#61545
      Closes odoo/odoo#63292
      Closes odoo/enterprise#15585
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      Co-authored-by: default avatarAchraf Ben Azzouz <abz@odoo.com>
      Co-authored-by: default avatarThibault Delavallée <tde@odoo.com>
      2b6d2b71
    • Raphael Collet's avatar
      [FIX] core: marking of recursive computed fields · 9b788989
      Raphael Collet authored
      
      Use the right optimization when marking recursive computed fields after
      record creation: the recursive call to modified() should take the flag
      'create' that determines when to skip inversing many2one fields.  This
      saves quite a few queries when creating records with recursive computed
      fields.  This optimization is validated in Odoo 14.0.
      
      See revision 9fe4fe40.
      
      closes odoo/odoo#64125
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      9b788989
  6. Jan 05, 2021
    • Thibault Francois's avatar
      [FIX] odoo_referral: fix Error systray_odoo_referral.gift_icon not found · ec9ce84e
      Thibault Francois authored
      
      Problem
      -------
      Before commit 6304c6d0, this module
      had a JS file that was loading odoo_referral/static/src/xml/systray.xml
      The commit removed the loading code and the file, but when the sources are
      updated without restarting the server, the (cached) JS side may still try
      to access it, which will crash the loading of assets and block the UI.
      
      This make the database unusable.
      
      Solution
      --------
      Keep the file with an empty template.
      
      Also stop auto-installing the module, for new databases, as it is
      pointless.
      
      closes odoo/odoo#62840
      
      Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
      ec9ce84e
  7. Dec 29, 2020
  8. Jan 05, 2021
  9. Jan 04, 2021
    • Nicolas Galler's avatar
      [FIX] stock: run scheduler actions as super user · 397e1560
      Nicolas Galler authored
      
      In `run_scheduler`, we are running certain functions as super user to
      avoid inter company and access rights issues.  This commit adds a
      `sudo()` call to the `action_assign()` call, in case some objects
      related to the retrieved moves are not accessible.
      
      In addition a commit call is moved up to apply after the
      `procure_orderpoint_confirm` call (as it was, it was applied after the
      `_action_assign` loop, but there is in fact already a commit in that
      loop, this lead to a somewhat random behavior where the replenish rules
      were sometimes rolled back and sometimes not, depending on whether the
      first iteration of the loop errored out or not)
      
      opw-2394706
      
      closes odoo/odoo#64018
      
      X-original-commit: 7a2c23c7
      Signed-off-by: default avatarNicolas Galler <ngaller@users.noreply.github.com>
      397e1560
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] mrp: avoid blocking MO after post inventory · 074a2c9c
      Andrea Grazioso (agr-odoo) authored
      
      - Install mrp_workorder
      - Create a product P, route Manufacture, tracking by SN
      - Create 3 components
      C1 cons.
      C2 storable with SN tracking (update qty on hand)
      C3 cons.
      - Create a routing R with 5 operations (WO1, WO2...WO5).
      In all operation set
      "Start Next Operation Once some products are processed"
      - Create a BOM for P, routing R, with C1 C2 C3
      C1 consumed in operation WO1
      C2 consumed in operation WO2
      C3 consumed in operation WO5
      
      - Create a MO for P, quantity 2
      Finish WO1 and WO2 (process 2 units).
      Process 1 quantity for WO3, WO4, WO5
      Post Inventory (DEBUG mode)
      
      Process WO3: Error is raised
      "You have produced 0.0 Units of lot LOT1 in the previous
      workorder. You are trying to produce 1.0 in this one"
      Then the user is blocked.
      
      This occur because the code only looks at workorder lines
      However, they are transformed into move lines, after "POST INVENTORY".
      
      This commit takes into account this possibility, raising the
      `final_lot_quantity` to the `qty_remaining` when we detect that a Post
      inventory has occurred and the `final_lot_quantity` would be 0.
      
      opw-2415073
      
      closes odoo/odoo#63688
      
      Signed-off-by: default avataragr-odoo <agr-odoo@users.noreply.github.com>
      074a2c9c
    • Guewen Baconnier's avatar
      [FIX] core: marking of stored computed recursive fields during creation · 79634eef
      Guewen Baconnier authored
      
      Fixes 3a6ac95d that ignores computation of recursive stored fields during
      creation of records.
      
      The problem happens when we have:
      
      * a recursive stored computed field
      * an `api.depends` of this field which is a relation to another record
      
      When this "another record" is created and should recompute the recursive
      field, it is ignored.
      
      closes odoo/odoo#63979
      
      Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      Co-authored-by: default avatarRaphael Collet (rco) <rco@openerp.com>
      79634eef
    • Thibault Delavallée's avatar
      [FIX] calendar: synchronize email_from and author_id when sending email to attendees · 160d321b
      Thibault Delavallée authored
      
      When emails related to calendar events are sent email_from is set from
      templates like invite template. Author of those email is however not set
      and current user is used as default value.
      
      In this commit we do as done in templates and try to set event responsible
      as user, and fall back on current user if not set.
      
      This notably solves an issue when using website_calendar. Appointments are
      done using public user and mails have public user as author. This leads to
      emails not being accessible or having a false email_from.
      
      Task ID-2413792
      
      closes odoo/odoo#64020
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      160d321b
  10. Dec 29, 2020
  11. Jan 04, 2021
    • Rémy Voet (ryv)'s avatar
      [FIX] stock_landed_cost: efficient validate landed cost · 78584536
      Rémy Voet (ryv) authored
      
      Update the standard_price outside the loop to avoid recompute
      ` quantity_svl` at each iteration. `quantity_svl` is not modify in the
      process and the `standard_price` is not read in process.
      
       `NewPrice = OldPrice + (cost_to_add_x1) / quantity_svl + (cost_to_add_x2) / quantity_svl`
       Becomes
      `NewPrice = OldPrice + (cost_to_add_x1 + cost_to_add_x2) / quantity_svl`
      which is equals.
      
      opw-2374405
      
      closes odoo/odoo#63742
      
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      78584536
  12. Dec 23, 2020
    • Rémy Voet (ryv)'s avatar
      [FIX] stock_landed_cost: improve performance read · f812a67b
      Rémy Voet (ryv) authored
      Improve performance of SQL in  `_compute_allowed_picking_ids`.
      This one can be costly for a simple read of the `allowed_picking_ids`.
      Grouping the result to avoid useless big thoughtput and a
      add a where clause on company_id to filter out useless row.
      
      opw-2374405
      f812a67b
  13. Jan 04, 2021
    • Mohammed Shekha's avatar
      [FIX] web: list: keep line when click in m2o dropdown · 2d463306
      Mohammed Shekha authored
      
      Before this commit, in editable list views with a many2one, when
      the user clicked inside the many2one dropdown, in the padding above
      the first item or below the last item, the dropdown closed itself
      and the row was removed (if it wasn't dirty yet). This commit fixes
      that issue by ignoring clicks at those specific spots.
      
      Task 2377864
      
      closes odoo/odoo#63991
      
      X-original-commit: dd40745dfdc98e82142e64ca58c0c976f6ad8d97
      Signed-off-by: default avatarAaron Bohy (aab) <aab@odoo.com>
      2d463306
  14. Dec 31, 2020
    • Goffin Simon's avatar
      [FIX] point_of_sale: Multicompany tax · 221d6cbd
      Goffin Simon authored
      
      Steps to reproduce the bug:
      
      - Create a multi-company environment with two companies A & B
      - Create two sales taxes TA & TB, one for company A & one for company B
      - Created a shared product P and assign both TA & TB
      - Login with user having access of both companies
      - Open POS session and select P
      
      Bug:
      
      A traceback was raised
      
      opw:2422866
      
      closes odoo/odoo#63936
      
      Signed-off-by: default avatarSimon Goffin (sig) <sig@openerp.com>
      221d6cbd
  15. Dec 22, 2020
  16. Dec 31, 2020
  17. Dec 17, 2020
  18. Dec 11, 2020
    • Kamesh Patel's avatar
      [FIX] google_drive: fix traceback when add filter · 9a385c44
      Kamesh Patel authored
      
      Before this commit:
      
      When trying to add a filter in the google drive template and try to open the
      record, it shows traceback for some filter domain which contains
      'uid',  'user',  'time', 'datetime', 'dateutil', etc.. and traceback occurring
      because these are not evaluating.
      
      After this commit:
      
      This commit will prepare the context used when evaluating python code
      and now google drive template will be workable for filters.
      
      Task-2336393
      
      closes odoo/odoo#63227
      
      X-original-commit: 82f236d9
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      9a385c44
  19. Jan 03, 2021
  20. Dec 30, 2020
    • Ivan Yelizariev's avatar
      [FIX] base_data.sql: remove obsolete field size · d0ff569f
      Ivan Yelizariev authored
      those field sizes were deleted from orm definition in 2014 https://github.com/odoo/odoo/commit/026e38b48f3963aed08bba4e76a0a796d662f6a4
      
      
      
      STEPS:
      * set manifest's summary attribute to a long string
      * create empty database
      
      BEFORE: error
      
      ```
      2020-12-28 10:44:51,325 1 ERROR ? odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')
      ERROR: relation "ir_module_module" does not exist
      LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
                     ^
      
      2020-12-28 10:44:51,325 1 ERROR ? odoo.modules.registry: Failed to load registry
      Traceback (most recent call last):
        File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 86, in new
          odoo.modules.load_modules(registry._db, force_demo, status, update_module)
        File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 338, in load_modules
          odoo.modules.db.initialize(cr)
        File "/opt/odoo/custom/src/odoo/odoo/modules/db.py", line 63, in initialize
          info['sequence'], info['summary']))
        File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 173, in wrapper
          return f(self, *args, **kwargs)
        File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 250, in execute
          res = self._obj.execute(query, params)
      psycopg2.DataError: value too long for type character varying(256)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 88, in new
          odoo.modules.reset_modules_state(db_name)
        File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 558, in reset_modules_state
          "UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')"
        File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 173, in wrapper
          return f(self, *args, **kwargs)
        File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 250, in execute
          res = self._obj.execute(query, params)
      psycopg2.ProgrammingError: relation "ir_module_module" does not exist
      LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
      ```
      
      AFTER: database successfully created
      
      ---
      
      opw-2415057
      
      closes odoo/odoo#63904
      
      X-original-commit: 2a44e233
      Signed-off-by: default avatarIvan Yelizariev // IEL <yelizariev@users.noreply.github.com>
      d0ff569f
    • Ivan Yelizariev's avatar
      [FIX] im_livechat: move chat window over navbar in mobile ui · 77bed568
      Ivan Yelizariev authored
      This is a z-index fight with https://github.com/odoo/odoo/commit/702f2b93cec19fab75eca25a53aa16cf419b289e
      
      
      
      STEPS:
      * install im_livechat, website
      * start chat in mobile UI
      
      BEFORE: no way to quit from chat, because main header is always on top of chat
      header
      
      AFTER: you can quit from chat, though you cannot open menu and you don't
      see website logo before you quit from the chat.
      
      In Odoo 12 you can open menu without
      leaving a chat, though it's a buggy feature.
      
      ---
      
      opw-2412932
      
      closes odoo/odoo#63787
      
      Signed-off-by: default avatarAlexandre Kühn (aku) <aku@odoo.com>
      77bed568
  21. Dec 29, 2020
  22. Dec 28, 2020
  23. Dec 21, 2020
Loading