Skip to content
Snippets Groups Projects
  1. Jan 13, 2020
  2. Jan 08, 2020
  3. Jan 13, 2020
    • Damien Bouvy's avatar
      [FIX] sale: prevent inconsistent company field on products · 69c86a2c
      Damien Bouvy authored
      
      If a user changes the company of a product, we should make sure that the
      product was not sold in another company in the past; otherwise it could
      make some orders un-invoiceable.
      
      closes odoo/odoo#43187
      
      X-original-commit: 069f0493
      Signed-off-by: default avatarDamien Bouvy (dbo) <dbo@odoo.com>
      69c86a2c
    • qsm-odoo's avatar
      [FIX] web_editor: allow to simulate a preview of a colorpicker reset · bc086e4c
      qsm-odoo authored
      This is important so that trigger-value works
      (see https://github.com/odoo/odoo/commit/e590609ebb429c6254766aa1fd8cab3ce3fd4c74
      
      )
      
      closes odoo/odoo#43182
      
      Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
      bc086e4c
    • Arnold Moyaux's avatar
      [FIX] stock: forbid to modify product on done move line · 7c984d57
      Arnold Moyaux authored
      
      It happens that people modify the product on done stock.move.line
      (it's not possible without customisation, at least allow to import or
      to modify product and lot_id in the same view).
      
      During the write on stock.move.line only the lot,locations,package and
      owner are update on the quant. Not the product since it's not suppose to
      be modify. It leads to a stock.move.line with a correct information but
      a total mess on the quants with a lot updated and the previous product.
      Since the product is not modified, the product on the quant and the
      product on the lot linked to the same quant are different.
      
      closes odoo/odoo#43180
      
      Task: 2119471
      X-original-commit: f2a4f701
      Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
      7c984d57
    • Damien Bouvy's avatar
      [FIX] account: remove bank accounts when switching move type · b5c9387c
      Damien Bouvy authored
      
      When switching a invoice to a refund, the bank account to which the move
      should be paid should be removed: while it (might) contain the partner's
      bank account before, when becoming a refund it makes no sense to keep
      the partner's bank account as the recipient.
      
      closes odoo/odoo#43176
      
      X-original-commit: e94234f4
      Signed-off-by: default avatarDamien Bouvy (dbo) <dbo@odoo.com>
      b5c9387c
    • Damien Bouvy's avatar
      [FIX] sale: take taxes into account during invoices -> refund switch · a0f02bd5
      Damien Bouvy authored
      Before this commit, the invoice creation flow of a sales order checked
      if the amount of the generated invoice was positive or negative - if it
      was negative, then the invoice would be converted to a refund instead.
      
      Unfortunately, this check was done before the move was actually created
      \- meaning that the only way to compute the total of the move was to
      multiply the quantities and unit prices of what was about to be included
      in the move - ignoring taxes altogether. Since taxes would then be
      applied during the move's creation, you could in fact have a refund that
      ended up being negative because some products would end up with
      different taxes.
      
      A simple (although weird) example would happen if you registered a
      down payment that was actually greater than the subtotal of your
      quote (but lower than the total with taxes included).
      Example:
      Create a quote for a 100$ product with 15% tax
      Register a downpayment of 105$ and validate that invoice
      Invoice the rest:
       => you end up with a refund of -10$, while you should have a 10$
      invoice instead.
      
      Since the downpayment did not have taxes, the second invoice was
      computed as being negative (100$ for the product - 105$ to deduce the
      down payment), even though after the 15% tax gets applied on the product
      (but not on the downpayment), the invoice is actually positive.
      
      This commits moves the switch from invoice to refund to *after* the move
      actually gets created, ensuring taxes are taken into account.
      
      X-original-commit: eefe27b1
      a0f02bd5
  4. Jan 10, 2020
  5. Jan 13, 2020
    • Alexandre Kühn's avatar
      [FIX] mail:tests: no undeterministic failure of discuss history test · 2f3e6e9e
      Alexandre Kühn authored
      
      Before this commit, the test 'all messages in "Inbox" in "History"
      after marked all as read' had non-deterministic failures.
      
      More precisely, it crashed on either assertion "there should be 30
      messages in History" or "there should be 40 messages in History",
      both resulting to 0 messages in History instead.
      
      Unfortunately, as of the date of this commit, we still do not
      understand why it rarely fails. In the meantime, we have decided to
      make these errors less likely to happen, by waiting much longer
      before the assertions. We are aware that this is a poor solution,
      but this is much better than skipping the test, until we find and fix
      this issue at a later moment.
      
      Closes #43072
      
      Signed-off-by: default avatarSébastien Theys (seb) <seb@odoo.com>
      2f3e6e9e
    • Alexandre Kühn's avatar
      [FIX] mail:tests: no crash on intercepted crosstab heartbeat · 6a9b29ec
      Alexandre Kühn authored
      The test may fail non-deterministically from intercepting an
      heartbeat in the local storage. Only a document thread window fold
      state change from the local storage should be intercepted.
      
      Closes #43072
      6a9b29ec
    • Alexandre Kühn's avatar
      [FIX] web:tests: remove promise constructor antipattern · b58c649d
      Alexandre Kühn authored
      Revision on https://github.com/odoo/odoo/commit/141b34f152f36d970d4ff78abe53f563555a8e69
      
      Having async/await as a new promise constructor is an antipattern.
      
      The reason is that it may lead to unnoticed errors: if an inner
      promise is rejected, it won't propagate the error to another promise
      that will handle the error. As a result, this error becomes unnoticed
      and the initial promise is pending indefinitely, which also may lead
      to more bugs [1].
      
      [1] https://stackoverflow.com/a/25569299
      
      Closes #43072
      b58c649d
    • Martin Trigaux's avatar
      [FIX] *: unify field labels · a1ea321f
      Martin Trigaux authored
      
      Avoid double definition of the same field with different string or
      help parameters. These parameters are translatable. If one has a
      different value depending of the installed module, it is not possible
      to properly translate it.
      This problem is similar as the menu renaming debate at
      odoo/enterprise@cfd4da43ee974
      
      closes odoo/odoo#42777
      
      Related: odoo/enterprise#7623
      Signed-off-by: default avatarMartin Trigaux (mat) <mat@odoo.com>
      a1ea321f
  6. Jan 10, 2020
  7. Jan 13, 2020
  8. Jan 10, 2020
  9. Jan 09, 2020
  10. Jan 10, 2020
    • Thibault Delavallée's avatar
      [IMP] crm: add comments in code about crm lead to opportunity · f82eadf9
      Thibault Delavallée authored
      
      Try to understand a bit this code with comments. Some unnecessary code is
      removed, and some parameters are added to try to understand the various flows,
      but main purpose is to understand that mighty spaghetti, not destroy it.
      
      LINKS
      
      Side effect of Task ID 2056759 (remove crm.partner.binding mixin)
      Side effect of Task ID 2088565 (crm onchange -> compute)
      Community PR #43127
      Enterprise PR odoo/enterpreise#7656
      
      Related: odoo/enterprise#7656
      Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
      f82eadf9
    • Thibault Delavallée's avatar
      [MOV] crm: move lead to opportunity in mass wizard in its own files · 5f6e9416
      Thibault Delavallée authored
      Lead 2 opportunity wizard file actually holds 2 wizards. Let us split files
      especially that naming is quite obfuscated.
      
      LINKS
      
      Side effect of Task ID 2056759 (remove crm.partner.binding mixin)
      Side effect of Task ID 2088565 (crm onchange -> compute)
      Community PR #43127
      Enterprise PR odoo/enterprise#7656
      5f6e9416
    • Thibault Delavallée's avatar
      [IMP] crm: clean and improve tests for lead2opportunity converters · ff6b35f7
      Thibault Delavallée authored
      PURPOSE
      
      As crm will soon evolve (onchange -> compute, code improvements, addition of
      new features) cleaning and improving tests is necessary to help avoid issues.
      
      SPECIFICATIONS
      
      In this commit we add tests for the lead 2 opportunity converters. Indeed
      it is strange that such a critical wizard has so few tests. Notably the
      use of single-lead / multi-lead mode is more tested, allowing to see that
      code is somewhat oldish.
      
      LINKS
      
      Side effect of Task ID 2056759 (remove crm.partner.binding mixin)
      Side effect of Task ID 2088565 (crm onchange -> compute)
      Community PR #43127
      Enterprise PR odoo/enterprise#7656
      ff6b35f7
    • Thibault Delavallée's avatar
      [IMP] event(_sale): perform some code removal / linting · a04b209c
      Thibault Delavallée authored
      PURPOSE
      
      As event will soon evolve (onchange -> compute, code improvements, addition of
      new features) cleaning and improving tests is necessary to help avoid issues.
      
      SPECIFICATIONS
      
      Use _tz_get for tz-based selection fields from partner as it smartly order
      available timezones.
      
      Remove a strange "event.confirm" wizard that calls an unexisting method,
      is not reachable and is actually completely unnecessary.
      
      Reorganize ticket fields to ease future improvements and perform some
      public -> private method cleaning.
      
      Remove duplicated code in event_sale.
      
      LINKS
      
      Side effect of Task ID 2089156 (event onchange to compute)
      Community PR odoo/odoo#43127
      Enterprise PR odoo/enterprise#7656
      
      prout
      a04b209c
    • Thibault Delavallée's avatar
      [MOV] (website_)event(_sale/_question/_track): split main model files · abcd6c15
      Thibault Delavallée authored
      PURPOSE
      
      As event will soon evolve (onchange -> compute, code improvements, addition of
      new features) cleaning and improving tests is necessary to help avoid issues.
      
      SPECIFICATIONS
      
      As event model grow in complexity and features, it is easier to find its
      way through the application with having registration model lying in its
      own file to separate it from event-specific models (event.type, event.event).
      
      Ticket (event_sale) and sponsor (website_event_track) models are also extracted
      in their own file.
      
      LINKS
      
      LINKS
      
      Side effect of Task ID 2089156 (event onchange to compute)
      Community PR odoo/odoo#43127
      Enterprise PR odoo/enterprise#7656
      abcd6c15
    • Thibault Delavallée's avatar
      [FIX] event: restrict event_count field on partner for event user only · 59e5c863
      Thibault Delavallée authored
      Currently event_count is a computed field with a shortcut in computation for
      non event user. It is better to directly limit this field to the event_user
      group instead.
      
      LINKS
      
      Side effect of Task ID 2089156 (event onchange to compute)
      Community PR odoo/odoo#43127
      Enterprise PR odoo/enterprise#7656
      59e5c863
    • Thibault Delavallée's avatar
      [IMP] (website_)event(_sale/_question/_track): clean and improve tests · 5ee901dc
      Thibault Delavallée authored
      PURPOSE
      
      As event will soon evolve (onchange -> compute, code improvements, addition of
      new features) cleaning and improving tests is necessary to help avoid issues.
      
      SPECIFICATIONS
      
      Clean existing tests: lessen data / variables, try to remove unnecessary
      tests or merge duplicates.
      
      Add new tests, notably event type configuration copy onto event records
      is not well tested. Event computed fields are also more tested.
      
      Some access tests are added, more a base for future addition as only a few
      use cases are covered.
      
      LINKS
      
      Side effect of Task ID 2089156 (event onchange to compute)
      Community PR odoo/odoo#43127
      Enterprise PR odoo/enterprise#7656
      5ee901dc
    • fw-bot's avatar
      [FIX] account: Manage group of taxes everytime · eeac89f0
      fw-bot authored
      
      Before the merge of account.invoice with account.move, a group of taxes was
      expanded on journal items and not on invoice lines. Since both are now the
      same thing, we only get the group of taxes when using the 'tax_ids' field.
      To correctly handle this new behavior, we need to call 'flatten_taxes_hierarchy'
      every time we use the 'tax_ids' field to get the children taxes instead of the
      group of taxes itself.
      
      [FIX] account: Wrong unit price with included tax and fiscal position
      
      Steps to reproduce the bug:
      
      Let's consider a sale included tax T1 of 10% and a sale excluded tax T2 of 0%
      Let's consider a product P with T1 and a sale price of 110€
      Let's consider a fiscal position FP that mappes T1 to T2
      Let's consider a customer C with FP as fiscal position
      Create a customer invoice for C
      Add P on the first line and T1 is replaced by T2
      Bug:
      
      The unit price of P was still 110€ instead of 100€ because the included tax was not removed from the base
      price of P.
      
      Same behavior as in 11.0 and 12.0
      
      opw:2150564
      
      closes odoo/odoo#43100
      
      Co-author: simongoffin (sig@odoo.com)
      Forward-port-of: #42926
      Forward-port-of: #42188
      Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
      eeac89f0
    • Yannick Tivisse's avatar
      [IMP] sale_timesheet: Fix undeterministic crashing test · dce3a432
      Yannick Tivisse authored
      
      The method 'test_timesheet_delivery' tests the following use case:
      
      Test timesheet invoicing with 'invoice on delivery' timetracked products
      1. Create SO and confirm it
      2. log timesheet
      3. create invoice
      4. log other timesheet
      5. create a second invoice
      6. add new SO line (delivered service)
      7. And finally check the AMOUNTS
      
      But it could happen, according to the installed modules, that the class
      TestSaleTimesheet, which is directly linked to
      -> TestCommonSaleTimesheetNoChart (sale_timesheet)
      --> TestCommonSaleNoChart (sale)
      ---> AccountTestNoChartCommon (account)
      ----> SavepointCaseWithUserDemo (base)
      -----> SavepointCase (base)
      is influenced by other installed modules, that in our case, introduce
      new res.currency.rate values.
      
      In our test, on the sale.order.line 'so_line_ordered_global_project',
      we use the product 'product_order_timesheet2', with a price_unit=90.
      
      Then we call manually the onchange method:
      ``` python3
      so_line_ordered_global_project.product_id_change()
      ```
      
      As the order has a pricelist and a partner, we recompute the price
      unit, in case a discount applies:
      ``` python3
      if self.order_id.pricelist_id and self.order_id.partner_id:
          vals['price_unit'] = self.env['account.tax']._fix_tax_included_price_company(self._get_display_price(product), product.taxes_id, self.tax_id, self.company_id)
      self.update(vals)
      ```
      
      And then , the call the _get_display_price returns an different amount
      that what we expect, as
      ``` python3
      product.with_context(pricelist=self.order_id.pricelist_id.id).price
      ```
      
      will return the price converted using the related res.currency.rate
      at the current date.
      
      As we don't wish to test the conversion into another currency in this
      test, we simply unlink all the currency rates, to avoid any external
      influence.
      
      closes odoo/odoo#42606
      
      Taskid: 2166237
      Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
      dce3a432
  11. Jan 09, 2020
  12. Jan 10, 2020
  13. Jan 09, 2020
  14. Jan 10, 2020
    • Christophe Monniez's avatar
      [FIX] requirements: update library versions to match Debian Buster · 29f02a37
      Christophe Monniez authored
      
      Some library versions are outdated since the release of Debian Buster.
      
      With this commit the required libraries versions will match as close as
      possible the versions available in the current Debian stable release
      (Buster).
      
      Also, the requirements were tested against a Windows Python 3.7 to
      ensure that a "pip install -r" can be used without the need of a CPP
      compiler.
      
      As Babel format_time now returns 'HNE' (Heure Normale de l'EST) for Fr
      locale instead of the zone offset, the test is adapted.
      
      Finally the babel.dates is explicitely imported, otherwise the proper
      import of this submodule is relying on a side effect.
      
      closes odoo/odoo#43106
      
      X-original-commit: 32e455bf
      Signed-off-by: default avatarChristophe Monniez (moc) <moc@odoo.com>
      29f02a37
  15. Jan 09, 2020
  16. Jan 06, 2020
    • Andrea Grazioso (agr-odoo)'s avatar
      [FIX] web: avoid parsing value if already number · bbe944c8
      Andrea Grazioso (agr-odoo) authored
      
      When accessing stock_barcode module to validate pickings, is not
      possible to add floating point quantities for any localizaton which uses
      ',' as decimal separator.
      The numeric field is now defined via browser tags <input="numeric"> to
      make the numeric keyboard popup automatically on mobile devices
      (commit 8f5840369b28962ab2be9edfce7331a836c3df22)
      Adding the override to avoid further processing when the input
      is already anumber
      
      opw-2154657
      
      closes odoo/odoo#42748
      
      X-original-commit: 1ccc60deeb067f8d461d48cbf51719317c22cb90
      Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
      bbe944c8
  17. Jan 10, 2020
  18. Jan 06, 2020
  19. Jan 09, 2020
Loading