Skip to content
Snippets Groups Projects
  1. May 09, 2023
    • Touati Djamel (otd)'s avatar
      [FIX] stock: change product's company · a6666de7
      Touati Djamel (otd) authored
      
      Steps to reproduce the bug:
      - Connect with the company A
      - Create a consumable product “P1”
      - Create a receipt transfer with this product
      - confirm the transfer
      - Come back to the product form
      - limiter le produit que a la “Company B”
      
      Problem:
      no user error triggered
      Go to inventory > operation > transfer: a Traceback is triggered
      
      Before this commit, there is no verification while changing a product's
      company for consumable. That can lead to an issue where some operations
      cannot be done because of access errors. To avoid that, this commit
      prevents to change the product's company if some move lines for this
      product exist in another company.
      
      opw-3300559
      
      closes odoo/odoo#120702
      
      Signed-off-by: default avatarDjamel Touati (otd) <otd@odoo.com>
      a6666de7
    • Alvaro Fuentes's avatar
      [FIX] mail: allow to create a manual blacklist model · 8848bb57
      Alvaro Fuentes authored
      Issue 1: before this patch it was impossible to create a manual model
      marked as "Is blacklist". The reason is that a blacklist model
      implicitly need an `email` field, but such field is impossible to add in
      a manual model: the field must start with `x_`.
      
      Solution: append `x_` to the implicit email field. Note, in principle
      the user gets an error if `x_email` is not present. Solved by adding the
      field when creating the custom model. Ideally we should show some hint
      in the interface to make it more user friendly. That is out of the scope
      of this patch.
      
      Issue 2: when we have a manual model that is mail blacklist it's
      impossible to create its model class. We get an error because the MRO is
      not correct. The reason is that we are adding `mail.thread.blacklist`
      _after_ `mail.thread` in the `_inherit` list. That list is used to
      generated the `__bases__` of the model class[1]. According to Python's
      MRO rules[2], since `mail.thread.blacklist` appears after `mail.thread`
      as parents of the custom model class this order _must_ be respected. But
      `mail.thread` must appear _before_ `mail.thread.blacklist` because the
      latter inherits from the former. This is a contradiction and the MRO
      algorithm cannot succeed. To put it in a simple example:
      ```py
      class A: pass
      class B(A): pass
       # This fails:
       # class C(A, B): pass
       # The right order is:
      class C(B, A): pass
       # Equivalent to:
      class D(B): pass
       # C and D have the same MRO linearization excluding themselves
      assert D.mro()[1:] == C.mro()[1:]
      ```
      Example traceback:
      ```
      Traceback (most recent call last):
        File "/home/odoo/src/odoo/14.0/odoo/service/server.py", line 1201, in preload_registries
          registry = Registry.new(dbname, update_module=update_module)
        File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 89, in new
          odoo.modules.load_modules(registry._db, force_demo, status, update_module)
        File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 464, in load_modules
          registry.setup_models(cr)
        File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 263, in setup_models
          env['ir.model']._add_manual_models()
        File "/home/odoo/src/odoo/14.0/odoo/addons/base/models/ir_model.py", line 430, in _add_manual_models
          Model = model_class._build_model(self.pool, cr)
        File "/home/odoo/src/odoo/14.0/odoo/models.py", line 585, in _build_model
          ModelClass.__bases__ = tuple(bases)
      TypeError: Cannot create a consistent method resolution
      order (MRO) for bases BaseModel, mail.thread, mail.thread.blacklist, base
      ```
      
      Solution: check if a model inherits from `mail.thread.blacklist` first.
      There is no need to add `mail.thread` if inheriting
      `mail.thread.blacklist` because the inheritance is already implicit.
      
      This issue was observed during upgrades. We convert custom models and
      fields into manual to allow upgrading without custom code. This causes
      issues because the MRO error appears when a custom model inherits mail
      blacklist.
      
      [1]: https://github.com/odoo/odoo/blob/02f820fb0eaddbb3a4269a0967184c8aaf52c363/odoo/models.py#L585
      [2]: https://www.python.org/download/releases/2.3/mro/
      
      
      
      closes odoo/odoo#119169
      
      Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
      8848bb57
    • Sanket Brahmbhatt's avatar
      [FIX] base,tools: raise usererror instead of a valueerror · 59a3f75b
      Sanket Brahmbhatt authored
      
      This issue is generated when the user uploads an image of more than
      50.0 million pixels, so error would be generated. But, currently it raises a
      `ValueError` which results in traceback. So, we replace it with
      `UserError` so the user has an idea about Image size or pixel being excessive.
      
      closes odoo/odoo#118281
      
      Sentry: - 4075426049
      Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
      59a3f75b
    • Julien Van Roy's avatar
      [FIX] mail,account_edi: fix creation of invoice upon email reception · b5214e1d
      Julien Van Roy authored
      When receiving an email on a mailbox with an alias that triggers the
      creation of invoices, 4 bugs could occur.
      
      1. If the xml received contains replacement characters (U+FFFD �), and
      the charset of the part of the email is "US-ASCII" the encoding of the
      string will fail, preventing the rest of the flow to be completed. Be
      more resilient, encode the string and ignores these characters if this
      case occurs.
      
      NB: sometimes, the charset is omitted for a Content-type: text/xml. This
      is valid but not recommended (see:
      https://www.ietf.org/rfc/rfc2376.txt). In this case, the default used is
      "US-ASCII". This means that any non-ascii char will be lost (they are
      replaced by the replacement character: �, see:
      https://github.com/python/cpython/blob/3.10/Lib/email/contentmanager.py#L67
      
      )
      when decoding the attachment.
      
      2. When the xml attachment is created in Odoo, the mimetype is
      'text/plain' (rather than 'application/xml'). Thus, the
      `_decode_attachment` needs to be more flexible when guessing the type of
      the attachment (to know which function to use to read the content of the
      attachment and create the invoice).
      
      3. When creating an invoice from an email with an xml attachment, the
      xml is attached as the `message_main_attachment_id`. It's only later on
      that the content of the xml is read and we possibly find the PDF in
      base64 inside. When creating the PDF attachment, it was not set as the
      `message_main_attachment_id`, so the PDF was not rendered on the right
      part of the invoice form view. Add a clause to replace the
      `message_main_attachment_id` in such a case.
      
      4. When the xml attachment represents a credit note, the move_type of
      the invoice created by the email alias needs to be changed. Indeed, the
      invoice is created before decoding the attachment, so we can only change
      the `move_type` later.
      
      opw-3144519
      opw-3149649
      
      closes odoo/odoo#119602
      
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      b5214e1d
  2. May 08, 2023
  3. Feb 10, 2023
  4. May 07, 2023
  5. May 06, 2023
  6. May 05, 2023
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] account: search for deprecated account · 4305ea5a
      Andrea Grazioso (agr-odoo) authored
      
      Duplicate the default Account Payable (211000)
      Set the default Account Payable to Deprecated
      Create a Vendor Bill with a line
      Save
      
      Error will raise
      The account Account Payable (211000) is deprecated.
      
      opw-3199157
      opw-3229350
      
      closes odoo/odoo#120698
      
      Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
      4305ea5a
    • pedrambiria's avatar
      [FIX] base: add `commercial_company_name` to the depends · 6bd2bdf0
      pedrambiria authored
      
      Before this commit: if you add a custom one2many field to the
      'res.partner', like x_related_commercial_partner_ids, that is related to the
      `commercial_partner_id` in the`res.partner` model, it won't update the
      display name of a contact in case of changing its parent_id name.
      
      Here are the steps to reproduce the problem:
       1. Create a new custom field with these values:
         a. Field Type = one2many
         b. Model = Contact
         c. Related Model = res.partner
         d. Relation Field = commercial_partner_id
       2. Create a new Contact that is the "Company" (e.g. "My Company")
       3. Create a new Contact that is the "Individual" (e.g. "My Name"), and
          put the "My Company" as its parent_id.
       4. Now the display_name is "My Company, My Name" which is correct
       5. Change the company name to "My new Company"
        -> display_name won't change, and is "My Company, My Name"
      
      The solution is to add the 'commercial_company_name' to the
      `display_name` depends.
      
      opw-3202894
      
      closes odoo/odoo#114344
      
      Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
      6bd2bdf0
    • Julien Van Roy's avatar
      [FIX] l10n_account_edi_ubl_cii_tests: adapt test with prepaid amount · be7ca375
      Julien Van Roy authored
      Adapt the tests after commit
      https://github.com/odoo/odoo/commit/47905d21ab65f985291d78cb7ecb78f2f7cdcf67
      
      
      A down payment is no longer created when a prepaid amount is detected in
      a UBL/CII attachment.
      
      closes odoo/odoo#120653
      
      Signed-off-by: default avatarLaurent Smet <las@odoo.com>
      be7ca375
    • Laurent Smet's avatar
      [FIX] account: Fix cascading computation leading to wrong move_name computation · 29d6101c
      Laurent Smet authored
      
      When l10n_mx_edi is installed and a payment is posted, the move_name field on account.move.line
      being a related to move_id.name is not well computed.
      That is because posting a move trigger the computed field in a protected mode due to `flush_recorset`.
      This mode prevents any computed field to be recomputed twice.
      This flush triggers `_compute_name` calling `sequence_mixin`, itself doing another `flush_recorset`.
      This extra flush triggers `_compute_l10n_mx_edi_cfdi_uuid` that access to `move.payment_id.reconciled_bill_ids`.
      This access to this field triggers its recomputation and then, `_compute_stat_buttons_from_reconciliation` is called.
      This method does `self.env['account.move.line'].flush_model()` that force the computation of `move_name` to `/`.
      `sequence_mixin` assigns the new `name` to the journal entry but `move_name` is not recomputed due to the
      protected environment.
      
      closes odoo/odoo#120411
      
      Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
      29d6101c
  7. May 04, 2023
  8. May 03, 2023
    • Ivan Yelizariev's avatar
      [FIX] website_sale_digital: let salesman download digital via portal · 51fd5d3c
      Ivan Yelizariev authored
      Portal shows all Sale Orders available for current user. For example, salesman
      can see his sales. If such a user can download digital files via product form in
      backend, it makes sense to let user download them via SO page on portal.
      However, it wasn't the case because /my/download requires product be purchased
      by current user [1]. Fix it by checking read access first.
      
      STEPS
      
      * in backend create SO with digital product (customer must be different from
      current user)
      * create invoice and register a payment
      * navigate to portal  (without using customer's token),
      * open SO, click download on digital product
      
      [1]: https://github.com/odoo/odoo/blob/1a24477fab4dd323cf94c010321d8942fb2c1a01/addons/website_sale_digital/models/account_invoice.py#L14-L22
      
      
      
      opw-3144600
      
      closes odoo/odoo#112639
      
      Signed-off-by: default avatarMorgane Demesmaeker <edm@odoo.com>
      51fd5d3c
    • Guillaume (gdi)'s avatar
      [FIX] web: remove prohibited dropzones of the menu editor · dac80feb
      Guillaume (gdi) authored
      
      In the website menu editor and in the studio menu editor, the user can
      drag & drop the elements that constitute the menu of his website/app.
      Users can also put a menu into another menu to create a sub-menu. For
      the website, we allow two levels of menu but not more. For studio we
      allow 5 levels of menu. When the user starts to drag an item, dropzones
      can be drawn on the prohibited level (3 in website, 6 in studio) while
      he can't create this level of menu. This commit adds a css rule to hide
      those forbidden dropzones.
      
      task-3251032
      
      closes odoo/odoo#117300
      
      Signed-off-by: default avatarloco-odoo <loco@odoo.com>
      dac80feb
    • Andrew Gavgavian's avatar
      [FIX] stock: fix report.stock.quantity search_read · e3b1a887
      Andrew Gavgavian authored
      
      	Currently `report.stock.quantity` has a field defined in it called `move_ids`:
      	`move_ids = fields.One2many('stock.move',readonly=True)`
      
      	This virtual field has no corresponding inverse field so when performing a search_read on the model, it fails
      	in fields.py when trying to do:	`inverse_field = comodel._fields[inverse]`
      
      	In addition, this field is apparently not used anywhere in the source code and not queried in the SQL View.
      
      	This means the model can never be search_read by default.
      
      	Since this field is never used, it isn't stored, and the model is `_auto = False`, removing it won't break any database.
      
      closes odoo/odoo#120048
      
      Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
      e3b1a887
    • Mahamadasif Ansari's avatar
      [FIX] payment: prevent deletion of payment acquirer if it has external reference · c54a3985
      Mahamadasif Ansari authored
      
      "ValueError: External ID not found in the system: payment.payment_acquirer_
      stripe" is generated because the user deleted the Stripe payment acquirer
      record and its corresponding model tried to access the record of it.
      
      Steps to produce the error:
      1. Install e-commerce
      2. Install install 'Stripe Payment Acquirer ' module
      2. delete the Stripe payment from payment acquirer
      3. Go to the e-commerce dashoboard
      4. Click Set Payment
      5. select Credit card (via Stripe)
      6. enter any secret and Publishable key
      7. click apply
      
      This commit solves the above issue by preventing the deletion
      of the payment acquirer if it has a external reference.
      
      sentry-4041178833
      
      closes odoo/odoo#119140
      
      Signed-off-by: default avatarAntoine Vandevenne (anv) <anv@odoo.com>
      c54a3985
    • Naman Shah's avatar
      [FIX] crm: remove the field date_closed from demo data · e368725b
      Naman Shah authored
      
      Purpose:
      The purpose of this commit is to change the current behavior of days to close
      graph generating from customizable desk demo data.
      
      Specification:
      For the opportunities, the day_close field is a compute field depending upon the
      date_closed field. For the customizable desk demo data, the date_closed field
      pre-existed, due to that customizable desk opportunity was not won or lost but
      the graph report was generated.
      so, this commit fixes the current behavior for customizable desk opportunity.
      
      Task-3278039
      
      closes odoo/odoo#119292
      
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      e368725b
  9. May 02, 2023
  10. Apr 30, 2023
  11. Apr 28, 2023
    • Claire Bretton (clbr)'s avatar
      [FIX] account, l10n_ch: enable new taxes after module update · c8ea9f9f
      Claire Bretton (clbr) authored
      
      Swiss taxes retrieved by module update (and the update of taxes it triggers)
      need to be active, even if the template data was set to inactive.
      
      closes odoo/odoo#113001
      
      Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
      c8ea9f9f
    • Claire Bretton (clbr)'s avatar
      [FIX] account: translates new taxes in multilang localization taxes update · eb86c0b3
      Claire Bretton (clbr) authored
      When we were updating taxes from templates in a multilang localization,
      newly created taxes were not translated in languages of the localization.
      We also need l10n_lu migration script to be run in `end` instead of `post`
      to have translations loaded.
      
      Related: #108667
      Part-of: odoo/odoo#113001
      eb86c0b3
    • Claire Bretton (clbr)'s avatar
      [FIX] l10n_ch: add missing repartition line on vat_0_import · 4b3b2ed1
      Claire Bretton (clbr) authored
      The tax with xmlid vat_0_import was missing its repartition
      lines which caused validation errors.
      This PR adds empty repartition lines to fix this problem.
      
      Part-of: odoo/odoo#113001
      4b3b2ed1
    • Claire Bretton (clbr)'s avatar
      [FIX] account: relax repartition lines validation when tax has children · e751d030
      Claire Bretton (clbr) authored
      If a tax is an aggregation of its sub-taxes it makes sense to have no
      repartition line. This PR relaxes the validation in that case.
      
      Part-of: odoo/odoo#113001
      e751d030
    • Claire Bretton (clbr)'s avatar
      [IMP] l10n_ch: adds new tax rates for 2024 · d2572b73
      Claire Bretton (clbr) authored
      Switzerland changes its rates at the beginning of next year,
      this change already has some implications on client's flow so
      we add them to the localization so they can coexist with old rates till
      the end of the year.
      Changes:
      - Added new taxes (2.5% -> 2.6%, 3.7% -> 3.8%, 7.7% -> 8.1%)
      - Added tax fiscal positions to match those taxes
      - Added tax groups
      - Adds migration script to l10n_ch to apply those changes
      
      Task: 3162286
      Part-of: odoo/odoo#113001
      d2572b73
    • HuylenbroeckFlorent's avatar
      [FIX] Install l10n_eu_service without chart template · 4b140806
      HuylenbroeckFlorent authored
      
      When installing l10n_eu_service without a localization installed, a line fails
      in the get_oss_tags function of res_company, thus halting the installation
      and returning an error.
      
      This fail is due to the function relying on the company in self having its
      'chart_template_id' set, when this is not always the case.
      
      Adding a failsafe to that function allows the installation of the module to
      proceed in the event that the chart_template_id is not set.
      
      opw-3291118
      opw-3289913
      
      closes odoo/odoo#120077
      
      Signed-off-by: default avatarBrice Bartoletti (bib) <bib@odoo.com>
      4b140806
    • Moises Lopez's avatar
      [FIX] requirements.txt: unpin pytz · b5cf0a50
      Moises Lopez authored
      
      On Debian based systems, the `tzdata` package is maintained to reflect changes
      in timezones and there is no need to upgrade the `python3-tz` package.
      On the other hand, for those who are using `pip` and thus our `requirements.txt`,
      the package needs to be up to date. By unpinning it in the requirements.txt:
      
      - new installations based on pip will be up to date
      - older installations based on pip can easily upgrade
      - debian based installations have to maintain the tzdata package
      - mixed installs like on runbot will rely on Debian tzdata
      
      closes odoo/odoo#117527
      
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      b5cf0a50
    • Benjamin Vray's avatar
      [FIX] website, web_editor: fix colors of snippets in "all pages" popup · 293569cf
      Benjamin Vray authored
      Since this commit [1], the option to set the background color for
      snippets in the footer has been removed. However, this should not affect
      the snippets in the "All pages" popup, which is also located in the
      footer.
      
      This commit fixes that by showing the background color option for popup
      snippets in the footer.
      
      Steps to reproduce the bug:
      
      - Drop a popup.
      - Set the "Show On" option to "All pages".
      - Drop a text block in the popup.
      => The text color is white over a white BG (because it is in the footer
      and the footer text is white).
      
      [1]: https://github.com/odoo/odoo/commit/00f70f7936d37ec1c7c26065b2126045337e2825
      
      
      
      task-3102275
      
      closes odoo/odoo#111681
      
      Signed-off-by: default avatarBenoit Socias (bso) <bso@odoo.com>
      293569cf
    • Benjamin Vray's avatar
      [FIX] web_editor: fix nested snippets background filters · b9c1da24
      Benjamin Vray authored
      Before this commit, modifying the "bg_filter" of a snippet would also
      affect its child snippets (for example, if a Carousel snippet had a
      "bg_filter" that contained another snippet with its own "bg_filter").
      
      To reproduce the bug:
      
      - Drop a "Tabs" snippet on a page.
      - Add a background image to the snippet and apply a background filter to
      it.
      - Drop a "Text" snippet in one of the tabs of the "Tabs" snippet.
      - Add a background image to the "Text" snippet and apply a background
      filter to it.
      - Change the color of the background filter of the "Tabs" snippet.
      - Bug: the background filter of the "Text" snippet is also changed.
      
      task-3102275
      
      Part-of: odoo/odoo#111681
      b9c1da24
Loading