Skip to content
Snippets Groups Projects
  1. Dec 05, 2022
  2. Dec 04, 2022
  3. Dec 03, 2022
  4. Dec 02, 2022
    • Antoine Guenet's avatar
      [FIX] web_editor: show the correct alignment in toolbar when in link · a3bb5b0c
      Antoine Guenet authored
      
      The `align` command applies the alignment to the closest block of the
      selected node. Bootstrap sets the default alignment of `.btn` to
      `center` but we don't support links with a width that is larger than
      their contents so that alignment is not visible. For these two reasons,
      we want the toolbar to show the alignment of a link's closest block
      rather than that of the link itself.
      
      closes odoo/odoo#106772
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      a3bb5b0c
    • Antoine Guenet's avatar
      [FIX] web_editor: properly apply alignment to links · 0a4eb266
      Antoine Guenet authored
      When the selection was in a link, the alignment buttons didn't work.
      That is because they are supposed to align the parent paragraph, which
      is temporarily in a contenteditable=false context when the selection is
      in a link. This restores the context before applying an editor command,
      and restores it afterwards.
      
      task-3083748
      
      Part-of: odoo/odoo#106772
      0a4eb266
    • JordiMForgeFlow's avatar
      [FIX] purchase_mrp: filter cancelled moves when evaluating kit · 9659683d
      JordiMForgeFlow authored
      
      The current behaviour does not filter the cancelled moves when
      evaluating if the product of the purchase order line is a kit.
      This causes that, in cases where you have a cancelled wrong receipt
      where the product was being received as a kit, if a new receipt is
      created without receiving as a kit Odoo will always expect it as a kit.
      
      After the fix, the cancelled moves will not be considered, as this is what
      should be expected from cancelled operations.
      
      closes odoo/odoo#107090
      
      X-original-commit: 436299ee
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      9659683d
    • Guillaume (gdi)'s avatar
      [FIX] website: prevent deadlock on editor restart · 30f710e8
      Guillaume (gdi) authored
      
      Before this commit, a deadlock caused the editor not to restart
      correctly when there is an invisible element on a page. The error is
      visible by following these steps:
      
      - Edit a website page
      - Click on the footer
      - Toggle off the page visibility option
      - Click on the navbar
      - Change the template
      - The editor has to restart so click on "OK"
      
      => The Odoo top bar stays in edit mode and the user is not able to
      modify the page.
      
      Technical information:
      When entering edit mode via the URL (enable_editor) the `WebsiteNavbar`
      is not yet `ReadyForActions` because it is waiting for its sub-component
      `EditPageMenu` to start edit mode. Then invisible snippets options start
      (so the `VisibilityPageOptionUpdate` too). But for `isShown()` to work,
      the navbar must be `ReadyForActions`. This is the reason why we can't
      await for `isShown()` in the start of the option, otherwise we would
      have a deadlock. On one hand the `WebsiteNavbar` waiting for the
      invisible snippets options to be started to be `ReadyForActions` and on
      the other hand the `VisibilityPageOptionUpdate` option which needs the
      `WebsiteNavbar` to be `ReadyForActions` to be started.
      
      Related to opw-2971181
      
      closes odoo/odoo#107062
      
      X-original-commit: 6ae53175
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      30f710e8
    • Guillaume (gdi)'s avatar
      [FIX] web_editor: do not update the options when destroying them · de3c29fa
      Guillaume (gdi) authored
      Since [this commit] it is visible that there is a race condition in the
      editor. The race condition was caused by a call for an update of the
      option visibility during the save, but the options may be in the
      destruction process. This commit prevents the visibility of the options
      from being updated when the option destruction process begins.
      
      Steps to reproduce the bug fixed by this commit:
      - Drop 2 times the image - text block on a page
      - Drop a popup block
      - Save
      
      => During the save, a traceback occurs.
      
      [this commit]: https://github.com/odoo/odoo/commit/686e011f9b54bcfe93cc22db24435d2ca9213664
      
      Related to opw-2971181
      
      X-original-commit: 17af7977
      Part-of: odoo/odoo#107062
      de3c29fa
    • Guillaume (gdi)'s avatar
      [FIX] website: allow to have all pages popups with a slide hover footer · 2b0d995a
      Guillaume (gdi) authored
      
      Before this commit, the popup snippet was not displayed correctly if it
      had to be displayed on all pages and the footer was a slide hover
      footer. This commit just permits disabling the footer effect while the
      popup is displayed.
      
      Steps to reproduce the bug:
      - Drop some block on a page
      - Set the the footer Slideout Effect to "slide hover"
      - Add a popup and set it to be displayed on all pages
      - Save
      
      => The page is blocked when the popup appears.
      
      opw-2971181
      
      X-original-commit: bae2c6e9
      Part-of: odoo/odoo#107062
      Co-authored-by: default avatarRomain Derie <rde@odoo.com>
      Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
      2b0d995a
  5. Dec 01, 2022
    • dbkosky's avatar
      [ADD] l10n_ke_edi_tremol: KE fiscal device · cabbf892
      dbkosky authored
      
      This module implements communication with the fiscal device for
      submitting invoices to the KRA (Kenya Revenue Authority). The device
      supported in this module is the Tremol G03.
      
      -- COMMUNICATION FLOW SUMMARY --
      1. "Send Invoice To Device" on account move is clicked
      2. l10n_ke_action_cu_post triggers a client action, with serialised
         invoice data. (more details below)
      3. The client action uses the 'post_send' function defined in javascript
         to forward the request to the /hw_proxy/l10n_ke_cu_send endpoint on
         the proxy server (more details below)
      4. The proxy server wraps the serialised data with the appropriate bytes
         (for instance, a couple of a checksum bytes), and sends them to the
         device through serial communication (more details below)
      5. The data returned from the fiscal device is communicated back in the
         request. The client action 'post_send' then triggers the
         'l10n_ke_cu_response' with an rpc call, with the aforementioned data
         from the fiscal device
      
      (more details)
      2. The module l10n_ke_edi_tremol inherits from the account_move model in
      order to provide methods for serialising the data of the account_move
      and sending it to the proxy server. Fields have been added to the
      product template to define the HS Code and HS Name (data which is
      required by the KRA in some circumstances). A field has also been added
      to the company defining the address of the proxy server. The fields
      added on the account move are populated by the data returned by the
      fiscal device, this includes the device serial number, the invoice
      number on the device, the URL of the invoice on the KRA web portal, and
      the date/time the invoice was signed.
      
      3. Communication between the client database and the proxy server is
      defined using a client action defined in
      l10n_ke_edi_tremol/static/src/js/send_invoice.js. This allows users who
      aren't on-premise to communicate with the device, provided the proxy is
      accessible on the network that the user is on.
      
      4. The proxy server is an intermediary server that should be connected
      to the tremol G03, and running the IOT drivers from hw_drivers. The
      driver that supports communication between the proxy server and the
      fiscal device has been defined in this commit inside of
      hw_drivers/iot_handlers/drivers//L10nKeEDISerialDriver.py.
      The proxy server can be run on the IOT box, or on odoo community by
      running:
      ./odoo-bin addons-path=.... -d dbname --load hw_drivers --proxy-mode
      
      ** all messages are encoded/decoded with cp1251, as defined in the
      protocol. The company vat code is sent along with the request to compare
      that sent with that of the device. The 'serial_number' of the device is
      always returned along with the request, since it is required for the
      invoice details, and it is retrieved as part of the query to find the
      registered VAT code on the device.
      
      --- DATA and VIEWS ---
      product_view:
      adds HS Name, and HS Code on the product product and product template
      form views.
      
      report_invoice:
      adds to the invoice qweb template such that a section including the
      fiscal device / KRA details is included at the bottom of the invoice
      when the invoice is rendered as a pdf.
      
      res_config_settings_view:
      adds makes the proxy address field editable from the config settings.
      
      account_move_view:
      add a tab for the tremol device details and the qr code on the account
      move form view. The KRA invoice number is also added as an optional
      field on the account move tree view, and the invoice search view is
      inherited to make this field searchable too.
      
      (l10n_ke) account_tax_report_data, account_tax_template_data:
      The tax report is defined for Kenya, and tax tags that link to the lines
      on this tax report are defined on the existing taxes. This allows the
      classification of the tax, between zero-rated and exempt, during the
      serialisation.
      
      closes odoo/odoo#107044
      
      Task-id: 2950308
      Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
      cabbf892
    • Romain Derie's avatar
      [FIX] website, test_website: prevent fuzzy search to crash with inherits · 700ee3d1
      Romain Derie authored
      This commit ensures that when searching on a `inherits` field of
      a model (like `name` of `website.page`), it works properly when
      `pg_trgm` is activated.
      Indeed, `name` is a field of `website.page` record but only at the ORM
      level, not in SQL, due to how `inherits` works.
      
      So, when the `pg_trgm` extension is enabled, it will switch from ORM
      queries to raw SQL query (to use the native SQL similarity feature and
      not our custom python/orm one, as obviously the SQL one is better, more
      powerfull/accurate and faster).
      But this will actually make the code fail when searching on fields from
      a model which has `inherits` and that you search on that `inherits`
      model fields.
      
      Note that in 15.2, the `pg_trgm` extension is auto installed when
      possible thanks to [1] and [2].
      
      [1]: https://github.com/odoo/odoo/commit/eedf37d6e286b995c47b946be1a6b66817094eff
      [2]: https://github.com/odoo/odoo/commit/75e6b645acdc95aece506ce0249fd0760838281c
      
      
      
      opw-3063592
      
      closes odoo/odoo#106879
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      700ee3d1
    • UlisesRivadeneyra's avatar
      [CLA] Update Vauxoo's CLA · e943bfac
      UlisesRivadeneyra authored
      
      Incorporate Ulises Rivadeneyra (UlisesRivadeneyra) as Vauxoo's contributor
      I confirm I have signed the CLA and read the PR guidelines at
      www.odoo.com/submit-pr
      
      closes odoo/odoo#107028
      
      X-original-commit: 84c6b0e4
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      e943bfac
    • David Monjoie's avatar
      [REV] website: revert typo fix to restore translation · 92c93ce7
      David Monjoie authored
      
      It was a mistake to fix this typo in stable as it would end up
      invalidating all existing translations for this term.
      
      Since it is not too late to put back the typo and therefore keep
      the existing translation, we chose to partially revert cd0fa9f533f39cf4b3ad1819c659d35a3552ff68.
      
      The typo will indeed be fixed in master.
      
      closes odoo/odoo#107005
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      92c93ce7
    • Antoine Guenet's avatar
      [FIX] web_editor: check if closestElement returns element · 0eeff826
      Antoine Guenet authored
      
      `getInSelection` had a check that depended on `closestElement` returning
      an element (and not `undefined` or `null`).
      
      closes odoo/odoo#107002
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      0eeff826
    • pedrambiria's avatar
      [FIX] payment_sips: accept scoreInfo in payment response · 7594a959
      pedrambiria authored
      After a payment is processed by SIPS, a data object is posted back
      to Odoo. The data has a `ScoreInfo` element that has more than one
      `=` characters (e.g. `scoreInfo=A3;N;N#SC;N;TRANS=3:2;CUMUL=4500:250000`)
      This causes the method `_sips_data_to_object` to break, because there
      will be too many values to unpack.
      
      To fix this, we should limit the data split to 2 values. This is the
      same method used by SIPS to process data as well.
      (See: https://github.com/worldline/Sips-International-non-FR-PHPlibrary/blob/master/lib/Sips/PaymentResponse.php#L73
      
      )
      
      opw-3071315
      
      closes odoo/odoo#106919
      
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      7594a959
    • Romain Derie's avatar
      [FIX] base: prevent "learn more" to be shown when no website/link · a7515816
      Romain Derie authored
      Apps have a "learn more" button which is redirecting to the given
      website/URL.
      The website is a field of the `ir.module.module` record, typically set
      on enteprise apps in this file [1].
      
      But the apps without a website are incorrectly showing that button.
      Clicking on it will redirect the user to a `/false` 404 page, except in
      16.0 and later version where it will simply do nothing.
      
      Seems like there was an error introduced at some point, I didn't dig
      into a complete history check but [2] could be a start.
      
      [1]: https://github.com/odoo/odoo/blame/11d023f068d0308f2fa2de45f932f61a95086c6b/odoo/addons/base/data/ir_module_module.xml#L16
      [2]: https://github.com/odoo/odoo/commit/7f9e7f0c961106fe13419166f112007f2d04e6ac#diff-c6e4af323e7ca3fe9d069fa98cd5da2f18ba606b8e4262005a79d2c1e0890dc8R189
      
      
      
      closes odoo/odoo#106985
      
      X-original-commit: a9905518
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      a7515816
    • Carlos Dauden's avatar
      [IMP] l10n_es: Establish more appropriate cash_difference accounts · 0bb27d74
      Carlos Dauden authored
      
      Use 778000 and 678000 accounts for default_cash_difference_income_account_id and default_cash_difference_expense_account_id
      Use 431200 and 411000 for account_journal_payment_debit and account_journal_payment_credit
      Fix length for transfer_account_code_prefix
      
      closes odoo/odoo#105519
      
      Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
      0bb27d74
    • qsm-odoo's avatar
      [FIX] website: update comment in user_custom_bootstrap_overridden file · 8700536a
      qsm-odoo authored
      
      The comment became outdated:
      - For 14.0 and above: mentioned the "Customize dialog" which does not
        exist anymore.
      - For 16.0 and above: mentioned "Bootstrap 4" instead of "Bootstrap 5".
      
      Related to opw-3056683
      
      closes odoo/odoo#106836
      
      X-original-commit: ed9a7832
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      8700536a
    • Ashmawy Walid (was)'s avatar
    • Touati Djamel (otd)'s avatar
      [FIX] stock_picking_batch: put in pack move lines from different picking · 861d941a
      Touati Djamel (otd) authored
      Steps to reproduce the bug:
      - Enable “package” option in the settings
      - Create a storable product “P1”
      - update the stock to 100
      - Create a picking:
          - product : P1
          - Qty: 1
          - operation type: delivery
          - go to additional info > add a carrier
          - Mark as todo
          - update the qty done to 1
      - Create a second picking with the same steps
      
      - Create a batch picking:
          - Add the picking 1 and 2
          - Confirm
          - Go to “Detailed operation” tab
          - Click on “Put in pack”
          - add a “Delivery packaging”
          - Save
          - Click a second time on “Put in pack”
          - Select the same “Delivery packaging”
          - Save
      
      Problem:
      Traceback is triggered: “tuple index out of range”
      
      When the “Put in pack” button is clicked, the “action_put_in_pack”
      function is called, the move_line_ids which has no package or with
      a 0 quantity done are filtered, in this case the 2nd move_line with
      the product “P2” will be used, but the `_pre_put_in_pack_hook` function
      is not called with its picking:
      
      https://github.com/odoo/odoo/blob/14.0/addons/stock_picking_batch/models/stock_picking_batch.py#L229
      
      But rather with the first picking, it will have no move_line because the
      first move_line already has a quantity done at 1 and a package.
      So we try to get a record in an empty array:
      https://github.com/odoo/odoo/blob/14.0/addons/stock/models/stock_picking.py#L1312
      
      
      
      opw-3067921
      
      closes odoo/odoo#106864
      
      X-original-commit: 1b6208a2
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarDjamel Touati (otd) <otd@odoo.com>
      861d941a
  6. Nov 30, 2022
    • qsm-odoo's avatar
      [FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet · 67abc6c8
      qsm-odoo authored
      *: website
      
      Commit [1] introduced the possibility to configure "website filters"
      used in the website to display some records dynamically via the "dynamic
      snippet" and its variants. One of their field is `limit` which is a max
      number of records the filter allows to show (so that the client side
      cannot ask for thousands of records). Users can configure the limit used
      by a snippet via the editor: they are allowed to choose up to 16, still
      safe-guarded by the internal limit configured on the website filter on
      the python side.
      
      The problem here was that [2] introduced website filters for the blog
      posts but set up a max limit of 6. Thus breaking the editor option if
      the user choose a limit between 7 and 16. This commit fixes the issue,
      for newly configured snippets (as a stable fix) or for users who would
      -u their blog application.
      
      Steps to reproduce:
      - Install blog application
      - Add a "Blog Posts" snippet
      - Set "Fetched Elements" to 10 (there are 7 records in demo data)
      => Only 6 are still shown
      - Save
      
      With the fix:
      - Restart your server
      => Only 6 are still shown
      - Enter edit mode, reset "Fetched Elements" to >6
      => 7 records are now shown
      
      [1]: https://github.com/odoo/odoo/commit/0e7640b5f22d2bea04bbe22d3189cff7e03af545
      [2]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5
      
      
      
      opw-2885948
      
      closes odoo/odoo#106754
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      67abc6c8
    • Simon Genin (ges)'s avatar
      [FIX] dx: port back js tooling gitignore properties · b469295c
      Simon Genin (ges) authored
      
      The tooling has been introduce in later version of odoo.
      It is a problem when somebody switches to older branches without
      disabling the tooling as it would then try to commit the tooling config
      files.
      
      We just add a few lines in the gitignore to prevent this issue.
      
      closes odoo/odoo#106896
      
      X-original-commit: 15012151
      Related: odoo/enterprise#34526
      Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
      b469295c
    • Walid HANNICHE (waha)'s avatar
      [FIX] purchase_stock: stock valuation foreign currency Journal Entry · f6bd1a55
      Walid HANNICHE (waha) authored
      
      Steps to reproduce:
      - Setup product (
          cost 10$
          Storeable Product
          Standard Price Accounting
          automated valuation
          add account for price difference
      )
      
      - Purchase product in foreign currency (set a different price)
      - Receive the product
      - Create and validate Bill
      
      Bug:
      The reception JE is for the cost amount set on the product ($10)
      debit and credit value are correct but the amount in currency
      is wrong (purchase cost)
      
      After creating the bill the Journal items are not correctly matched
      since reconciliation is done on currency amount in the case fo foreign
      currency transaction
      
      Fix:
      Set the correct amount (cost configured on product page)
      in currency amount if costing method is standard
      
      opw-2822366
      
      closes odoo/odoo#106833
      
      X-original-commit: 822b5f88
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      Signed-off-by: default avatarWalid Hanniche (waha) <waha@odoo.com>
      f6bd1a55
    • Sébastien Geelen (sge)'s avatar
      [FIX] web_editor: fix commands in inline · b9a881cd
      Sébastien Geelen (sge) authored
      
      Some commands from the powerBox command bar were not working
      properly in the e-shop product "terms and conditions" section.
      
      This was due to the isolation of Odoo fields
      inside the odoo editor as a all.
      Those fields do not always have an editable block element
      to apply the command on.
      
      We disable some commands that should not be apear in this context.
      
      We also remove a redundant command (separator) in website pages.
      
      task-2962067
      
      closes odoo/odoo#106348
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      b9a881cd
    • Adrien Widart (awt)'s avatar
      [FIX] core: clean env between tests · 8564a806
      Adrien Widart (awt) authored
      This commit description is in three parts: a generic explanation, a real
      use case and the solutions
      
      **Explanations**
      1. When getting an odoo `Environment`, we first generate a tuple used as
      an environment identifier:
         https://github.com/odoo/odoo/blob/7475bcbef601b69e11c88a2ebb5fa39d7fcb52ab/odoo/api.py#L446
         Then, there are two possibilities:
         1. If such environment already exists in the environments list of the
      transaction, we reuse it:
            https://github.com/odoo/odoo/blob/7475bcbef601b69e11c88a2ebb5fa39d7fcb52ab/odoo/api.py#L448-L452
         2. Else, we create a new one and store it in the transaction:
            https://github.com/odoo/odoo/blob/7475bcbef601b69e11c88a2ebb5fa39d7fcb52ab/odoo/api.py#L454-L464
      2. The `company` attribute of an `Environment` object is a lazy property
         https://github.com/odoo/odoo/blob/7475bcbef601b69e11c88a2ebb5fa39d7fcb52ab/odoo/api.py#L537-L538
         It means that its value won't be recomputed unless we delete it
         https://github.com/odoo/odoo/blob/083c70bbb63f27839b2c9a4b549e216947bc4dd1/odoo/tools/func.py#L12-L17
      3. When running a `SavepointCase` test class, the `setUp` method ensures
      that, after each test, we do cleaning:
         https://github.com/odoo/odoo/blob/a50a65be19b682201fc010d33c1b1f0b90cdf4d3/odoo/tests/common.py#L652-L662
         The functions are added in a stack. So, in the execution order, we
      will
         1. Clear the current environment and the registry
         2. Reset the environments list with the ones that were existing
      before the executed test
      4. Suppose a test class TC that inherits `SavepointCase`. TC has a
      special `setUpClass`:
         1. We create a new user U and replace the environment with a new one,
      E1, based on U. This user has a company Comp_U. Because of [1], the new
      environment E1 is added to the environments list of the transaction.
         2. For some reasons, we need to do some operations in `sudo` mode:
      again, because of [1], a new environment E2 (same as E1 but with the
      `su` flag to `True`) is created and added to the environments list of
      the transaction
      5. TC contains a first test T1. In that test, we create a company
      Comp_tmp and set it as default one to U. Therefore, E1 and E2 are
      updated (their `company` attribute is now Comp_tmp)
      6. At the end of T1, because of [3]:
         1. E1 is reset (but its lazy properties are not deleted)
         2. The environments list of the transaction is reset and still
      contains E1 and E2 as they have been created in the class setup (i.e.
      before the test setup)
      7. In a second test T2, there will be an inconsistency: both E1 and E2
      have an incorrect value for their field `company`: Comp_tmp, which is
      not the value defined on `self.env.user.company_id` (the value Comp_tmp
      does not even exist anymore)
      
      **Real use case**
      - The class `AccountTestInvoicingCommon` is an inheritance of
      `SavepointCase`. In its class setup, we create a user and set it on the
      current environment. Later on, we create a company (the sudo mode will
      be activated during the company creation process)
        https://github.com/odoo/odoo/blob/1e69c4fe5f8dd8a92d92f350b6d6a9539157f206/addons/account/tests/common.py#L38-L52
      - The class `TestPurchaseOrder` inherits `AccountTestInvoicingCommon`
      - The test `:TestPurchaseOrder.test_06_on_time_rate` creates a company
      and sets it as the one of the current user
        https://github.com/odoo/odoo/blob/87ffe5983be7f0f4a926b458c4bd1f13001048ec/addons/purchase_stock/tests/test_purchase_order.py#L313-L316
      
      
      - Therefore, all next tests will have an issue with the environment
      (unless we force the writing of the company on the current user to
      bypass the issue)
      ```py
      self.assertEqual(self.env.user.company_id, self.env.company) # will fail
      self.assertTrue(self.env.company.exists()) # will fail
      ```
      
      **Solution**
      The above issue has been fixed from Odoo 15 on, thanks to commit C1.
      Thanks to that diff, at step [3.1] in the above explanations, the lazy
      properties of E1 are deleted (so, because of [2], the `company`
      attribute of E1 will be correct again). However, once C1 is applied, we
      can still add some lines in T2 to fail the test:
      ```py
      sudo_env = self.env.user.sudo().env
      self.assertEqual(self.env.user.company_id, sudo_env.company) # will fail
      self.assertTrue(sudo_env.company.exists()) # will fail
      ```
      The reason: at the end of the test T1, we reset the environments list of
      the transaction ([6.2]). However, E2 has been created before the test
      setup (it was in the class setup, see [4.2]). So, after the list reset,
      E2 is still in that list and still has the value Comp_tmp for its
      `company` attribute.
      
      So... first we can conclude that C1 is not enough. Second, once the
      environments list of the transaction is reset ([3.2]), we also have to
      reset each environment to ensure that their lazy properties are correct.
      We can then remove [3.1] since it will be included in that new step.
      
      C1 a40511cd
      
      closes odoo/odoo#106810
      
      X-original-commit: 0fa99e31
      Signed-off-by: default avatarRaphael Collet <rco@odoo.com>
      8564a806
    • momegahed's avatar
      [FIX] payment: use iso 4217 currency minor units in payments · 703ed2b4
      momegahed authored
      Steps to reproduce:
      
      1- install ecommerce - payment_stripe
      2- configure stripe testing credentials
      3- edit main currency to have more decimal places (assume 4 instead
      of 2 for USD)
      4- add product p to cart (assume p.price = 100 USD)
      5- checkout with stripe
      6- the price is 10,000 USD instead of 100 USD
      
      Bug:
      
      Stripe expects the amount in the smallest unit possible for the
      currency. https://stripe.com/docs/currencies#zero-decimal
      
      This differs from a currency to another according to
      https://en.wikipedia.org/wiki/ISO_4217#Minor_unit_fractions
      
      `to_minor_currency_units` uses the decimal places of the currency by
      default which will produce wrong values
      
      Fix:
      
      use currency exponent table built from
      https://en.wikipedia.org/wiki/ISO_4217#Minor_unit_fractions
      
      
      
      default behavior (for a currency that is not available) is not changed
      
      OPW-3058173
      
      closes odoo/odoo#106130
      
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      703ed2b4
    • Julien Van Roy's avatar
      [FIX] account_edi_ubl_cii: import customer when uploading an invoice · 1c73b6a0
      Julien Van Roy authored
      
      Previously, it was only possible to upload a bill, so the partner_id was read
      from the vendor in the imported file. Now, it is also possible to upload a
      file to create an invoice, so we need to be able to decode the customer in
      the imported file.
      
      opw-3072989
      
      closes odoo/odoo#106829
      
      X-original-commit: 7eb401e3
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      Signed-off-by: default avatarJulien Van Roy <juvr@odoo.com>
      1c73b6a0
  7. Nov 29, 2022
    • Antoine Guenet's avatar
      [FIX] web_editor: prevent toolbar flicker on preview icon color change · b6bf0697
      Antoine Guenet authored
      
      If you clicked on a pictogram, then previewed various colors for it by
      hovering colors in the colorpicker of the toolbar, the toolbar started
      flickering uncomfortably. That's because the selection was changed
      at every color change, which was unnecessary.
      
      closes odoo/odoo#106788
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      b6bf0697
    • Antoine Guenet's avatar
      [FIX] web_editor: do not open text toolbar on change icon color · 5c7989d2
      Antoine Guenet authored
      If you clicked on a pictogram, then changed its color with the text
      colorpicker in the toolbar, the toolbar was replaced with the regular
      text toolbar, even though what was being edited was the pictogram.
      That's because the information of the last media clicked was lost in the
      process.
      
      task-3045166
      
      Part-of: odoo/odoo#106788
      5c7989d2
    • Benoit Socias's avatar
      [FIX] website: show icons in autocomplete results when no image defined · 4e292519
      Benoit Socias authored
      Since [1] when the search bar was refactored, images can be displayed in
      the autocomplete results, and fallback icons are displayed instead of
      images for records that have no images.
      However, if no module that participates in the results provides actual
      images, then the fallback icons are not displayed at all.
      
      This commit makes the fallback icons displayed only based on the "Image"
      toggle option of the search bar.
      It also disables the hidden display options and enables the visible
      ones.
      
      Steps to reproduce:
      - Do NOT install website_sale (which is currently the only module that
      provides autocomplete results with images).
      - Drop a "Search" block.
      - Save.
      - Type a single letter in the search box. (e.g. "a")
      => Autocomplete results were displayed without their icons.
      
      [1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986
      
      
      
      task-2951026
      
      closes odoo/odoo#98241
      
      Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
      4e292519
    • Antoine Guenet's avatar
      [FIX] web_editor: prevent closestElement traceback with comment nodes · 5d4e2530
      Antoine Guenet authored
      
      Comment nodes don't have a `closest` method so when passing one to
      `closestElement`, the method crashed.
      
      ----
      
      Step to reproduce in website:
      - Go to debug mode and to website app
      - Click on configuration > websites
      - Select a website and in the `custom_code_footer` field add an HTML
        comment
      - Go to the website and try to enter edit mode -> Crash
      
      The same error will be visible if you simply enter edit mode and drag &
      drop the "Code" snippet and enter an HTML comment inside it.
      
      -----
      
      Step to reproduce in marketing automation:
      - Install marketing automation
      - Click on a campaign > Add a new activity
      - On the mail template field, type something > Create and edit
      - Select plain text -> `element.closest is not a function`
      
      ----
      
      task-3083797
      opw-3081323
      opw-3081278a
      
      closes odoo/odoo#106741
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      5d4e2530
    • std-odoo's avatar
      [FIX] mail_plugin: do not enrich blacklisted domains · 37503108
      std-odoo authored
      
      Bug
      ===
      Currently, we try to enrich the domains even if they are in the
      `_MAIL_DOMAIN_BLACKLIST`. IAP always return a "missing data" error
      because it can't enrich "gmail.com", etc except for "odoo.com". In that
      case the enrichment is successful, but because the domain is
      blacklisted, we use the entire email to find the company (and so it
      will create a company for each odoo.com email addresses).
      
      The test that was removed was wrong. It works because we mocked the
      enrichment response, but in practice it will always return a missing
      data error.
      
      Task-3050230
      
      closes odoo/odoo#104621
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      37503108
    • Stefan-Calin Crainiciuc (stcc)'s avatar
      [FIX] account: narration css overlap · da18d801
      Stefan-Calin Crainiciuc (stcc) authored
      
      Steps to reproduce:
      
      - Open an invoice
      - Enter a long link without spaces in the terms and conditions field
      - Save
      
      Issue:
      The word doesn't break and spans outside its bounding box, possibly
      overlapping with the subtotal footer on the right.
      
      Solution:
      Add class `text-break` to the narration field.
      
      opw-3050054
      
      closes odoo/odoo#106625
      
      X-original-commit: 1484765c
      Signed-off-by: default avatarGrazioso Andrea (agr) <agr@odoo.com>
      Signed-off-by: default avatarStefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
      da18d801
    • Antoine Guenet's avatar
      [FIX] website: properly revert slider on break unbreakable · be1d93ed
      Antoine Guenet authored
      
      When breaking a page from a Carousel or other slider snippet (eg by
      hitting the backspace key at the beginning of a page), the editor's
      history gets reverted but ends up applying the `active` class to all
      pages. This is due is some way to the `_computeHeights` method of the
      slider snippet, which applied the class to all pages to observe their
      heights, then put them back in place. It seems in the labyrinth of ticks
      the history step somehow started from a place where every page was
      active, so we reverted back to that. The point where these classes were
      applied should have never been observed in the first place since it's
      purely technical. Not observing it fixes the bug.
      
      task-3081259
      
      closes odoo/odoo#106696
      
      Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
      be1d93ed
    • Jinjiu Liu's avatar
      [FIX] hr_expense: add extra case for unit_amount compute with attachment · 2250b3dc
      Jinjiu Liu authored
      Reproduction:
      1. Install Expense, make sure in the product list of test data, we have
      Expenses(without cost e.g. 0.00) and Daily Allowance(with cost e.g. 100)
      2. Create a new expense with the product Daily Allowance, and attach a
      file to the attachment, save expense
      3. Edit the created expense, change the product to Expenses and save
      4. The UI is not changed and can’t edit the total amount of the expense
      
      Reason: the recomputation of product_has_cost is based on the
      unit_amount. However, when there’s an attachment, the recomputation of
      unit_amount doesn’t consider the case when the product is changed to one
      without standard_price (unit_amount).
      
      Fix: add a condition to make sure when the product is changed from one
      with standard_price to one without standard_price, the unit_amount of
      expense is recomputed correctly
      
      opw-3051726
      
      Related commit: https://github.com/odoo-dev/odoo/commit/918a5f2cc022994ee08bead25dd79072bf3fba87
      
      
      
      closes odoo/odoo#106660
      
      Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
      2250b3dc
    • Florian Vranckx's avatar
      [REF] web, base: change alias of Markup · 3c215581
      Florian Vranckx authored
      
      Simple refactor in order to make changes to these line trigger the CI/Security
      
      closes odoo/odoo#106309
      
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      3c215581
Loading